diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 8576feb6a93..0ee8c670893 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -9e950cbf7b5a814a98f27d1a94b72cd6f1df2078 \ No newline at end of file +d70a4348dd46ca726ca64c856ce6bab15e87b470 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 604997fea3a..4ec501ea29c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2203 \ No newline at end of file +v2205 \ No newline at end of file diff --git a/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEvent.java b/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEvent.java new file mode 100644 index 00000000000..42b507db585 --- /dev/null +++ b/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEvent.java @@ -0,0 +1,72 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; +import java.time.Instant; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V1AccountSignalsIncludingDelinquencyCreatedEvent extends Event { + /** Data for the v1.account_signals[delinquency].created event. */ + @SerializedName("data") + V1AccountSignalsIncludingDelinquencyCreatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** The account for which the signals belong to. */ + @SerializedName("account") + String account; + /** Time at which the signal was evaluated. */ + @SerializedName("evaluated_at") + Instant evaluatedAt; + /** + * Array of objects representing individual factors that contributed to the calculated + * probability of delinquency. + */ + @SerializedName("indicators") + List indicators; + /** The probability of delinquency. Can be between 0.00 and 100.00. */ + @SerializedName("probability") + BigDecimal probability; + /** + * Categorical assessment of the delinquency risk based on probability. + * + *

One of {@code elevated}, {@code highest}, {@code low}, {@code normal}, {@code + * not_assessed}, or {@code unknown}. + */ + @SerializedName("risk_level") + String riskLevel; + /** Unique identifier for the delinquency signal. */ + @SerializedName("signal_id") + String signalId; + + public static final class Indicator { + /** A brief explanation of how this indicator contributed to the delinquency probability. */ + @SerializedName("description") + String description; + /** + * The effect this indicator had on the overall risk level. + * + *

One of {@code decrease}, {@code neutral}, {@code slight_increase}, or {@code + * strong_increase}. + */ + @SerializedName("impact") + String impact; + /** + * The name of the specific indicator used in the risk assessment. + * + *

One of {@code account_balance}, {@code aov}, {@code charge_concentration}, {@code + * disputes}, {@code dispute_window}, {@code duplicates}, {@code exposure}, {@code + * firmographic}, {@code lifetime_metrics}, {@code payment_processing}, {@code + * payment_volume}, {@code payouts}, {@code refunds}, {@code tenure}, or {@code transfers}. + */ + @SerializedName("indicator") + String indicator; + } + } +} diff --git a/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEventNotification.java b/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEventNotification.java new file mode 100644 index 00000000000..ba2811d094b --- /dev/null +++ b/src/main/java/com/stripe/events/V1AccountSignalsIncludingDelinquencyCreatedEventNotification.java @@ -0,0 +1,14 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.EventNotification; + +public final class V1AccountSignalsIncludingDelinquencyCreatedEventNotification + extends EventNotification { + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V1AccountSignalsIncludingDelinquencyCreatedEvent fetchEvent() throws StripeException { + return (V1AccountSignalsIncludingDelinquencyCreatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEvent.java b/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEvent.java new file mode 100644 index 00000000000..e1a91b08c94 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEvent.java @@ -0,0 +1,47 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.v2.core.Event; +import java.time.Instant; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2CoreAccountSignalsFraudulentWebsiteReadyEvent extends Event { + /** Data for the v2.core.account_signals.fraudulent_website_ready event. */ + @SerializedName("data") + V2CoreAccountSignalsFraudulentWebsiteReadyEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** The account for which the signals belong to. Empty if this was an entityless request. */ + @SerializedName("account") + String account; + /** + * Human readable description of concerns found in the website, produced by LLM. If risk_level + * is unknown, this explains why evaluation could not run. + */ + @SerializedName("details") + String details; + /** Time at which the signal was evaluated. */ + @SerializedName("evaluated_at") + Instant evaluatedAt; + /** Unique identifier for the fraudulent website evaluation request. */ + @SerializedName("evaluation_id") + String evaluationId; + /** + * Risk level for the fraudulent website signal. If evaluation could not run (like invalid + * website), we return unknown. + * + *

One of {@code elevated}, {@code highest}, {@code low}, {@code normal}, {@code + * not_assessed}, or {@code unknown}. + */ + @SerializedName("risk_level") + String riskLevel; + /** Unique identifier for the fraudulent website signal. */ + @SerializedName("signal_id") + String signalId; + } +} diff --git a/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification.java b/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification.java new file mode 100644 index 00000000000..8233611e6c0 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification.java @@ -0,0 +1,14 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.EventNotification; + +public final class V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification + extends EventNotification { + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreAccountSignalsFraudulentWebsiteReadyEvent fetchEvent() throws StripeException { + return (V2CoreAccountSignalsFraudulentWebsiteReadyEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java new file mode 100644 index 00000000000..01b73e46355 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobBatchFailedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java new file mode 100644 index 00000000000..43fd75ea458 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobBatchFailedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobBatchFailedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobBatchFailedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobBatchFailedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java new file mode 100644 index 00000000000..dbc844ac9cc --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCanceledEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java new file mode 100644 index 00000000000..f6822dfddc2 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCanceledEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCanceledEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobCanceledEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobCanceledEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java new file mode 100644 index 00000000000..0631ef3db37 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCompletedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java new file mode 100644 index 00000000000..3d000c119d2 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCompletedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCompletedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobCompletedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobCompletedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java new file mode 100644 index 00000000000..b12abcecf09 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCreatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java new file mode 100644 index 00000000000..1b5e934daae --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobCreatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobCreatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobCreatedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobCreatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java new file mode 100644 index 00000000000..e82c35c9005 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobReadyForUploadEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java new file mode 100644 index 00000000000..74f5acae6be --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobReadyForUploadEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobReadyForUploadEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobReadyForUploadEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobReadyForUploadEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java new file mode 100644 index 00000000000..8f9ac367539 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobTimeoutEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java new file mode 100644 index 00000000000..53a6bbe5cdb --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobTimeoutEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobTimeoutEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobTimeoutEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobTimeoutEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java new file mode 100644 index 00000000000..1406fe05335 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUpdatedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java new file mode 100644 index 00000000000..b5a6ad485bc --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUpdatedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUpdatedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobUpdatedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobUpdatedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java new file mode 100644 index 00000000000..dbc64ad541c --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUploadTimeoutEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java new file mode 100644 index 00000000000..ba3dbeadee7 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobUploadTimeoutEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobUploadTimeoutEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobUploadTimeoutEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobUploadTimeoutEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java new file mode 100644 index 00000000000..c382cf6c2af --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidatingEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java new file mode 100644 index 00000000000..4b8a29dd0a7 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidatingEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidatingEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobValidatingEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobValidatingEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java new file mode 100644 index 00000000000..29ea687b803 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEvent.java @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event; +import com.stripe.model.v2.core.Event.RelatedObject; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidationFailedEvent extends Event { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java new file mode 100644 index 00000000000..35088400687 --- /dev/null +++ b/src/main/java/com/stripe/events/V2CoreBatchJobValidationFailedEventNotification.java @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.model.v2.core.Event.RelatedObject; +import com.stripe.model.v2.core.EventNotification; +import lombok.Getter; + +@Getter +public final class V2CoreBatchJobValidationFailedEventNotification extends EventNotification { + @SerializedName("related_object") + + /** Object containing the reference to API resource relevant to the event. */ + RelatedObject relatedObject; + + /** Retrieves the related object from the API. Make an API request on every call. */ + public BatchJob fetchRelatedObject() throws StripeException { + return (BatchJob) super.fetchRelatedObject(this.relatedObject); + } + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2CoreBatchJobValidationFailedEvent fetchEvent() throws StripeException { + return (V2CoreBatchJobValidationFailedEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/events/V2CoreHealthApiErrorFiringEvent.java b/src/main/java/com/stripe/events/V2CoreHealthApiErrorFiringEvent.java index 41c0f6c1644..2e1b19d2457 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthApiErrorFiringEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthApiErrorFiringEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.Getter; @@ -55,7 +56,7 @@ public static final class Impact { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; /** The top impacted connected accounts (only for platforms). */ @SerializedName("top_impacted_accounts") List topImpactedAccounts; @@ -69,7 +70,7 @@ public static final class TopImpactedAccount { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthApiErrorResolvedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthApiErrorResolvedEvent.java index 30f6e50b6a5..a8e99ea0933 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthApiErrorResolvedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthApiErrorResolvedEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.Getter; @@ -55,7 +56,7 @@ public static final class Impact { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; /** The top impacted connected accounts (only for platforms). */ @SerializedName("top_impacted_accounts") List @@ -70,7 +71,7 @@ public static final class TopImpactedAccount { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthApiLatencyFiringEvent.java b/src/main/java/com/stripe/events/V2CoreHealthApiLatencyFiringEvent.java index 5c9315292c0..b78c5102e5b 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthApiLatencyFiringEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthApiLatencyFiringEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.Getter; @@ -52,7 +53,7 @@ public static final class Impact { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; /** The top impacted connected accounts (only for platforms). */ @SerializedName("top_impacted_accounts") List @@ -67,7 +68,7 @@ public static final class TopImpactedAccount { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthApiLatencyResolvedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthApiLatencyResolvedEvent.java index c5fdc1be9b4..154ab9a5904 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthApiLatencyResolvedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthApiLatencyResolvedEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.Getter; @@ -52,7 +53,7 @@ public static final class Impact { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; /** The top impacted connected accounts (only for platforms). */ @SerializedName("top_impacted_accounts") List @@ -67,7 +68,7 @@ public static final class TopImpactedAccount { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropFiringEvent.java b/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropFiringEvent.java index 139037fe617..8b2b2846776 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropFiringEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropFiringEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.Getter; @@ -43,7 +44,7 @@ public static final class Impact { String chargeType; /** The current authorization rate percentage. */ @SerializedName("current_percentage") - String currentPercentage; + BigDecimal currentPercentage; /** Dimensions that describe what subset of payments are impacted. */ @SerializedName("dimensions") List dimensions; @@ -70,7 +71,7 @@ public static final class Impact { String paymentMethodType; /** The previous authorization rate percentage. */ @SerializedName("previous_percentage") - String previousPercentage; + BigDecimal previousPercentage; public static final class Dimension { /** The issuer dimension. */ diff --git a/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropResolvedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropResolvedEvent.java index 7d58035ee57..b3ae9e68e8a 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropResolvedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthAuthorizationRateDropResolvedEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.Getter; @@ -43,7 +44,7 @@ public static final class Impact { String chargeType; /** The current authorization rate percentage. */ @SerializedName("current_percentage") - String currentPercentage; + BigDecimal currentPercentage; /** Dimensions that describe what subset of payments are impacted. */ @SerializedName("dimensions") List dimensions; @@ -70,7 +71,7 @@ public static final class Impact { String paymentMethodType; /** The previous authorization rate percentage. */ @SerializedName("previous_percentage") - String previousPercentage; + BigDecimal previousPercentage; public static final class Dimension { /** The issuer dimension. */ diff --git a/src/main/java/com/stripe/events/V2CoreHealthFraudRateIncreasedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthFraudRateIncreasedEvent.java index 85696a900e3..6ba5b5249b2 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthFraudRateIncreasedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthFraudRateIncreasedEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.Getter; import lombok.Setter; @@ -48,23 +49,7 @@ public static final class Impact { Long impactedRequests; /** Estimated aggregated amount for the impacted requests. */ @SerializedName("realized_fraud_amount") - RealizedFraudAmount realizedFraudAmount; - - public static final class RealizedFraudAmount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } + Amount realizedFraudAmount; } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestErrorsFiringEvent.java b/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestErrorsFiringEvent.java index 90ae8a47990..3bc15bf47d6 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestErrorsFiringEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestErrorsFiringEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.Getter; import lombok.Setter; @@ -32,48 +33,16 @@ public static final class EventData { public static final class Impact { /** Estimated aggregated amount for the approved requests. */ @SerializedName("approved_amount") - ApprovedAmount approvedAmount; + Amount approvedAmount; /** The number of approved requests which are impacted. */ @SerializedName("approved_impacted_requests") Long approvedImpactedRequests; /** Estimated aggregated amount for the declined requests. */ @SerializedName("declined_amount") - DeclinedAmount declinedAmount; + Amount declinedAmount; /** The number of declined requests which are impacted. */ @SerializedName("declined_impacted_requests") Long declinedImpactedRequests; - - public static final class ApprovedAmount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - public static final class DeclinedAmount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestErrorsResolvedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestErrorsResolvedEvent.java index 1f1464a4738..fce01ca74c9 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestErrorsResolvedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestErrorsResolvedEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.Getter; import lombok.Setter; @@ -35,48 +36,16 @@ public static final class EventData { public static final class Impact { /** Estimated aggregated amount for the approved requests. */ @SerializedName("approved_amount") - ApprovedAmount approvedAmount; + Amount approvedAmount; /** The number of approved requests which are impacted. */ @SerializedName("approved_impacted_requests") Long approvedImpactedRequests; /** Estimated aggregated amount for the declined requests. */ @SerializedName("declined_amount") - DeclinedAmount declinedAmount; + Amount declinedAmount; /** The number of declined requests which are impacted. */ @SerializedName("declined_impacted_requests") Long declinedImpactedRequests; - - public static final class ApprovedAmount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - public static final class DeclinedAmount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestTimeoutFiringEvent.java b/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestTimeoutFiringEvent.java index c135ce92f45..3817a4b835d 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestTimeoutFiringEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestTimeoutFiringEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.Getter; import lombok.Setter; @@ -35,48 +36,16 @@ public static final class EventData { public static final class Impact { /** Estimated aggregated amount for the approved requests. */ @SerializedName("approved_amount") - ApprovedAmount approvedAmount; + Amount approvedAmount; /** The number of approved requests which are impacted. */ @SerializedName("approved_impacted_requests") Long approvedImpactedRequests; /** Estimated aggregated amount for the declined requests. */ @SerializedName("declined_amount") - DeclinedAmount declinedAmount; + Amount declinedAmount; /** The number of declined requests which are impacted. */ @SerializedName("declined_impacted_requests") Long declinedImpactedRequests; - - public static final class ApprovedAmount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - public static final class DeclinedAmount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEvent.java index 339af97079b..f374cedcf01 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthIssuingAuthorizationRequestTimeoutResolvedEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.Getter; import lombok.Setter; @@ -35,48 +36,16 @@ public static final class EventData { public static final class Impact { /** Estimated aggregated amount for the approved requests. */ @SerializedName("approved_amount") - ApprovedAmount approvedAmount; + Amount approvedAmount; /** The number of approved requests which are impacted. */ @SerializedName("approved_impacted_requests") Long approvedImpactedRequests; /** Estimated aggregated amount for the declined requests. */ @SerializedName("declined_amount") - DeclinedAmount declinedAmount; + Amount declinedAmount; /** The number of declined requests which are impacted. */ @SerializedName("declined_impacted_requests") Long declinedImpactedRequests; - - public static final class ApprovedAmount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - public static final class DeclinedAmount { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorFiringEvent.java b/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorFiringEvent.java index 47faae41703..731ca325e0d 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorFiringEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorFiringEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.Getter; @@ -42,7 +43,7 @@ public static final class Impact { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; /** * The type of the payment method. * @@ -78,7 +79,7 @@ public static final class TopImpactedAccount { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorResolvedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorResolvedEvent.java index e3b993529d5..b040970e8d5 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorResolvedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthPaymentMethodErrorResolvedEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.Getter; @@ -42,7 +43,7 @@ public static final class Impact { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; /** * The type of the payment method. * @@ -78,7 +79,7 @@ public static final class TopImpactedAccount { Long impactedRequests; /** The percentage of impacted requests. */ @SerializedName("impacted_requests_percentage") - String impactedRequestsPercentage; + BigDecimal impactedRequestsPercentage; } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthSepaDebitDelayedFiringEvent.java b/src/main/java/com/stripe/events/V2CoreHealthSepaDebitDelayedFiringEvent.java index d65594f23bf..f8ad9009a65 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthSepaDebitDelayedFiringEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthSepaDebitDelayedFiringEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import lombok.Getter; import lombok.Setter; @@ -35,7 +36,7 @@ public static final class Impact { Long impactedPayments; /** The percentage of impacted payments. */ @SerializedName("impacted_payments_percentage") - String impactedPaymentsPercentage; + BigDecimal impactedPaymentsPercentage; } } } diff --git a/src/main/java/com/stripe/events/V2CoreHealthSepaDebitDelayedResolvedEvent.java b/src/main/java/com/stripe/events/V2CoreHealthSepaDebitDelayedResolvedEvent.java index 3c4011c51f3..56a57140d75 100644 --- a/src/main/java/com/stripe/events/V2CoreHealthSepaDebitDelayedResolvedEvent.java +++ b/src/main/java/com/stripe/events/V2CoreHealthSepaDebitDelayedResolvedEvent.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; import java.time.Instant; import lombok.Getter; import lombok.Setter; @@ -38,7 +39,7 @@ public static final class Impact { Long impactedPayments; /** The percentage of impacted payments. */ @SerializedName("impacted_payments_percentage") - String impactedPaymentsPercentage; + BigDecimal impactedPaymentsPercentage; } } } diff --git a/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEvent.java b/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEvent.java new file mode 100644 index 00000000000..341e0c58622 --- /dev/null +++ b/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEvent.java @@ -0,0 +1,94 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.v2.core.Event; +import java.math.BigDecimal; +import java.time.Instant; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +public final class V2SignalsAccountSignalFraudulentMerchantReadyEvent extends Event { + /** Data for the v2.signals.account_signal.fraudulent_merchant_ready event. */ + @SerializedName("data") + V2SignalsAccountSignalFraudulentMerchantReadyEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** Account ID that this signal is associated with. */ + @SerializedName("account") + String account; + /** Timestamp when the signal was evaluated. */ + @SerializedName("evaluated_at") + Instant evaluatedAt; + /** Fraudulent merchant signal data. Present when type is fraudulent_merchant. */ + @SerializedName("fraudulent_merchant") + FraudulentMerchant fraudulentMerchant; + /** Unique identifier for this account signal. */ + @SerializedName("id") + String id; + /** + * The type of account signal. Currently only fraudulent_merchant is supported. + * + *

Equal to {@code fraudulent_merchant}. + */ + @SerializedName("type") + String type; + + public static final class FraudulentMerchant { + /** + * Array of objects representing individual factors that contributed to the calculated + * probability. Maximum of 3. + */ + @SerializedName("indicators") + List< + V2SignalsAccountSignalFraudulentMerchantReadyEvent.EventData.FraudulentMerchant + .Indicator> + indicators; + /** + * The probability of the merchant being fraudulent. Can be between 0.00 and 100.00. May be + * empty if the risk_level is UNKNOWN or NOT_ASSESSED. + */ + @SerializedName("probability") + BigDecimal probability; + /** + * Categorical assessment of the fraudulent merchant risk based on probability. + * + *

One of {@code elevated}, {@code highest}, {@code low}, {@code normal}, {@code + * not_assessed}, or {@code unknown}. + */ + @SerializedName("risk_level") + String riskLevel; + + public static final class Indicator { + /** + * A brief explanation of how this indicator contributed to the fraudulent merchant + * probability. + */ + @SerializedName("description") + String description; + /** + * The effect this indicator had on the overall risk level. + * + *

One of {@code decrease}, {@code neutral}, {@code slight_increase}, or {@code + * strong_increase}. + */ + @SerializedName("impact") + String impact; + /** + * The name of the specific indicator used in the risk assessment. + * + *

One of {@code bank_account}, {@code business_information_and_account_activity}, {@code + * disputes}, {@code failures}, {@code geolocation}, {@code other}, {@code + * other_related_accounts}, {@code other_transaction_activity}, {@code owner_email}, or + * {@code web_presence}. + */ + @SerializedName("indicator") + String indicator; + } + } + } +} diff --git a/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEventNotification.java b/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEventNotification.java new file mode 100644 index 00000000000..2b6612ac981 --- /dev/null +++ b/src/main/java/com/stripe/events/V2SignalsAccountSignalFraudulentMerchantReadyEventNotification.java @@ -0,0 +1,14 @@ +// File generated from our OpenAPI spec +package com.stripe.events; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.EventNotification; + +public final class V2SignalsAccountSignalFraudulentMerchantReadyEventNotification + extends EventNotification { + /** Retrieve the corresponding full event from the Stripe API. */ + @Override + public V2SignalsAccountSignalFraudulentMerchantReadyEvent fetchEvent() throws StripeException { + return (V2SignalsAccountSignalFraudulentMerchantReadyEvent) super.fetchEvent(); + } +} diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 6d26907bbe9..297958b6970 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -7605,14 +7605,6 @@ public static class UsBankAccount extends StripeObject { @SerializedName("mandate_options") MandateOptions mandateOptions; - /** - * Preferred transaction settlement speed - * - *

One of {@code fastest}, or {@code standard}. - */ - @SerializedName("preferred_settlement_speed") - String preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * diff --git a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java index 81e42a784e6..619371d772f 100644 --- a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java @@ -43,9 +43,6 @@ public final class EventDataClassLookup { classLookup.put("v2.billing.intent", com.stripe.model.v2.billing.Intent.class); classLookup.put("v2.billing.intent_action", com.stripe.model.v2.billing.IntentAction.class); classLookup.put("v2.billing.license_fee", com.stripe.model.v2.billing.LicenseFee.class); - classLookup.put( - "v2.billing.license_fee_subscription", - com.stripe.model.v2.billing.LicenseFeeSubscription.class); classLookup.put( "v2.billing.license_fee_version", com.stripe.model.v2.billing.LicenseFeeVersion.class); classLookup.put("v2.billing.licensed_item", com.stripe.model.v2.billing.LicensedItem.class); @@ -64,9 +61,6 @@ 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); @@ -83,11 +77,13 @@ public final class EventDataClassLookup { classLookup.put("v2.billing.service_action", com.stripe.model.v2.billing.ServiceAction.class); classLookup.put("v2.core.account", com.stripe.model.v2.core.Account.class); + classLookup.put("v2.core.account_evaluation", com.stripe.model.v2.core.AccountEvaluation.class); classLookup.put("v2.core.account_link", com.stripe.model.v2.core.AccountLink.class); classLookup.put("v2.core.account_person", com.stripe.model.v2.core.AccountPerson.class); classLookup.put( "v2.core.account_person_token", com.stripe.model.v2.core.AccountPersonToken.class); classLookup.put("v2.core.account_token", com.stripe.model.v2.core.AccountToken.class); + classLookup.put("v2.core.batch_job", com.stripe.model.v2.core.BatchJob.class); classLookup.put("v2.core.claimable_sandbox", com.stripe.model.v2.core.ClaimableSandbox.class); classLookup.put("v2.core.connection_session", com.stripe.model.v2.core.ConnectionSession.class); classLookup.put("v2.core.event", com.stripe.model.v2.core.Event.class); @@ -161,6 +157,9 @@ public final class EventDataClassLookup { classLookup.put("v2.tax.manual_rule", com.stripe.model.v2.tax.ManualRule.class); + eventClassLookup.put( + "v1.account_signals[delinquency].created", + com.stripe.events.V1AccountSignalsIncludingDelinquencyCreatedEvent.class); eventClassLookup.put( "v1.billing.meter.error_report_triggered", com.stripe.events.V1BillingMeterErrorReportTriggeredEvent.class); @@ -335,6 +334,32 @@ public final class EventDataClassLookup { "v2.core.account_person.deleted", com.stripe.events.V2CoreAccountPersonDeletedEvent.class); eventClassLookup.put( "v2.core.account_person.updated", com.stripe.events.V2CoreAccountPersonUpdatedEvent.class); + eventClassLookup.put( + "v2.core.account_signals.fraudulent_website_ready", + com.stripe.events.V2CoreAccountSignalsFraudulentWebsiteReadyEvent.class); + eventClassLookup.put( + "v2.core.batch_job.batch_failed", com.stripe.events.V2CoreBatchJobBatchFailedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.canceled", com.stripe.events.V2CoreBatchJobCanceledEvent.class); + eventClassLookup.put( + "v2.core.batch_job.completed", com.stripe.events.V2CoreBatchJobCompletedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.created", com.stripe.events.V2CoreBatchJobCreatedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.ready_for_upload", + com.stripe.events.V2CoreBatchJobReadyForUploadEvent.class); + eventClassLookup.put( + "v2.core.batch_job.timeout", com.stripe.events.V2CoreBatchJobTimeoutEvent.class); + eventClassLookup.put( + "v2.core.batch_job.updated", com.stripe.events.V2CoreBatchJobUpdatedEvent.class); + eventClassLookup.put( + "v2.core.batch_job.upload_timeout", + com.stripe.events.V2CoreBatchJobUploadTimeoutEvent.class); + eventClassLookup.put( + "v2.core.batch_job.validating", com.stripe.events.V2CoreBatchJobValidatingEvent.class); + eventClassLookup.put( + "v2.core.batch_job.validation_failed", + com.stripe.events.V2CoreBatchJobValidationFailedEvent.class); eventClassLookup.put( "v2.core.claimable_sandbox.claimed", com.stripe.events.V2CoreClaimableSandboxClaimedEvent.class); @@ -624,5 +649,8 @@ public final class EventDataClassLookup { eventClassLookup.put( "v2.reporting.report_run.updated", com.stripe.events.V2ReportingReportRunUpdatedEvent.class); + eventClassLookup.put( + "v2.signals.account_signal.fraudulent_merchant_ready", + com.stripe.events.V2SignalsAccountSignalFraudulentMerchantReadyEvent.class); } } diff --git a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java index a0209485cd7..0cbbd818354 100644 --- a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java @@ -16,6 +16,9 @@ public final class EventNotificationClassLookup { new HashMap<>(); static { + eventClassLookup.put( + "v1.account_signals[delinquency].created", + com.stripe.events.V1AccountSignalsIncludingDelinquencyCreatedEventNotification.class); eventClassLookup.put( "v1.billing.meter.error_report_triggered", com.stripe.events.V1BillingMeterErrorReportTriggeredEventNotification.class); @@ -215,6 +218,39 @@ public final class EventNotificationClassLookup { eventClassLookup.put( "v2.core.account_person.updated", com.stripe.events.V2CoreAccountPersonUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.account_signals.fraudulent_website_ready", + com.stripe.events.V2CoreAccountSignalsFraudulentWebsiteReadyEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.batch_failed", + com.stripe.events.V2CoreBatchJobBatchFailedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.canceled", + com.stripe.events.V2CoreBatchJobCanceledEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.completed", + com.stripe.events.V2CoreBatchJobCompletedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.created", + com.stripe.events.V2CoreBatchJobCreatedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.ready_for_upload", + com.stripe.events.V2CoreBatchJobReadyForUploadEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.timeout", + com.stripe.events.V2CoreBatchJobTimeoutEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.updated", + com.stripe.events.V2CoreBatchJobUpdatedEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.upload_timeout", + com.stripe.events.V2CoreBatchJobUploadTimeoutEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.validating", + com.stripe.events.V2CoreBatchJobValidatingEventNotification.class); + eventClassLookup.put( + "v2.core.batch_job.validation_failed", + com.stripe.events.V2CoreBatchJobValidationFailedEventNotification.class); eventClassLookup.put( "v2.core.claimable_sandbox.claimed", com.stripe.events.V2CoreClaimableSandboxClaimedEventNotification.class); @@ -521,5 +557,8 @@ public final class EventNotificationClassLookup { eventClassLookup.put( "v2.reporting.report_run.updated", com.stripe.events.V2ReportingReportRunUpdatedEventNotification.class); + eventClassLookup.put( + "v2.signals.account_signal.fraudulent_merchant_ready", + com.stripe.events.V2SignalsAccountSignalFraudulentMerchantReadyEventNotification.class); } } diff --git a/src/main/java/com/stripe/model/v2/FinancialAddressGeneratedMicrodeposits.java b/src/main/java/com/stripe/model/v2/FinancialAddressGeneratedMicrodeposits.java index 621a62e20f3..1405406e3ee 100644 --- a/src/main/java/com/stripe/model/v2/FinancialAddressGeneratedMicrodeposits.java +++ b/src/main/java/com/stripe/model/v2/FinancialAddressGeneratedMicrodeposits.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -18,7 +19,7 @@ public class FinancialAddressGeneratedMicrodeposits extends StripeObject { /** The amounts of the microdeposits that were generated. */ @SerializedName("amounts") - List amounts; + List amounts; /** * Has the value {@code true} if the object exists in live mode or the value {@code false} if the @@ -43,28 +44,4 @@ public class FinancialAddressGeneratedMicrodeposits extends StripeObject { */ @SerializedName("status") String status; - - /** - * For more details about Amount, please refer to the API - * Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } 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 e8f03b548c4..b4fda734733 100644 --- a/src/main/java/com/stripe/model/v2/billing/Cadence.java +++ b/src/main/java/com/stripe/model/v2/billing/Cadence.java @@ -1,9 +1,12 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import java.util.Map; @@ -356,7 +359,7 @@ public static class PercentOff extends StripeObject { * $100 amount $50 instead. */ @SerializedName("percent_off") - String percentOff; + BigDecimal percentOff; /** The maximum applications configuration for this discount. */ @Getter @@ -722,6 +725,7 @@ public static class Card extends StripeObject { public static class MandateOptions extends StripeObject { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ 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 4a9be6c5836..146ebdd6e6c 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.time.Instant; import java.util.List; @@ -247,6 +249,7 @@ public static class Card extends StripeObject { public static class MandateOptions extends StripeObject { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ 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 fb3cbd49a15..2035073002d 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.time.Instant; import java.util.List; @@ -226,6 +228,7 @@ public static class Card extends StripeObject { public static class MandateOptions extends StripeObject { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/model/v2/billing/Intent.java b/src/main/java/com/stripe/model/v2/billing/Intent.java index 073de4ac14d..75188bf0a0b 100644 --- a/src/main/java/com/stripe/model/v2/billing/Intent.java +++ b/src/main/java/com/stripe/model/v2/billing/Intent.java @@ -44,6 +44,13 @@ public class Intent extends StripeObject implements HasId { @SerializedName("id") String id; + /** + * Invoice resources associated with this Billing Intent. Populated when include parameters are + * specified. + */ + @SerializedName("invoice_resources") + InvoiceResources invoiceResources; + /** * Has the value {@code true} if the object exists in live mode or the value {@code false} if the * object exists in test mode. @@ -77,10 +84,18 @@ public class Intent extends StripeObject implements HasId { @Setter @EqualsAndHashCode(callSuper = false) public static class AmountDetails extends StripeObject { + /** The outstanding amount after discount, tax, and customer balance application. */ + @SerializedName("amount_due") + String amountDue; + /** Three-letter ISO currency code, in lowercase. Must be a supported currency. */ @SerializedName("currency") String currency; + /** The customer's account balance applied to the amount. */ + @SerializedName("customer_balance_applied") + String customerBalanceApplied; + /** Amount of discount applied. */ @SerializedName("discount") String discount; @@ -423,6 +438,23 @@ public static class Collection extends StripeObject implements HasId { } } + /** + * Invoice resources associated with this Billing Intent. Populated when include parameters are + * specified. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InvoiceResources extends StripeObject { + /** + * ID of a preview invoice showing the breakdown of line items. Null if the billing intent will + * not create an invoice. Only present when "invoice_resources.preview_invoice" is + * included. + */ + @SerializedName("preview_invoice") + String previewInvoice; + } + /** Timestamps for status transitions of the Billing Intent. */ @Getter @Setter @@ -440,6 +472,10 @@ public static class StatusTransitions extends StripeObject { @SerializedName("drafted_at") Instant draftedAt; + /** Time at which the Billing Intent will expire. */ + @SerializedName("expires_at") + Instant expiresAt; + /** Time at which the Billing Intent was reserved. */ @SerializedName("reserved_at") Instant reservedAt; diff --git a/src/main/java/com/stripe/model/v2/billing/IntentAction.java b/src/main/java/com/stripe/model/v2/billing/IntentAction.java index b45198b52e4..707670ac283 100644 --- a/src/main/java/com/stripe/model/v2/billing/IntentAction.java +++ b/src/main/java/com/stripe/model/v2/billing/IntentAction.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import java.util.Map; @@ -80,7 +81,11 @@ public class IntentAction extends StripeObject implements HasId { @Setter @EqualsAndHashCode(callSuper = false) public static class Apply extends StripeObject { - /** When the apply action will take effect. Defaults to on_reserve if not specified. */ + /** Details for applying a discount. */ + @SerializedName("discount") + Discount discount; + + /** When the apply action will take effect. If not specified, defaults to on_reserve. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -95,21 +100,54 @@ public static class Apply extends StripeObject { /** * Type of the apply action details. * - *

One of {@code invoice_discount_rule}, or {@code spend_modifier_rule}. + *

One of {@code discount}, {@code invoice_discount_rule}, or {@code spend_modifier_rule}. */ @SerializedName("type") String type; - /** When the apply action will take effect. Defaults to on_reserve if not specified. */ + /** Details for applying a discount. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Discount extends StripeObject { + /** The ID of the Coupon applied. */ + @SerializedName("coupon") + String coupon; + + /** The ID of the created Discount. */ + @SerializedName("discount") + String discount; + + /** The ID of the PromotionCode applied. */ + @SerializedName("promotion_code") + String promotionCode; + + /** + * Type of the discount. + * + *

One of {@code coupon}, or {@code promotion_code}. + */ + @SerializedName("type") + String type; + } + + /** When the apply action will take effect. If not specified, defaults to on_reserve. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class EffectiveAt extends StripeObject { + /** + * The timestamp at which the apply action will take effect. Only present if type is + * timestamp. Only allowed for discount actions. + */ + @SerializedName("timestamp") + Instant timestamp; + /** * When the apply action will take effect. * - *

One of {@code current_billing_period_end}, {@code next_billing_period_start}, or {@code - * on_reserve}. + *

One of {@code current_billing_period_end}, {@code current_billing_period_start}, {@code + * next_billing_period_start}, {@code on_reserve}, or {@code timestamp}. */ @SerializedName("type") String type; @@ -161,7 +199,7 @@ public static class PercentOff extends StripeObject { * $100 amount $50 instead. */ @SerializedName("percent_off") - String percentOff; + BigDecimal percentOff; /** The maximum number of times this discount can be applied for this Billing Cadence. */ @Getter @@ -224,7 +262,7 @@ public static class MaxBillingPeriodSpend extends StripeObject { @SerializedName("amount") Amount amount; - /** The configration for the overage rate for the custom pricing unit. */ + /** The configuration for the overage rate for the custom pricing unit. */ @SerializedName("custom_pricing_unit_overage_rate") CustomPricingUnitOverageRate customPricingUnitOverageRate; @@ -256,7 +294,7 @@ public static class CustomPricingUnit extends StripeObject { } } - /** The configration for the overage rate for the custom pricing unit. */ + /** The configuration for the overage rate for the custom pricing unit. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -396,7 +434,7 @@ public static class PartialPeriodBehavior extends StripeObject { /** * The type of behavior to override. * - *

Equal to {@code license_fee}. + *

One of {@code license_fee}, or {@code recurring_credit_grant}. */ @SerializedName("type") String type; @@ -554,7 +592,7 @@ public static class PartialPeriodBehavior extends StripeObject { /** * The type of behavior to override. * - *

Equal to {@code license_fee}. + *

One of {@code license_fee}, or {@code recurring_credit_grant}. */ @SerializedName("type") String type; @@ -597,7 +635,7 @@ public static class LicenseFee extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Remove extends StripeObject { - /** When the remove action will take effect. Defaults to on_reserve if not specified. */ + /** When the remove action will take effect. If not specified, defaults to on_reserve. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -617,7 +655,7 @@ public static class Remove extends StripeObject { @SerializedName("type") String type; - /** When the remove action will take effect. Defaults to on_reserve if not specified. */ + /** When the remove action will take effect. If not specified, defaults to on_reserve. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -778,7 +816,7 @@ public static class PartialPeriodBehavior extends StripeObject { /** * The type of behavior to override. * - *

Equal to {@code license_fee}. + *

One of {@code license_fee}, or {@code recurring_credit_grant}. */ @SerializedName("type") String type; @@ -847,7 +885,7 @@ public static class Item extends StripeObject { @SerializedName("price") String price; - /** Quantity for this item. If not provided, will default to 1. */ + /** Quantity for this item. If not provided, defaults to 1. */ @SerializedName("quantity") Long quantity; } diff --git a/src/main/java/com/stripe/model/v2/billing/LicenseFee.java b/src/main/java/com/stripe/model/v2/billing/LicenseFee.java index 41c8f5f1616..c05ddb74402 100644 --- a/src/main/java/com/stripe/model/v2/billing/LicenseFee.java +++ b/src/main/java/com/stripe/model/v2/billing/LicenseFee.java @@ -1,9 +1,12 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import java.util.Map; @@ -49,10 +52,6 @@ public class LicenseFee extends StripeObject implements HasId { @SerializedName("id") String id; - /** The ID of the license fee's most recently created version. */ - @SerializedName("latest_version") - String latestVersion; - /** * A Licensed Item represents a billable item whose pricing is based on license fees. You can use * license fees to specify the pricing and create subscriptions to these items. @@ -98,20 +97,9 @@ public class LicenseFee extends StripeObject implements HasId { @SerializedName("object") String object; - /** - * The interval for assessing service. - * - *

One of {@code day}, {@code month}, {@code week}, or {@code year}. - */ - @SerializedName("service_interval") - String serviceInterval; - - /** - * The length of the interval for assessing service. For example, set this to 3 and {@code - * service_interval} to {@code "month"} in order to specify quarterly service. - */ - @SerializedName("service_interval_count") - Long serviceIntervalCount; + /** The service cycle configuration for this License Fee. */ + @SerializedName("service_cycle") + ServiceCycle serviceCycle; /** * The Stripe Tax tax behavior - whether the license fee is inclusive or exclusive of tax. @@ -149,6 +137,27 @@ public class LicenseFee extends StripeObject implements HasId { @SerializedName("unit_amount") String unitAmount; + /** The service cycle configuration for this License Fee. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } + /** * For more details about Tier, please refer to the API * Reference. @@ -176,7 +185,7 @@ public static class Tier extends StripeObject { * up_to_decimal} and {@code up_to_inf} may be set. */ @SerializedName("up_to_decimal") - String upToDecimal; + BigDecimal upToDecimal; /** * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may be @@ -196,6 +205,7 @@ public static class Tier extends StripeObject { public static class TransformQuantity extends StripeObject { /** Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** diff --git a/src/main/java/com/stripe/model/v2/billing/LicenseFeeSubscription.java b/src/main/java/com/stripe/model/v2/billing/LicenseFeeSubscription.java deleted file mode 100644 index 944d094d9d6..00000000000 --- a/src/main/java/com/stripe/model/v2/billing/LicenseFeeSubscription.java +++ /dev/null @@ -1,74 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.model.v2.billing; - -import com.google.gson.annotations.SerializedName; -import com.stripe.model.HasId; -import com.stripe.model.StripeObject; -import java.time.Instant; -import java.util.Map; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.Setter; - -/** - * A License Fee Subscription represents a customer's subscription to a License Fee at a specified - * quantity. It tracks the number of units (such as seats or licenses) the customer has subscribed - * to and bills them according to the service interval defined in the License Fee and the Billing - * Cadence. - */ -@Getter -@Setter -@EqualsAndHashCode(callSuper = false) -public class LicenseFeeSubscription extends StripeObject implements HasId { - /** The ID of the Billing Cadence. */ - @SerializedName("billing_cadence") - String billingCadence; - - /** Timestamp of when the object was created. */ - @SerializedName("created") - Instant created; - - /** Unique identifier for the object. */ - @Getter(onMethod_ = {@Override}) - @SerializedName("id") - String id; - - /** The ID of the License Fee. */ - @SerializedName("license_fee") - String licenseFee; - - /** The ID of the License Fee Version. */ - @SerializedName("license_fee_version") - String licenseFeeVersion; - - /** - * 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; - - /** - * Set of key-value pairs that you can attach to an object. This can be useful for storing - * additional information about the object in a structured format. - */ - @SerializedName("metadata") - Map metadata; - - /** - * String representing the object's type. Objects of the same type share the same value of the - * object field. - * - *

Equal to {@code v2.billing.license_fee_subscription}. - */ - @SerializedName("object") - String object; - - /** Quantity of the License Fee subscribed to. */ - @SerializedName("quantity") - Long quantity; - - /** The ID of the Test Clock, if any. */ - @SerializedName("test_clock") - String testClock; -} diff --git a/src/main/java/com/stripe/model/v2/billing/LicenseFeeVersion.java b/src/main/java/com/stripe/model/v2/billing/LicenseFeeVersion.java index 57c5b10de47..0c47e70c65c 100644 --- a/src/main/java/com/stripe/model/v2/billing/LicenseFeeVersion.java +++ b/src/main/java/com/stripe/model/v2/billing/LicenseFeeVersion.java @@ -1,9 +1,12 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.EqualsAndHashCode; @@ -104,7 +107,7 @@ public static class Tier extends StripeObject { * up_to_decimal} and {@code up_to_inf} may be set. */ @SerializedName("up_to_decimal") - String upToDecimal; + BigDecimal upToDecimal; /** * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may be @@ -124,6 +127,7 @@ public static class Tier extends StripeObject { public static class TransformQuantity extends StripeObject { /** Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** diff --git a/src/main/java/com/stripe/model/v2/billing/LicensedItem.java b/src/main/java/com/stripe/model/v2/billing/LicensedItem.java index b5741caf7ba..684542de089 100644 --- a/src/main/java/com/stripe/model/v2/billing/LicensedItem.java +++ b/src/main/java/com/stripe/model/v2/billing/LicensedItem.java @@ -41,7 +41,7 @@ public class LicensedItem extends StripeObject implements HasId { Boolean livemode; /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular licensed item. Maximum length of 200 * characters. */ @SerializedName("lookup_key") diff --git a/src/main/java/com/stripe/model/v2/billing/MeteredItem.java b/src/main/java/com/stripe/model/v2/billing/MeteredItem.java index 404e2800147..1d2da0a74a0 100644 --- a/src/main/java/com/stripe/model/v2/billing/MeteredItem.java +++ b/src/main/java/com/stripe/model/v2/billing/MeteredItem.java @@ -46,7 +46,7 @@ public class MeteredItem extends StripeObject implements HasId { Boolean livemode; /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular metered item. Maximum length of 200 * characters. */ @SerializedName("lookup_key") diff --git a/src/main/java/com/stripe/model/v2/billing/PricingPlan.java b/src/main/java/com/stripe/model/v2/billing/PricingPlan.java index d69690be424..f19c3440dd1 100644 --- a/src/main/java/com/stripe/model/v2/billing/PricingPlan.java +++ b/src/main/java/com/stripe/model/v2/billing/PricingPlan.java @@ -46,10 +46,6 @@ public class PricingPlan extends StripeObject implements HasId { @SerializedName("id") String id; - /** The ID of the latest version of the PricingPlan. */ - @SerializedName("latest_version") - String latestVersion; - /** The ID of the live version of the PricingPlan. */ @SerializedName("live_version") String liveVersion; diff --git a/src/main/java/com/stripe/model/v2/billing/PricingPlanComponent.java b/src/main/java/com/stripe/model/v2/billing/PricingPlanComponent.java index 4afed58c854..7b7ac54db72 100644 --- a/src/main/java/com/stripe/model/v2/billing/PricingPlanComponent.java +++ b/src/main/java/com/stripe/model/v2/billing/PricingPlanComponent.java @@ -95,7 +95,7 @@ public static class LicenseFee extends StripeObject implements HasId { @SerializedName("id") String id; - /** The version of the LicenseFee. Defaults to 'latest', if not specified. */ + /** The ID of the License Fee Version. If not specified, defaults to 'latest'. */ @SerializedName("version") String version; } @@ -110,7 +110,7 @@ public static class RateCard extends StripeObject implements HasId { @SerializedName("id") String id; - /** The version of the RateCard. Defaults to 'latest', if not specified. */ + /** The ID of the Rate Card Version. If not specified, defaults to 'latest'. */ @SerializedName("version") String version; } diff --git a/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscription.java b/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscription.java index 29e8b32af34..a1b7f9faac7 100644 --- a/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscription.java +++ b/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscription.java @@ -1,10 +1,14 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -48,6 +52,10 @@ public class PricingPlanSubscription extends StripeObject implements HasId { @SerializedName("created") Instant created; + /** Details about Discounts applied to this subscription. */ + @SerializedName("discount_details") + List discountDetails; + /** Unique identifier for the object. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") @@ -81,6 +89,13 @@ public class PricingPlanSubscription extends StripeObject implements HasId { @SerializedName("pricing_plan") String pricingPlan; + /** + * Pricing plan component details for the subscription, populated when + * pricing_plan_component_details is included. + */ + @SerializedName("pricing_plan_component_details") + List pricingPlanComponentDetails; + /** The ID of the Pricing Plan Version for this subscription. */ @SerializedName("pricing_plan_version") String pricingPlanVersion; @@ -162,6 +177,570 @@ public static class CollectionStatusTransitions extends StripeObject { String unpaidAt; } + /** + * For more details about DiscountDetail, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DiscountDetail extends StripeObject { + /** The ID of the Discount. */ + @SerializedName("discount") + String discount; + + /** The time at which the Discount ends, if applicable. */ + @SerializedName("end") + Instant end; + + /** The ID of the PromotionCode, if applicable. */ + @SerializedName("promotion_code") + String promotionCode; + + /** The source of the Discount. */ + @SerializedName("source") + Source source; + + /** The time at which the Discount starts. */ + @SerializedName("start") + Instant start; + + /** The source of the Discount. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Source extends StripeObject { + /** The ID of the Coupon. */ + @SerializedName("coupon") + String coupon; + + /** + * Type of the Discount source. + * + *

Equal to {@code coupon}. + */ + @SerializedName("type") + String type; + } + } + + /** + * For more details about PricingPlanComponentDetail, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PricingPlanComponentDetail extends StripeObject { + /** License fee details, present when type is license_fee_details. */ + @SerializedName("license_fee_details") + LicenseFeeDetails licenseFeeDetails; + + /** The ID of the Pricing Plan Component. */ + @SerializedName("pricing_plan_component") + String pricingPlanComponent; + + /** Rate card details, present when type is rate_card_details. */ + @SerializedName("rate_card_details") + RateCardDetails rateCardDetails; + + /** Recurring credit grant details, present when type is recurring_credit_grant_details. */ + @SerializedName("recurring_credit_grant_details") + RecurringCreditGrantDetails recurringCreditGrantDetails; + + /** + * The type of component details included. + * + *

One of {@code license_fee_details}, {@code rate_card_details}, or {@code + * recurring_credit_grant_details}. + */ + @SerializedName("type") + String type; + + /** License fee details, present when type is license_fee_details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class LicenseFeeDetails extends StripeObject { + /** Three-letter ISO currency code, in lowercase. */ + @SerializedName("currency") + String currency; + + /** A customer-facing name for the license fee. */ + @SerializedName("display_name") + String displayName; + + /** The ID of the License Fee. */ + @SerializedName("license_fee") + String licenseFee; + + /** The ID of the License Fee Version. */ + @SerializedName("license_fee_version") + String licenseFeeVersion; + + /** Quantity of the license fee on the subscription. */ + @SerializedName("quantity") + Long quantity; + + /** The service cycle configuration. */ + @SerializedName("service_cycle") + ServiceCycle serviceCycle; + + /** + * Defines whether the tiering price should be graduated or volume-based. + * + *

One of {@code graduated}, or {@code volume}. + */ + @SerializedName("tiering_mode") + String tieringMode; + + /** Each element represents a pricing tier. */ + @SerializedName("tiers") + List tiers; + + /** + * Apply a transformation to the reported usage or set quantity before computing the amount + * billed. + */ + @SerializedName("transform_quantity") + TransformQuantity transformQuantity; + + /** + * The per-unit amount to be charged, represented as a decimal string in minor currency units + * with at most 12 decimal places. + */ + @SerializedName("unit_amount") + String unitAmount; + + /** + * The unit label from the licensed item, used for display purposes (e.g. "seat", + * "environment"). + */ + @SerializedName("unit_label") + String unitLabel; + + /** The service cycle configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } + + /** + * For more details about Tier, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tier extends StripeObject { + /** + * Price for the entire tier, represented as a decimal string in minor currency units with + * at most 12 decimal places. + */ + @SerializedName("flat_amount") + String flatAmount; + + /** + * Per-unit price for units included in this tier, represented as a decimal string in minor + * currency units with at most 12 decimal places. + */ + @SerializedName("unit_amount") + String unitAmount; + + /** + * Up to and including this quantity will be contained in the tier. Only one of {@code + * up_to_decimal} and {@code up_to_inf} may be set. + */ + @SerializedName("up_to_decimal") + BigDecimal upToDecimal; + + /** + * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may + * be set. + */ + @SerializedName("up_to_inf") + String upToInf; + } + + /** + * Apply a transformation to the reported usage or set quantity before computing the amount + * billed. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TransformQuantity extends StripeObject { + /** Divide usage by this number. */ + @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) + Long divideBy; + + /** + * After division, round the result up or down. + * + *

One of {@code down}, or {@code up}. + */ + @SerializedName("round") + String round; + } + } + + /** Rate card details, present when type is rate_card_details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RateCardDetails extends StripeObject { + /** Three-letter ISO currency code, in lowercase. */ + @SerializedName("currency") + String currency; + + /** A customer-facing name for the rate card. */ + @SerializedName("display_name") + String displayName; + + /** The ID of the Rate Card. */ + @SerializedName("rate_card") + String rateCard; + + /** The ID of the Rate Card Version. */ + @SerializedName("rate_card_version") + String rateCardVersion; + + /** The service cycle configuration. */ + @SerializedName("service_cycle") + ServiceCycle serviceCycle; + + /** + * Whether the rates are inclusive or exclusive of tax. + * + *

One of {@code exclusive}, or {@code inclusive}. + */ + @SerializedName("tax_behavior") + String taxBehavior; + + /** The service cycle configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } + } + + /** Recurring credit grant details, present when type is recurring_credit_grant_details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RecurringCreditGrantDetails extends StripeObject { + /** Credit grant details, present when type is CREDIT_GRANT. */ + @SerializedName("credit_grant_details") + CreditGrantDetails creditGrantDetails; + + /** Credit grant per tenant details, present when type is CREDIT_GRANT_PER_TENANT. */ + @SerializedName("credit_grant_per_tenant_details") + CreditGrantPerTenantDetails creditGrantPerTenantDetails; + + /** The ID of the Recurring Credit Grant. */ + @SerializedName("recurring_credit_grant") + String recurringCreditGrant; + + /** The service cycle configuration. */ + @SerializedName("service_cycle") + ServiceCycle serviceCycle; + + /** + * The type of the recurring credit grant. + * + *

One of {@code credit_grant}, or {@code credit_grant_per_tenant}. + */ + @SerializedName("type") + String type; + + /** Credit grant details, present when type is CREDIT_GRANT. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CreditGrantDetails extends StripeObject { + /** The amount of the credit grant. */ + @SerializedName("amount") + com.stripe.model.v2.billing.PricingPlanSubscription.PricingPlanComponentDetail + .RecurringCreditGrantDetails.CreditGrantDetails.Amount + amount; + + /** Defines the scope where the credit grant is applicable. */ + @SerializedName("applicability_config") + ApplicabilityConfig applicabilityConfig; + + /** The expiry configuration for the credit grant. */ + @SerializedName("expiry_config") + ExpiryConfig expiryConfig; + + /** The amount of the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Amount extends StripeObject { + /** + * The custom pricing unit amount of the credit grant. Required if {@code type} is {@code + * custom_pricing_unit}. + */ + @SerializedName("custom_pricing_unit") + com.stripe.model.v2.billing.PricingPlanSubscription.PricingPlanComponentDetail + .RecurringCreditGrantDetails.CreditGrantDetails.Amount.CustomPricingUnit + customPricingUnit; + + /** + * The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. + */ + @SerializedName("monetary") + com.stripe.v2.Amount monetary; + + /** + * The type of the credit grant amount. We currently support {@code monetary} and {@code + * custom_pricing_unit} billing credits. + * + *

One of {@code custom_pricing_unit}, or {@code monetary}. + */ + @SerializedName("type") + String type; + + /** + * The custom pricing unit amount of the credit grant. Required if {@code type} is {@code + * custom_pricing_unit}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomPricingUnit extends StripeObject implements HasId { + /** The Custom Pricing Unit object. */ + @SerializedName("custom_pricing_unit_details") + com.stripe.model.v2.billing.CustomPricingUnit customPricingUnitDetails; + + /** The id of the custom pricing unit. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** The value of the credit grant, decimal value represented as a string. */ + @SerializedName("value") + BigDecimal value; + } + } + + /** Defines the scope where the credit grant is applicable. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ApplicabilityConfig extends StripeObject { + /** The applicability scope of the credit grant. */ + @SerializedName("scope") + Scope scope; + + /** The applicability scope of the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Scope extends StripeObject { + /** The billable items to apply the credit grant to. */ + @SerializedName("billable_items") + List billableItems; + + /** + * The price type that credit grants can apply to. We currently only support the {@code + * metered} price type. This will apply to metered prices and rate cards. Cannot be used + * in combination with {@code billable_items}. + * + *

Equal to {@code metered}. + */ + @SerializedName("price_type") + String priceType; + } + } + + /** The expiry configuration for the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ExpiryConfig extends StripeObject { + /** + * The type of the expiry configuration. We currently support {@code + * end_of_service_period}. + * + *

Equal to {@code end_of_service_period}. + */ + @SerializedName("type") + String type; + } + } + + /** Credit grant per tenant details, present when type is CREDIT_GRANT_PER_TENANT. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CreditGrantPerTenantDetails extends StripeObject { + /** The amount of the credit grant. */ + @SerializedName("amount") + com.stripe.model.v2.billing.PricingPlanSubscription.PricingPlanComponentDetail + .RecurringCreditGrantDetails.CreditGrantPerTenantDetails.Amount + amount; + + /** Defines the scope where the credit grant is applicable. */ + @SerializedName("applicability_config") + ApplicabilityConfig applicabilityConfig; + + /** The expiry configuration for the credit grant. */ + @SerializedName("expiry_config") + ExpiryConfig expiryConfig; + + /** The amount of the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Amount extends StripeObject { + /** + * The custom pricing unit amount of the credit grant. Required if {@code type} is {@code + * custom_pricing_unit}. + */ + @SerializedName("custom_pricing_unit") + com.stripe.model.v2.billing.PricingPlanSubscription.PricingPlanComponentDetail + .RecurringCreditGrantDetails.CreditGrantPerTenantDetails.Amount.CustomPricingUnit + customPricingUnit; + + /** + * The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. + */ + @SerializedName("monetary") + com.stripe.v2.Amount monetary; + + /** + * The type of the credit grant amount. We currently support {@code monetary} and {@code + * custom_pricing_unit} billing credits. + * + *

One of {@code custom_pricing_unit}, or {@code monetary}. + */ + @SerializedName("type") + String type; + + /** + * The custom pricing unit amount of the credit grant. Required if {@code type} is {@code + * custom_pricing_unit}. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomPricingUnit extends StripeObject implements HasId { + /** The Custom Pricing Unit object. */ + @SerializedName("custom_pricing_unit_details") + com.stripe.model.v2.billing.CustomPricingUnit customPricingUnitDetails; + + /** The id of the custom pricing unit. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** The value of the credit grant, decimal value represented as a string. */ + @SerializedName("value") + BigDecimal value; + } + } + + /** Defines the scope where the credit grant is applicable. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ApplicabilityConfig extends StripeObject { + /** The applicability scope of the credit grant. */ + @SerializedName("scope") + Scope scope; + + /** The applicability scope of the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Scope extends StripeObject { + /** The billable items to apply the credit grant to. */ + @SerializedName("billable_items") + List billableItems; + + /** + * The price type that credit grants can apply to. We currently only support the {@code + * metered} price type. This will apply to metered prices and rate cards. Cannot be used + * in combination with {@code billable_items}. + * + *

Equal to {@code metered}. + */ + @SerializedName("price_type") + String priceType; + } + } + + /** The expiry configuration for the credit grant. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ExpiryConfig extends StripeObject { + /** + * The type of the expiry configuration. We currently support {@code + * end_of_service_period}. + * + *

Equal to {@code end_of_service_period}. + */ + @SerializedName("type") + String type; + } + } + + /** The service cycle configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } + } + } + /** Timestamps for servicing status transitions. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java b/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java deleted file mode 100644 index 6f0971cfed2..00000000000 --- a/src/main/java/com/stripe/model/v2/billing/PricingPlanSubscriptionComponents.java +++ /dev/null @@ -1,64 +0,0 @@ -// 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/billing/RateCard.java b/src/main/java/com/stripe/model/v2/billing/RateCard.java index 6ef77aedbaa..ff371550eea 100644 --- a/src/main/java/com/stripe/model/v2/billing/RateCard.java +++ b/src/main/java/com/stripe/model/v2/billing/RateCard.java @@ -47,10 +47,6 @@ public class RateCard extends StripeObject implements HasId { @SerializedName("id") String id; - /** The ID of this rate card's most recently created version. */ - @SerializedName("latest_version") - String latestVersion; - /** * The ID of the Rate Card Version that will be used by all subscriptions when no specific version * is specified. @@ -90,23 +86,14 @@ public class RateCard extends StripeObject implements HasId { String object; /** - * The interval for assessing service. For example, a monthly Rate Card with a rate of $1 for the - * first 10 "workloads" and $2 thereafter means "$1 per workload up to 10 workloads - * during a month of service." This is similar to but distinct from billing interval; the - * service interval deals with the rate at which the customer accumulates fees, while the billing - * interval in Cadence deals with the rate the customer is billed. - * - *

One of {@code day}, {@code month}, {@code week}, or {@code year}. - */ - @SerializedName("service_interval") - String serviceInterval; - - /** - * The length of the interval for assessing service. For example, set this to 3 and {@code - * service_interval} to {@code "month"} in order to specify quarterly service. + * The service cycle configuration for this Rate Card. For example, a monthly Rate Card with a + * rate of $1 for the first 10 "workloads" and $2 thereafter means "$1 per workload + * up to 10 workloads during a month of service." This is similar to but distinct from + * billing interval; the service interval deals with the rate at which the customer accumulates + * fees, while the billing interval in Cadence deals with the rate the customer is billed. */ - @SerializedName("service_interval_count") - Long serviceIntervalCount; + @SerializedName("service_cycle") + ServiceCycle serviceCycle; /** * The Stripe Tax tax behavior - whether the rates are inclusive or exclusive of tax. @@ -115,4 +102,31 @@ public class RateCard extends StripeObject implements HasId { */ @SerializedName("tax_behavior") String taxBehavior; + + /** + * The service cycle configuration for this Rate Card. For example, a monthly Rate Card with a + * rate of $1 for the first 10 "workloads" and $2 thereafter means "$1 per workload + * up to 10 workloads during a month of service." This is similar to but distinct from + * billing interval; the service interval deals with the rate at which the customer accumulates + * fees, while the billing interval in Cadence deals with the rate the customer is billed. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ServiceCycle extends StripeObject { + /** + * The interval for assessing service. + * + *

One of {@code day}, {@code month}, {@code week}, or {@code year}. + */ + @SerializedName("interval") + String interval; + + /** + * The length of the interval for assessing service. For example, set this to 3 and {@code + * interval} to {@code "month"} in order to specify quarterly service. + */ + @SerializedName("interval_count") + Long intervalCount; + } } diff --git a/src/main/java/com/stripe/model/v2/billing/RateCardRate.java b/src/main/java/com/stripe/model/v2/billing/RateCardRate.java index baa5841cdaa..66d8806c178 100644 --- a/src/main/java/com/stripe/model/v2/billing/RateCardRate.java +++ b/src/main/java/com/stripe/model/v2/billing/RateCardRate.java @@ -1,9 +1,12 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import java.util.Map; @@ -147,7 +150,7 @@ public static class Tier extends StripeObject { * up_to_decimal} and {@code up_to_inf} may be set. */ @SerializedName("up_to_decimal") - String upToDecimal; + BigDecimal upToDecimal; /** * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may be @@ -167,6 +170,7 @@ public static class Tier extends StripeObject { public static class TransformQuantity extends StripeObject { /** Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** diff --git a/src/main/java/com/stripe/model/v2/billing/ServiceAction.java b/src/main/java/com/stripe/model/v2/billing/ServiceAction.java index 5c1d212d7b8..88f424c715c 100644 --- a/src/main/java/com/stripe/model/v2/billing/ServiceAction.java +++ b/src/main/java/com/stripe/model/v2/billing/ServiceAction.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.EqualsAndHashCode; @@ -85,7 +86,7 @@ public class ServiceAction extends StripeObject implements HasId { public static class CreditGrant extends StripeObject { /** The amount of the credit grant. */ @SerializedName("amount") - Amount amount; + com.stripe.model.v2.billing.ServiceAction.CreditGrant.Amount amount; /** Defines the scope where the credit grant is applicable. */ @SerializedName("applicability_config") @@ -129,7 +130,7 @@ public static class Amount extends StripeObject { /** The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. */ @SerializedName("monetary") - Monetary monetary; + com.stripe.v2.Amount monetary; /** * The type of the credit grant amount. We currently support {@code monetary} and {@code @@ -159,28 +160,7 @@ public static class CustomPricingUnit extends StripeObject implements HasId { /** The value of the credit grant, decimal value represented as a string. */ @SerializedName("value") - String value; - } - - /** The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Monetary extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; + BigDecimal value; } } @@ -239,7 +219,7 @@ public static class ExpiryConfig extends StripeObject { public static class CreditGrantPerTenant extends StripeObject { /** The amount of the credit grant. */ @SerializedName("amount") - Amount amount; + com.stripe.model.v2.billing.ServiceAction.CreditGrantPerTenant.Amount amount; /** Defines the scope where the credit grant is applicable. */ @SerializedName("applicability_config") @@ -283,7 +263,7 @@ public static class Amount extends StripeObject { /** The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. */ @SerializedName("monetary") - Monetary monetary; + com.stripe.v2.Amount monetary; /** * The type of the credit grant amount. We currently support {@code monetary} and {@code @@ -313,28 +293,7 @@ public static class CustomPricingUnit extends StripeObject implements HasId { /** The value of the credit grant, decimal value represented as a string. */ @SerializedName("value") - String value; - } - - /** The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Monetary extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; + BigDecimal value; } } 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 150007c9f63..1d78c1a1aec 100644 --- a/src/main/java/com/stripe/model/v2/core/Account.java +++ b/src/main/java/com/stripe/model/v2/core/Account.java @@ -4,6 +4,8 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; @@ -4694,30 +4696,31 @@ public static class DefaultOutboundDestination extends StripeObject implements H * cr_bank_account}, {@code cy_bank_account}, {@code cz_bank_account}, {@code * de_bank_account}, {@code dk_bank_account}, {@code do_bank_account}, {@code * dz_bank_account}, {@code ec_bank_account}, {@code ee_bank_account}, {@code - * es_bank_account}, {@code et_bank_account}, {@code fi_bank_account}, {@code - * fr_bank_account}, {@code gb_bank_account}, {@code gm_bank_account}, {@code - * gr_bank_account}, {@code gt_bank_account}, {@code gy_bank_account}, {@code - * hk_bank_account}, {@code hr_bank_account}, {@code hu_bank_account}, {@code - * id_bank_account}, {@code ie_bank_account}, {@code il_bank_account}, {@code - * in_bank_account}, {@code is_bank_account}, {@code it_bank_account}, {@code - * jm_bank_account}, {@code jo_bank_account}, {@code ke_bank_account}, {@code - * kh_bank_account}, {@code kw_bank_account}, {@code lc_bank_account}, {@code - * li_bank_account}, {@code lk_bank_account}, {@code lt_bank_account}, {@code - * lu_bank_account}, {@code lv_bank_account}, {@code ma_bank_account}, {@code - * mc_bank_account}, {@code md_bank_account}, {@code mg_bank_account}, {@code - * mk_bank_account}, {@code mn_bank_account}, {@code mo_bank_account}, {@code - * mt_bank_account}, {@code mu_bank_account}, {@code mx_bank_account}, {@code - * my_bank_account}, {@code mz_bank_account}, {@code na_bank_account}, {@code - * nl_bank_account}, {@code no_bank_account}, {@code nz_bank_account}, {@code - * om_bank_account}, {@code pa_bank_account}, {@code pe_bank_account}, {@code - * ph_bank_account}, {@code pk_bank_account}, {@code pl_bank_account}, {@code - * pt_bank_account}, {@code qa_bank_account}, {@code ro_bank_account}, {@code - * rs_bank_account}, {@code rw_bank_account}, {@code se_bank_account}, {@code - * sg_bank_account}, {@code si_bank_account}, {@code sk_bank_account}, {@code - * sn_bank_account}, {@code sv_bank_account}, {@code th_bank_account}, {@code - * tn_bank_account}, {@code tr_bank_account}, {@code tt_bank_account}, {@code - * tw_bank_account}, {@code tz_bank_account}, {@code us_bank_account}, {@code - * uz_bank_account}, {@code vn_bank_account}, or {@code za_bank_account}. + * eg_bank_account}, {@code es_bank_account}, {@code et_bank_account}, {@code + * fi_bank_account}, {@code fr_bank_account}, {@code gb_bank_account}, {@code + * gm_bank_account}, {@code gr_bank_account}, {@code gt_bank_account}, {@code + * gy_bank_account}, {@code hk_bank_account}, {@code hr_bank_account}, {@code + * hu_bank_account}, {@code id_bank_account}, {@code ie_bank_account}, {@code + * il_bank_account}, {@code in_bank_account}, {@code is_bank_account}, {@code + * it_bank_account}, {@code jm_bank_account}, {@code jo_bank_account}, {@code + * ke_bank_account}, {@code kh_bank_account}, {@code kw_bank_account}, {@code + * lc_bank_account}, {@code li_bank_account}, {@code lk_bank_account}, {@code + * lt_bank_account}, {@code lu_bank_account}, {@code lv_bank_account}, {@code + * ma_bank_account}, {@code mc_bank_account}, {@code md_bank_account}, {@code + * mg_bank_account}, {@code mk_bank_account}, {@code mn_bank_account}, {@code + * mo_bank_account}, {@code mt_bank_account}, {@code mu_bank_account}, {@code + * mx_bank_account}, {@code my_bank_account}, {@code mz_bank_account}, {@code + * na_bank_account}, {@code nl_bank_account}, {@code no_bank_account}, {@code + * nz_bank_account}, {@code om_bank_account}, {@code pa_bank_account}, {@code + * pe_bank_account}, {@code ph_bank_account}, {@code pk_bank_account}, {@code + * pl_bank_account}, {@code pt_bank_account}, {@code qa_bank_account}, {@code + * ro_bank_account}, {@code rs_bank_account}, {@code rw_bank_account}, {@code + * se_bank_account}, {@code sg_bank_account}, {@code si_bank_account}, {@code + * sk_bank_account}, {@code sn_bank_account}, {@code sv_bank_account}, {@code + * th_bank_account}, {@code tn_bank_account}, {@code tr_bank_account}, {@code + * tt_bank_account}, {@code tw_bank_account}, {@code tz_bank_account}, {@code + * us_bank_account}, {@code uz_bank_account}, {@code vn_bank_account}, or {@code + * za_bank_account}. */ @SerializedName("type") String type; @@ -5843,6 +5846,13 @@ public static class Defaults extends StripeObject { @SerializedName("responsibilities") Responsibilities responsibilities; + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + @SerializedName("timezone") + String timezone; + /** Account profile information. */ @Getter @Setter @@ -6083,7 +6093,7 @@ public static class RestrictsCapability extends StripeObject { * {@code commercial.lead.prepaid_card}, {@code commercial.stripe.charge_card}, {@code * commercial.stripe.prepaid_card}, {@code consumer.celtic.revolving_credit_card}, {@code * consumer.cross_river_bank.prepaid_card}, {@code consumer.holds_currencies.usd}, {@code - * consumer.lead.prepaid_card}, {@code crypto}, {@code eps_payments}, {@code + * consumer.lead.prepaid_card}, {@code crypto_wallets}, {@code eps_payments}, {@code * financial_addresses.bank_accounts}, {@code fpx_payments}, {@code * gb_bank_transfer_payments}, {@code grabpay_payments}, {@code holds_currencies.eur}, * {@code holds_currencies.gbp}, {@code holds_currencies.usd}, {@code ideal_payments}, @@ -8344,27 +8354,6 @@ public static class AnnualRevenue extends StripeObject { */ @SerializedName("fiscal_year_end") String fiscalYearEnd; - - /** Annual revenue amount in minor currency units (for example, '123' for 1.23 USD). */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** Documents that may be submitted to satisfy various informational requests. */ @@ -8743,30 +8732,6 @@ public static class MonthlyEstimatedRevenue extends StripeObject { */ @SerializedName("amount") Amount amount; - - /** - * Estimated monthly revenue amount in minor currency units (for example, '123' for 1.23 - * USD). - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** When the business was incorporated or registered. */ @@ -9483,7 +9448,7 @@ public static class Relationship extends StripeObject { /** The percentage of the Account's identity that the individual owns. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** * Whether the individual is authorized as the primary representative of the Account. This @@ -9814,7 +9779,7 @@ public static class RestrictsCapability extends StripeObject { * {@code commercial.lead.prepaid_card}, {@code commercial.stripe.charge_card}, {@code * commercial.stripe.prepaid_card}, {@code consumer.celtic.revolving_credit_card}, {@code * consumer.cross_river_bank.prepaid_card}, {@code consumer.holds_currencies.usd}, {@code - * consumer.lead.prepaid_card}, {@code crypto}, {@code eps_payments}, {@code + * consumer.lead.prepaid_card}, {@code crypto_wallets}, {@code eps_payments}, {@code * financial_addresses.bank_accounts}, {@code fpx_payments}, {@code * gb_bank_transfer_payments}, {@code grabpay_payments}, {@code holds_currencies.eur}, * {@code holds_currencies.gbp}, {@code holds_currencies.usd}, {@code ideal_payments}, diff --git a/src/main/java/com/stripe/model/v2/core/AccountEvaluation.java b/src/main/java/com/stripe/model/v2/core/AccountEvaluation.java new file mode 100644 index 00000000000..820c5162674 --- /dev/null +++ b/src/main/java/com/stripe/model/v2/core/AccountEvaluation.java @@ -0,0 +1,116 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.core; + +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StripeObject; +import java.time.Instant; +import java.util.List; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** Account Evaluation resource. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class AccountEvaluation extends StripeObject implements HasId { + /** The account ID if this evaluation is for an existing account. */ + @SerializedName("account") + String account; + + /** Account data if this evaluation is for an account without an existing Stripe entity. */ + @SerializedName("account_data") + AccountData accountData; + + /** Timestamp at which the evaluation was created. */ + @SerializedName("created") + Instant created; + + /** List of signals that were triggered for evaluation. */ + @SerializedName("evaluations_triggered") + List evaluationsTriggered; + + /** Unique identifier for the account evaluation. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.core.account_evaluation}. + */ + @SerializedName("object") + String object; + + /** Account data if this evaluation is for an account without an existing Stripe entity. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AccountData extends StripeObject { + /** Default account settings. */ + @SerializedName("defaults") + Defaults defaults; + + /** Identity data. */ + @SerializedName("identity") + Identity identity; + + /** Default account settings. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Defaults extends StripeObject { + /** Account profile data. */ + @SerializedName("profile") + Profile profile; + + /** Account profile data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Profile extends StripeObject { + /** The business URL. */ + @SerializedName("business_url") + String businessUrl; + + /** Doing business as (DBA) name. */ + @SerializedName("doing_business_as") + String doingBusinessAs; + + /** Description of the account's product or service. */ + @SerializedName("product_description") + String productDescription; + } + } + + /** Identity data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Identity extends StripeObject { + /** Business details for identity data. */ + @SerializedName("business_details") + BusinessDetails businessDetails; + + /** Business details for identity data. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BusinessDetails extends StripeObject { + /** Registered business name. */ + @SerializedName("registered_name") + String registeredName; + } + } + } +} diff --git a/src/main/java/com/stripe/model/v2/core/AccountPerson.java b/src/main/java/com/stripe/model/v2/core/AccountPerson.java index f3ce221205d..25eed6ceaab 100644 --- a/src/main/java/com/stripe/model/v2/core/AccountPerson.java +++ b/src/main/java/com/stripe/model/v2/core/AccountPerson.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import java.util.Map; @@ -584,7 +585,7 @@ public static class Relationship extends StripeObject { /** The percentage of the Account's identity that the individual owns. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** * Whether the individual is authorized as the primary representative of the Account. This is diff --git a/src/main/java/com/stripe/model/v2/core/BatchJob.java b/src/main/java/com/stripe/model/v2/core/BatchJob.java new file mode 100644 index 00000000000..9bc1c8bf3e6 --- /dev/null +++ b/src/main/java/com/stripe/model/v2/core/BatchJob.java @@ -0,0 +1,408 @@ +// File generated from our OpenAPI spec +package com.stripe.model.v2.core; + +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; +import com.stripe.model.StripeObject; +import java.time.Instant; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** BatchJob resource. */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class BatchJob extends StripeObject implements HasId { + /** Timestamp at which BatchJob was created. */ + @SerializedName("created") + Instant created; + + /** Unique identifier for the BatchJob. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @SerializedName("livemode") + Boolean livemode; + + /** The maximum rps defined for the {@code BatchJob}. */ + @SerializedName("maximum_rps") + Long maximumRps; + + /** The metadata of the {@code BatchJob} object. */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value of the + * object field. + * + *

Equal to {@code v2.core.batch_job}. + */ + @SerializedName("object") + String object; + + /** If the validation will be run previous to the execution of the {@code BatchJob}. */ + @SerializedName("skip_validation") + Boolean skipValidation; + + /** + * The current status of the {@code BatchJob}. + * + *

One of {@code batch_failed}, {@code canceled}, {@code cancelling}, {@code complete}, {@code + * in_progress}, {@code ready_for_upload}, {@code timeout}, {@code upload_timeout}, {@code + * validating}, or {@code validation_failed}. + */ + @SerializedName("status") + String status; + + /** Additional details about the current state of the {@code BatchJob}. */ + @SerializedName("status_details") + StatusDetails statusDetails; + + /** Additional details about the current state of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StatusDetails extends StripeObject { + /** Additional details for the {@code BATCH_FAILED} status of the {@code BatchJob}. */ + @SerializedName("batch_failed") + BatchFailed batchFailed; + + /** Additional details for the {@code CANCELED} status of the {@code BatchJob}. */ + @SerializedName("canceled") + Canceled canceled; + + /** Additional details for the {@code COMPLETE} status of the {@code BatchJob}. */ + @SerializedName("complete") + Complete complete; + + /** Additional details for the {@code IN_PROGRESS} status of the {@code BatchJob}. */ + @SerializedName("in_progress") + InProgress inProgress; + + /** Additional details for the {@code READY_FOR_UPLOAD} status of the {@code BatchJob}. */ + @SerializedName("ready_for_upload") + ReadyForUpload readyForUpload; + + /** Additional details for the {@code TIMEOUT} status of the {@code BatchJob}. */ + @SerializedName("timeout") + Timeout timeout; + + /** Additional details for the {@code VALIDATING} status of the {@code BatchJob}. */ + @SerializedName("validating") + Validating validating; + + /** Additional details for the {@code VALIDATION_FAILED} status of the {@code BatchJob}. */ + @SerializedName("validation_failed") + ValidationFailed validationFailed; + + /** Additional details for the {@code BATCH_FAILED} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BatchFailed extends StripeObject { + /** Details about the {@code BatchJob} failure. */ + @SerializedName("error") + String error; + } + + /** Additional details for the {@code CANCELED} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Canceled extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + + /** Additional details for the {@code COMPLETE} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Complete extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + + /** Additional details for the {@code IN_PROGRESS} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InProgress extends StripeObject { + /** The number of records that failed processing so far. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** The number of records that were successfully processed so far. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + } + + /** Additional details for the {@code READY_FOR_UPLOAD} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ReadyForUpload extends StripeObject { + /** The upload file details. */ + @SerializedName("upload_url") + UploadUrl uploadUrl; + + /** The upload file details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UploadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + + /** Additional details for the {@code TIMEOUT} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Timeout extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + + /** Additional details for the {@code VALIDATING} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Validating extends StripeObject { + /** + * The number of records that were validated. Note that there is no failure counter here; once + * we have any validation failures we give up. + */ + @SerializedName("validated_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long validatedCount; + } + + /** Additional details for the {@code VALIDATION_FAILED} status of the {@code BatchJob}. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ValidationFailed extends StripeObject { + /** The total number of records that failed processing. */ + @SerializedName("failure_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long failureCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @SerializedName("output_file") + OutputFile outputFile; + + /** The total number of records that were successfully processed. */ + @SerializedName("success_count") + @JsonAdapter(StringInt64TypeAdapter.class) + Long successCount; + + /** + * The output file details. If BatchJob is cancelled it's provided only if there is already + * output at this point. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class OutputFile extends StripeObject { + /** The content type of the file. */ + @SerializedName("content_type") + String contentType; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @SerializedName("download_url") + DownloadUrl downloadUrl; + + /** The total size of the file in bytes. */ + @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) + Long size; + + /** A pre-signed URL that allows secure, time-limited access to download the file. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DownloadUrl extends StripeObject { + /** The time that the URL expires. */ + @SerializedName("expires_at") + Instant expiresAt; + + /** The URL that can be used for accessing the file. */ + @SerializedName("url") + String url; + } + } + } + } +} diff --git a/src/main/java/com/stripe/model/v2/core/EventDestination.java b/src/main/java/com/stripe/model/v2/core/EventDestination.java index 0aee20d9e9b..cc45e0ae021 100644 --- a/src/main/java/com/stripe/model/v2/core/EventDestination.java +++ b/src/main/java/com/stripe/model/v2/core/EventDestination.java @@ -26,6 +26,10 @@ public class EventDestination extends StripeObject implements HasId { @SerializedName("amazon_eventbridge") AmazonEventbridge amazonEventbridge; + /** Azure Event Grid configuration. */ + @SerializedName("azure_event_grid") + AzureEventGrid azureEventGrid; + /** Time at which the object was created. */ @SerializedName("created") Instant created; @@ -46,7 +50,14 @@ public class EventDestination extends StripeObject implements HasId { @SerializedName("event_payload") String eventPayload; - /** Where events should be routed from. */ + /** + * Specifies which accounts' events route to this destination. {@code @self}: Receive events from + * the account that owns the event destination. {@code @accounts}: Receive events emitted from + * other accounts you manage which includes your v1 and v2 accounts. + * {@code @organization_members}: Receive events from accounts directly linked to the + * organization. {@code @organization_members/@accounts}: Receive events from all accounts + * connected to any platform accounts in the organization. + */ @SerializedName("events_from") List eventsFrom; @@ -98,7 +109,7 @@ public class EventDestination extends StripeObject implements HasId { /** * Event destination type. * - *

One of {@code amazon_eventbridge}, or {@code webhook_endpoint}. + *

One of {@code amazon_eventbridge}, {@code azure_event_grid}, or {@code webhook_endpoint}. */ @SerializedName("type") String type; @@ -133,6 +144,36 @@ public static class AmazonEventbridge extends StripeObject { String awsEventSourceStatus; } + /** Azure Event Grid configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AzureEventGrid extends StripeObject { + /** The name of the Azure partner topic. */ + @SerializedName("azure_partner_topic_name") + String azurePartnerTopicName; + + /** + * The status of the Azure partner topic. + * + *

One of {@code activated}, {@code deleted}, {@code never_activated}, or {@code unknown}. + */ + @SerializedName("azure_partner_topic_status") + String azurePartnerTopicStatus; + + /** The Azure region. */ + @SerializedName("azure_region") + String azureRegion; + + /** The name of the Azure resource group. */ + @SerializedName("azure_resource_group_name") + String azureResourceGroupName; + + /** The Azure subscription ID. */ + @SerializedName("azure_subscription_id") + String azureSubscriptionId; + } + /** Additional information about event destination status. */ @Getter @Setter @@ -150,7 +191,8 @@ public static class Disabled extends StripeObject { /** * Reason event destination has been disabled. * - *

One of {@code no_aws_event_source_exists}, or {@code user}. + *

One of {@code no_aws_event_source_exists}, {@code no_azure_partner_topic_exists}, or + * {@code user}. */ @SerializedName("reason") String reason; diff --git a/src/main/java/com/stripe/model/v2/core/EventNotification.java b/src/main/java/com/stripe/model/v2/core/EventNotification.java index 2246cabcaa7..374abbb60f8 100644 --- a/src/main/java/com/stripe/model/v2/core/EventNotification.java +++ b/src/main/java/com/stripe/model/v2/core/EventNotification.java @@ -93,6 +93,12 @@ public static EventNotification fromJson(String payload, StripeClient client) { // don't love the double json parse here, but I don't think we can avoid it? JsonObject jsonObject = ApiResource.GSON.fromJson(payload, JsonObject.class).getAsJsonObject(); + if (jsonObject.has("object") && "event".equals(jsonObject.get("object").getAsString())) { + throw new IllegalArgumentException( + "You passed a webhook payload to StripeClient.parseEventNotification, which expects an event notification." + + " Use StripeClient.constructEvent instead."); + } + Class cls = EventNotificationClassLookup.eventClassLookup.get(jsonObject.get("type").getAsString()); if (cls == null) { diff --git a/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java b/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java index d1ea223c682..f43af389910 100644 --- a/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java +++ b/src/main/java/com/stripe/model/v2/core/vault/GbBankAccount.java @@ -5,6 +5,7 @@ import com.stripe.model.HasId; import com.stripe.model.StripeObject; import java.time.Instant; +import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -80,6 +81,10 @@ public class GbBankAccount extends StripeObject implements HasId { @SerializedName("sort_code") String sortCode; + /** The list of currencies supported by this bank account. */ + @SerializedName("supported_currencies") + List supportedCurrencies; + /** The alternative reference for this payout method, if it's a projected payout method. */ @Getter @Setter 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 a4b359adc37..37a3ed55f33 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 @@ -5,6 +5,7 @@ import com.stripe.model.HasId; import com.stripe.model.StripeObject; import java.time.Instant; +import java.util.List; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -81,6 +82,10 @@ public class UsBankAccount extends StripeObject implements HasId { @SerializedName("routing_number") String routingNumber; + /** The list of currencies supported by this bank account. */ + @SerializedName("supported_currencies") + List supportedCurrencies; + /** The bank account verification details. */ @SerializedName("verification") Verification verification; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/Adjustment.java b/src/main/java/com/stripe/model/v2/moneymanagement/Adjustment.java index 9c271edb4bd..f66d9526216 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/Adjustment.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/Adjustment.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -114,25 +115,4 @@ public static class AdjustedFlow extends StripeObject { @SerializedName("type") String type; } - - /** The amount of the Adjustment. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/CurrencyConversion.java b/src/main/java/com/stripe/model/v2/moneymanagement/CurrencyConversion.java index 1e97ae3b232..4fe82ec58ed 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/CurrencyConversion.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/CurrencyConversion.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -63,27 +64,6 @@ public static class From extends StripeObject { /** Amount object. */ @SerializedName("amount") Amount amount; - - /** Amount object. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** The to block containing what was credited. */ @@ -94,26 +74,5 @@ public static class To extends StripeObject { /** Amount object. */ @SerializedName("amount") Amount amount; - - /** Amount object. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } } diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java b/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java index 54fe5b06a1f..aac74ce830f 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/FinancialAccount.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.List; import java.util.Map; @@ -108,6 +109,7 @@ public class FinancialAccount extends StripeObject implements HasId { @SerializedName("status") String status; + /** Additional details related to the status of the FinancialAccount. */ @SerializedName("status_details") StatusDetails statusDetails; @@ -160,87 +162,15 @@ public static class AccruedFees extends StripeObject { public static class Balance extends StripeObject { /** Balance that can be used for money movement. */ @SerializedName("available") - Map available; + Map available; /** Balance of inbound funds that will later transition to the {@code available} balance. */ @SerializedName("inbound_pending") - Map inboundPending; + Map inboundPending; /** Balance of funds that are being used for a pending outbound money movement. */ @SerializedName("outbound_pending") - Map outboundPending; - - /** - * For more details about Available, please refer to the API Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Available extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** - * For more details about InboundPending, please refer to the API Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class InboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** - * For more details about OutboundPending, please refer to the API Reference. - */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class OutboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } + Map outboundPending; } /** @@ -285,6 +215,14 @@ public static class Other extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Payments extends StripeObject { + /** + * The balance of the {@code payments} FinancialAccount is a mix of payment processing and + * stored value funds, and this field describes the breakdown between the two. The sum will + * match the balance of the FinancialAccount. + */ + @SerializedName("balance_by_funds_type") + BalanceByFundsType balanceByFundsType; + /** The currency that non-settlement currency payments will be converted to. */ @SerializedName("default_currency") String defaultCurrency; @@ -300,74 +238,108 @@ public static class Payments extends StripeObject { @SerializedName("starting_balance") StartingBalance startingBalance; - /** Describes the available balance when it was projected. */ + /** + * The balance of the {@code payments} FinancialAccount is a mix of payment processing and + * stored value funds, and this field describes the breakdown between the two. The sum will + * match the balance of the FinancialAccount. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class StartingBalance extends StripeObject { - /** When the balance was projected. */ - @SerializedName("at") - Instant at; + public static class BalanceByFundsType extends StripeObject { + /** + * Payment processing funds are those that are received for goods or services and may only be + * used for payouts to self. These funds may be converted to stored value funds. + */ + @SerializedName("payment_processing") + PaymentProcessing paymentProcessing; - /** The available balance at the time when the balance was projected. */ - @SerializedName("available") - Map available; + /** Stored value funds may be used for either payouts to self or payments to others. */ + @SerializedName("stored_value") + StoredValue storedValue; /** - * For more details about Available, please refer to the API Reference. + * Payment processing funds are those that are received for goods or services and may only be + * used for payouts to self. These funds may be converted to stored value funds. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class Available extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; + public static class PaymentProcessing extends StripeObject { + /** Balance that can be used for money movement. */ + @SerializedName("available") + Map available; + + /** Balance of inbound funds that will later transition to the {@code available} balance. */ + @SerializedName("inbound_pending") + Map inboundPending; + + /** Balance of funds that are being used for a pending outbound money movement. */ + @SerializedName("outbound_pending") + Map outboundPending; } + + /** Stored value funds may be used for either payouts to self or payments to others. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StoredValue extends StripeObject { + /** Balance that can be used for money movement. */ + @SerializedName("available") + Map available; + + /** Balance of inbound funds that will later transition to the {@code available} balance. */ + @SerializedName("inbound_pending") + Map inboundPending; + + /** Balance of funds that are being used for a pending outbound money movement. */ + @SerializedName("outbound_pending") + Map outboundPending; + } + } + + /** Describes the available balance when it was projected. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StartingBalance extends StripeObject { + /** When the balance was projected. */ + @SerializedName("at") + Instant at; + + /** The available balance at the time when the balance was projected. */ + @SerializedName("available") + Map available; } } - /** - * For more details about StatusDetails, please refer to the API Reference. - */ + /** Additional details related to the status of the FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class StatusDetails extends StripeObject { + /** Details related to the closed state of the FinancialAccount. */ @SerializedName("closed") Closed closed; - /** - * For more details about Closed, please refer to the API - * Reference. - */ + /** Details related to the closed state of the FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class Closed extends StripeObject { + /** The forwarding settings for the closed FinancialAccount. */ @SerializedName("forwarding_settings") ForwardingSettings forwardingSettings; + /** + * The reason the FinancialAccount was closed. + * + *

One of {@code account_closed}, {@code closed_by_platform}, or {@code other}. + */ @SerializedName("reason") String reason; - /** - * For more details about ForwardingSettings, please refer to the API Reference. - */ + /** The forwarding settings for the closed FinancialAccount. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/InboundTransfer.java b/src/main/java/com/stripe/model/v2/moneymanagement/InboundTransfer.java index 56e054e8aa0..4816f0ba479 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/InboundTransfer.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/InboundTransfer.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.List; import java.util.Map; @@ -74,27 +75,6 @@ public class InboundTransfer extends StripeObject implements HasId { @SerializedName("transfer_history") List transferHistory; - /** The amount in specified currency that will land in the FinancialAccount balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** A nested object containing information about the origin of the InboundTransfer. */ @Getter @Setter @@ -102,33 +82,12 @@ public static class Amount extends StripeObject { public static class From extends StripeObject { /** The amount in specified currency that was debited from the Payment Method. */ @SerializedName("debited") - Debited debited; + Amount debited; /** The Payment Method object used to create the InboundTransfer. */ @SerializedName("payment_method") PaymentMethod paymentMethod; - /** The amount in specified currency that was debited from the Payment Method. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Debited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** The Payment Method object used to create the InboundTransfer. */ @Getter @Setter @@ -154,32 +113,11 @@ public static class PaymentMethod extends StripeObject { public static class To extends StripeObject { /** The amount by which the FinancialAccount balance is credited. */ @SerializedName("credited") - Credited credited; + Amount credited; /** The FinancialAccount that funds will land in. */ @SerializedName("financial_account") String financialAccount; - - /** The amount by which the FinancialAccount balance is credited. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Credited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPayment.java b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPayment.java index a5375d64a02..f028a1da013 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPayment.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPayment.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.Map; import lombok.EqualsAndHashCode; @@ -161,27 +162,6 @@ public class OutboundPayment extends StripeObject implements HasId { @SerializedName("tracking_details") TrackingDetails trackingDetails; - /** The "presentment amount" for the OutboundPayment. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Delivery options to be used to send the OutboundPayment. */ @Getter @Setter @@ -237,32 +217,11 @@ public static class PaperCheck extends StripeObject { public static class From extends StripeObject { /** The monetary amount debited from the sender, only set on responses. */ @SerializedName("debited") - Debited debited; + Amount debited; /** The FinancialAccount that funds were pulled from. */ @SerializedName("financial_account") String financialAccount; - - /** The monetary amount debited from the sender, only set on responses. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Debited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** Details about the OutboundPayment notification settings for recipient. */ @@ -374,7 +333,7 @@ public static class StatusTransitions extends StripeObject { public static class To extends StripeObject { /** The monetary amount being credited to the destination. */ @SerializedName("credited") - Credited credited; + Amount credited; /** The payout method which the OutboundPayment uses to send payout. */ @SerializedName("payout_method") @@ -383,27 +342,6 @@ public static class To extends StripeObject { /** To which account the OutboundPayment is sent. */ @SerializedName("recipient") String recipient; - - /** The monetary amount being credited to the destination. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Credited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java index a9602b89124..6b1696d10d9 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundPaymentQuote.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.List; import java.util.Map; @@ -71,27 +72,6 @@ public class OutboundPaymentQuote extends StripeObject implements HasId { @SerializedName("to") To to; - /** The "presentment amount" for the OutboundPaymentQuote. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Delivery options to be used to send the OutboundPayment. */ @Getter @Setter @@ -130,32 +110,11 @@ public static class EstimatedFee extends StripeObject { * The fee type. * *

One of {@code cross_border_payout_fee}, {@code foreign_exchange_fee}, {@code - * instant_payout_fee}, {@code real_time_payout_fee}, {@code standard_payout_fee}, or {@code - * wire_payout_fee}. + * instant_payout_fee}, {@code next_day_payout_fee}, {@code real_time_payout_fee}, {@code + * standard_payout_fee}, or {@code wire_payout_fee}. */ @SerializedName("type") String type; - - /** The fee amount for corresponding fee type. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** Details about the sender of an OutboundPaymentQuote. */ @@ -165,32 +124,11 @@ public static class Amount extends StripeObject { public static class From extends StripeObject { /** The monetary amount debited from the sender, only set on responses. */ @SerializedName("debited") - Debited debited; + Amount debited; /** The FinancialAccount that funds were pulled from. */ @SerializedName("financial_account") String financialAccount; - - /** The monetary amount debited from the sender, only set on responses. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Debited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** The underlying FXQuote details for the OutboundPaymentQuote. */ @@ -252,7 +190,7 @@ public static class Rate extends StripeObject { public static class To extends StripeObject { /** The monetary amount being credited to the destination. */ @SerializedName("credited") - Credited credited; + Amount credited; /** The payout method which the OutboundPayment uses to send payout. */ @SerializedName("payout_method") @@ -261,26 +199,5 @@ public static class To extends StripeObject { /** To which account the OutboundPayment is sent. */ @SerializedName("recipient") String recipient; - - /** The monetary amount being credited to the destination. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Credited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } } diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundTransfer.java b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundTransfer.java index a93728b73f5..8f9db4c7129 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/OutboundTransfer.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/OutboundTransfer.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.Map; import lombok.EqualsAndHashCode; @@ -138,27 +139,6 @@ public class OutboundTransfer extends StripeObject implements HasId { @SerializedName("trace_id") TraceId traceId; - /** The "presentment amount" for the OutboundTransfer. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Delivery options to be used to send the OutboundTransfer. */ @Getter @Setter @@ -180,32 +160,11 @@ public static class DeliveryOptions extends StripeObject { public static class From extends StripeObject { /** The monetary amount debited from the sender, only set on responses. */ @SerializedName("debited") - Debited debited; + Amount debited; /** The FinancialAccount that funds were pulled from. */ @SerializedName("financial_account") String financialAccount; - - /** The monetary amount debited from the sender, only set on responses. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Debited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** Status details for an OutboundTransfer in a {@code failed} or {@code returned} state. */ @@ -301,32 +260,11 @@ public static class StatusTransitions extends StripeObject { public static class To extends StripeObject { /** The monetary amount being credited to the destination. */ @SerializedName("credited") - Credited credited; + Amount credited; /** The payout method which the OutboundTransfer uses to send payout. */ @SerializedName("payout_method") String payoutMethod; - - /** The monetary amount being credited to the destination. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Credited extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java index 9bbff7ab62e..2187df5a752 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethod.java @@ -64,6 +64,13 @@ public class PayoutMethod extends StripeObject implements HasId { @SerializedName("object") String object; + /** + * Whether the Payout Method is currently unusable for money movement, despite potentially being + * correctly set up. Please reach out to Stripe Support for more information. + */ + @SerializedName("restricted") + Boolean restricted; + /** * Closed Enum. The type of payout method. * @@ -192,6 +199,10 @@ public static class Card extends StripeObject { /** The last 4 digits of the card number. */ @SerializedName("last4") String last4; + + /** The list of currencies supported by this bank account. */ + @SerializedName("supported_currencies") + List supportedCurrencies; } /** The PayoutMethodCryptoWallet object details. */ diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java index 23b774f7353..70c296bc556 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/PayoutMethodsBankAccountSpec.java @@ -54,6 +54,13 @@ public static class Country extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Field extends StripeObject { + /** + * The currencies supported by the corresponding credentials for bank accounts in the + * specified country. + */ + @SerializedName("currencies") + List currencies; + /** The local name of the field. */ @SerializedName("local_name") String localName; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java index f98a4962840..3c541808fbe 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedCredit.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -55,7 +56,7 @@ public class ReceivedCredit extends StripeObject implements HasId { /** The amount and currency of the original/external credit request. */ @SerializedName("external_amount") - ExternalAmount externalAmount; + Amount externalAmount; /** Financial Account ID on which funds for ReceivedCredit were received. */ @SerializedName("financial_account") @@ -124,27 +125,6 @@ public class ReceivedCredit extends StripeObject implements HasId { @SerializedName("type") String type; - /** The amount and currency of the ReceivedCredit. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** * This object stores details about the originating Stripe transaction that resulted in the * ReceivedCredit. Present if {@code type} field value is {@code balance_transfer}. @@ -369,27 +349,6 @@ public static class Refund extends StripeObject { } } - /** The amount and currency of the original/external credit request. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class ExternalAmount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** * This hash contains detailed information that elaborates on the specific status of the * ReceivedCredit. e.g the reason behind a failure if the status is marked as {@code failed}. diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java index 0024fda7cac..a0596113084 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/ReceivedDebit.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.List; import lombok.EqualsAndHashCode; @@ -53,7 +54,7 @@ public class ReceivedDebit extends StripeObject implements HasId { /** The amount and currency of the original/external debit request. */ @SerializedName("external_amount") - ExternalAmount externalAmount; + Amount externalAmount; /** Financial Account on which funds for ReceivedDebit were debited. */ @SerializedName("financial_account") @@ -116,27 +117,6 @@ public class ReceivedDebit extends StripeObject implements HasId { @SerializedName("type") String type; - /** Amount and currency of the ReceivedDebit. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** * This object stores details about the balance transfer object that resulted in the * ReceivedDebit. @@ -252,27 +232,6 @@ public static class Authorization extends StripeObject { /** The reference to the v1 issuing authorization ID. */ @SerializedName("issuing_authorization_v1") String issuingAuthorizationV1; - - /** Amount associated with this issuing authorization. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } /** @@ -290,51 +249,9 @@ public static class CardTransaction extends StripeObject { /** The reference to the v1 issuing transaction ID. */ @SerializedName("issuing_transaction_v1") String issuingTransactionV1; - - /** Amount associated with this issuing transaction. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } } } - /** The amount and currency of the original/external debit request. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class ExternalAmount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Detailed information about the status of the ReceivedDebit. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java b/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java index 4a42d26653e..5521bfcbbe2 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/Transaction.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -56,6 +57,10 @@ public class Transaction extends StripeObject implements HasId { @SerializedName("category") String category; + /** Counterparty to this Transaction. */ + @SerializedName("counterparty") + Counterparty counterparty; + /** * Time at which the object was created. Represented as a RFC 3339 date & time UTC value in * millisecond precision, for example: 2022-09-18T13:22:18.123Z. @@ -63,6 +68,13 @@ public class Transaction extends StripeObject implements HasId { @SerializedName("created") Instant created; + /** + * Description of this Transaction. When applicable, the description is copied from the Flow + * object at the time of transaction creation. + */ + @SerializedName("description") + String description; + /** Indicates the FinancialAccount affected by this Transaction. */ @SerializedName("financial_account") String financialAccount; @@ -108,26 +120,9 @@ public class Transaction extends StripeObject implements HasId { @SerializedName("status_transitions") StatusTransitions statusTransitions; - /** The amount of the Transaction. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } + /** The v1 Treasury transaction associated with this transaction. */ + @SerializedName("treasury_transaction") + String treasuryTransaction; /** * The delta to the FinancialAccount's balance. The balance_impact for the Transaction is equal to @@ -139,78 +134,25 @@ public static class Amount extends StripeObject { public static class BalanceImpact extends StripeObject { /** Impact to the available balance. */ @SerializedName("available") - Available available; + Amount available; /** Impact to the inbound_pending balance. */ @SerializedName("inbound_pending") - InboundPending inboundPending; + Amount inboundPending; /** Impact to the outbound_pending balance. */ @SerializedName("outbound_pending") - OutboundPending outboundPending; - - /** Impact to the available balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Available extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** Impact to the inbound_pending balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class InboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } + Amount outboundPending; + } - /** Impact to the outbound_pending balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class OutboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } + /** Counterparty to this Transaction. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Counterparty extends StripeObject { + /** Name of the counterparty. */ + @SerializedName("name") + String name; } /** Details about the Flow object that created the Transaction. */ @@ -297,6 +239,38 @@ public static class Flow extends StripeObject { @SerializedName("transfer_reversal") String transferReversal; + /** If applicable, the ID of the Treasury CreditReversal that created this Transaction. */ + @SerializedName("treasury_credit_reversal") + String treasuryCreditReversal; + + /** If applicable, the ID of the Treasury DebitReversal that created this Transaction. */ + @SerializedName("treasury_debit_reversal") + String treasuryDebitReversal; + + /** If applicable, the ID of the Treasury InboundTransfer that created this Transaction. */ + @SerializedName("treasury_inbound_transfer") + String treasuryInboundTransfer; + + /** If applicable, the ID of the Treasury IssuingAuthorization that created this Transaction. */ + @SerializedName("treasury_issuing_authorization") + String treasuryIssuingAuthorization; + + /** If applicable, the ID of the Treasury OutboundPayment that created this Transaction. */ + @SerializedName("treasury_outbound_payment") + String treasuryOutboundPayment; + + /** If applicable, the ID of the Treasury OutboundTransfer that created this Transaction. */ + @SerializedName("treasury_outbound_transfer") + String treasuryOutboundTransfer; + + /** If applicable, the ID of the Treasury ReceivedCredit that created this Transaction. */ + @SerializedName("treasury_received_credit") + String treasuryReceivedCredit; + + /** If applicable, the ID of the Treasury ReceivedDebit that created this Transaction. */ + @SerializedName("treasury_received_debit") + String treasuryReceivedDebit; + /** * Open Enum. Type of the flow that created the Transaction. The field matching this value will * contain the ID of the flow. @@ -305,7 +279,11 @@ public static class Flow extends StripeObject { * charge}, {@code currency_conversion}, {@code dispute}, {@code fee_transaction}, {@code * inbound_transfer}, {@code outbound_payment}, {@code outbound_transfer}, {@code payout}, * {@code received_credit}, {@code received_debit}, {@code refund}, {@code reserve_hold}, {@code - * reserve_release}, {@code topup}, {@code transfer}, or {@code transfer_reversal}. + * reserve_release}, {@code topup}, {@code transfer}, {@code transfer_reversal}, {@code + * treasury_credit_reversal}, {@code treasury_debit_reversal}, {@code + * treasury_inbound_transfer}, {@code treasury_issuing_authorization}, {@code treasury_other}, + * {@code treasury_outbound_payment}, {@code treasury_outbound_transfer}, {@code + * treasury_received_credit}, or {@code treasury_received_debit}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java b/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java index de8bb601070..03f6c1275cc 100644 --- a/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java +++ b/src/main/java/com/stripe/model/v2/moneymanagement/TransactionEntry.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -61,6 +62,10 @@ public class TransactionEntry extends StripeObject implements HasId { @SerializedName("transaction_details") TransactionDetails transactionDetails; + /** The v1 Treasury transaction entry associated with this transaction entry. */ + @SerializedName("treasury_transaction_entry") + String treasuryTransactionEntry; + /** The delta to the FinancialAccount's balance. */ @Getter @Setter @@ -68,78 +73,15 @@ public class TransactionEntry extends StripeObject implements HasId { public static class BalanceImpact extends StripeObject { /** Impact to the available balance. */ @SerializedName("available") - Available available; + Amount available; /** Impact to the inbound_pending balance. */ @SerializedName("inbound_pending") - InboundPending inboundPending; + Amount inboundPending; /** Impact to the outbound_pending balance. */ @SerializedName("outbound_pending") - OutboundPending outboundPending; - - /** Impact to the available balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Available extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** Impact to the inbound_pending balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class InboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** Impact to the outbound_pending balance. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class OutboundPending extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } + Amount outboundPending; } /** Details copied from the transaction that this TransactionEntry belongs to. */ @@ -265,6 +207,40 @@ public static class Flow extends StripeObject { @SerializedName("transfer_reversal") String transferReversal; + /** If applicable, the ID of the Treasury CreditReversal that created this Transaction. */ + @SerializedName("treasury_credit_reversal") + String treasuryCreditReversal; + + /** If applicable, the ID of the Treasury DebitReversal that created this Transaction. */ + @SerializedName("treasury_debit_reversal") + String treasuryDebitReversal; + + /** If applicable, the ID of the Treasury InboundTransfer that created this Transaction. */ + @SerializedName("treasury_inbound_transfer") + String treasuryInboundTransfer; + + /** + * If applicable, the ID of the Treasury IssuingAuthorization that created this Transaction. + */ + @SerializedName("treasury_issuing_authorization") + String treasuryIssuingAuthorization; + + /** If applicable, the ID of the Treasury OutboundPayment that created this Transaction. */ + @SerializedName("treasury_outbound_payment") + String treasuryOutboundPayment; + + /** If applicable, the ID of the Treasury OutboundTransfer that created this Transaction. */ + @SerializedName("treasury_outbound_transfer") + String treasuryOutboundTransfer; + + /** If applicable, the ID of the Treasury ReceivedCredit that created this Transaction. */ + @SerializedName("treasury_received_credit") + String treasuryReceivedCredit; + + /** If applicable, the ID of the Treasury ReceivedDebit that created this Transaction. */ + @SerializedName("treasury_received_debit") + String treasuryReceivedDebit; + /** * Open Enum. Type of the flow that created the Transaction. The field matching this value * will contain the ID of the flow. @@ -273,8 +249,11 @@ public static class Flow extends StripeObject { * {@code charge}, {@code currency_conversion}, {@code dispute}, {@code fee_transaction}, * {@code inbound_transfer}, {@code outbound_payment}, {@code outbound_transfer}, {@code * payout}, {@code received_credit}, {@code received_debit}, {@code refund}, {@code - * reserve_hold}, {@code reserve_release}, {@code topup}, {@code transfer}, or {@code - * transfer_reversal}. + * reserve_hold}, {@code reserve_release}, {@code topup}, {@code transfer}, {@code + * transfer_reversal}, {@code treasury_credit_reversal}, {@code treasury_debit_reversal}, + * {@code treasury_inbound_transfer}, {@code treasury_issuing_authorization}, {@code + * treasury_other}, {@code treasury_outbound_payment}, {@code treasury_outbound_transfer}, + * {@code treasury_received_credit}, or {@code treasury_received_debit}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java b/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java index f1ae51a7129..1966e8230f0 100644 --- a/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java +++ b/src/main/java/com/stripe/model/v2/payments/OffSessionPayment.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.Map; import lombok.EqualsAndHashCode; @@ -26,11 +27,11 @@ public class OffSessionPayment extends StripeObject implements HasId { /** The amount available to be captured. */ @SerializedName("amount_capturable") - AmountCapturable amountCapturable; + Amount amountCapturable; /** The “presentment amount” to be collected from the customer. */ @SerializedName("amount_requested") - AmountRequested amountRequested; + Amount amountRequested; /** * The frequency of the underlying payment. @@ -62,8 +63,8 @@ public class OffSessionPayment extends StripeObject implements HasId { /** * The reason why the OffSessionPayment failed. * - *

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

One of {@code authorization_expired}, {@code no_valid_payment_method}, {@code + * rejected_by_partner}, or {@code retries_exhausted}. */ @SerializedName("failure_reason") String failureReason; @@ -165,48 +166,6 @@ public class OffSessionPayment extends StripeObject implements HasId { @SerializedName("transfer_data") TransferData transferData; - /** The amount available to be captured. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class AmountCapturable extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - - /** The “presentment amount” to be collected from the customer. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class AmountRequested extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Details about the capture configuration for the OffSessionPayment. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntent.java b/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntent.java index a57c6f217d1..803ee95936a 100644 --- a/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntent.java +++ b/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntent.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.List; import java.util.Map; @@ -81,27 +82,6 @@ public class SettlementAllocationIntent extends StripeObject implements HasId { @SerializedName("status_details") StatusDetails statusDetails; - /** The amount and currency of the SettlementAllocationIntent. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Status details for a SettlementAllocationIntent in {@code errored} state. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntentSplit.java b/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntentSplit.java index c870e9150e6..27ce0b6623b 100644 --- a/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntentSplit.java +++ b/src/main/java/com/stripe/model/v2/payments/SettlementAllocationIntentSplit.java @@ -4,7 +4,9 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import com.stripe.v2.Amount; import java.time.Instant; +import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -42,6 +44,10 @@ public class SettlementAllocationIntentSplit extends StripeObject implements Has @SerializedName("livemode") Boolean livemode; + /** Metadata associated with the SettlementAllocationIntentSplit. */ + @SerializedName("metadata") + Map metadata; + /** * String representing the object's type. Objects of the same type share the same value of the * object field. @@ -51,7 +57,7 @@ public class SettlementAllocationIntentSplit extends StripeObject implements Has @SerializedName("object") String object; - /** The ID of the SettlementAllocationIntent that this split belongs too. */ + /** The ID of the SettlementAllocationIntent that this split belongs to. */ @SerializedName("settlement_allocation_intent") String settlementAllocationIntent; @@ -71,27 +77,6 @@ public class SettlementAllocationIntentSplit extends StripeObject implements Has @SerializedName("type") String type; - /** The amount and currency of the SettlementAllocationIntentSplit. */ - @Getter - @Setter - @EqualsAndHashCode(callSuper = false) - public static class Amount extends StripeObject { - /** - * Three-letter ISO currency - * code, in lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - } - /** Details about the Flow object that settled the split. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/v2/reporting/ReportRun.java b/src/main/java/com/stripe/model/v2/reporting/ReportRun.java index cd086c1cce2..659323dcc14 100644 --- a/src/main/java/com/stripe/model/v2/reporting/ReportRun.java +++ b/src/main/java/com/stripe/model/v2/reporting/ReportRun.java @@ -1,8 +1,10 @@ // File generated from our OpenAPI spec package com.stripe.model.v2.reporting; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.model.StripeObject; import java.time.Instant; import java.util.Map; @@ -122,6 +124,7 @@ public static class File extends StripeObject { /** The total size of the file in bytes. */ @SerializedName("size") + @JsonAdapter(StringInt64TypeAdapter.class) Long size; /** A pre-signed URL that allows secure, time-limited access to download the file. */ diff --git a/src/main/java/com/stripe/model/v2/tax/ManualRule.java b/src/main/java/com/stripe/model/v2/tax/ManualRule.java index a3953ebf634..3610b2d5379 100644 --- a/src/main/java/com/stripe/model/v2/tax/ManualRule.java +++ b/src/main/java/com/stripe/model/v2/tax/ManualRule.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.model.HasId; import com.stripe.model.StripeObject; +import java.math.BigDecimal; import java.time.Instant; import java.util.List; import lombok.EqualsAndHashCode; @@ -145,7 +146,7 @@ public static class Rate extends StripeObject { /** Percentage of the tax rate. Must be positive and maximum of 4 decimal points. */ @SerializedName("percentage") - String percentage; + BigDecimal percentage; /** State of the tax rate. */ @SerializedName("state") diff --git a/src/main/java/com/stripe/net/HttpClient.java b/src/main/java/com/stripe/net/HttpClient.java index 1f4a3019f74..8aa3fcda5f1 100644 --- a/src/main/java/com/stripe/net/HttpClient.java +++ b/src/main/java/com/stripe/net/HttpClient.java @@ -154,6 +154,7 @@ static String detectAIAgent(Function getEnv) { {"CODEX_CI", "codex_cli"}, {"CURSOR_AGENT", "cursor"}, {"GEMINI_CLI", "gemini_cli"}, + {"OPENCLAW_SHELL", "openclaw"}, {"OPENCODE", "open_code"}, // The end of the section generated from our OpenAPI spec }; diff --git a/src/main/java/com/stripe/net/JsonEncoder.java b/src/main/java/com/stripe/net/JsonEncoder.java index 35de33bc6a2..898a7d6f5e3 100644 --- a/src/main/java/com/stripe/net/JsonEncoder.java +++ b/src/main/java/com/stripe/net/JsonEncoder.java @@ -3,15 +3,42 @@ import com.google.gson.FieldNamingPolicy; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; final class JsonEncoder { + /** + * Serializes BigDecimal as a JSON string (e.g., "25.5") rather than a JSON number (25.5). All + * BigDecimal fields in the Stripe API use format: decimal, and the V2 API expects them as strings + * on the wire. + */ + private static final TypeAdapter BIG_DECIMAL_STRING_ADAPTER = + new TypeAdapter() { + @Override + public void write(JsonWriter out, BigDecimal value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(value.toPlainString()); + } + } + + @Override + public BigDecimal read(JsonReader in) throws IOException { + return new BigDecimal(in.nextString()); + } + }; + private static final Gson BODY_GSON = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .serializeNulls() + .registerTypeAdapter(BigDecimal.class, BIG_DECIMAL_STRING_ADAPTER) .create(); public static HttpContent createHttpContent(Map params) throws IOException { diff --git a/src/main/java/com/stripe/net/Webhook.java b/src/main/java/com/stripe/net/Webhook.java index ea67ea34362..09505f70873 100644 --- a/src/main/java/com/stripe/net/Webhook.java +++ b/src/main/java/com/stripe/net/Webhook.java @@ -54,8 +54,8 @@ public static Event constructEvent( /** * Returns an Event instance using the provided JSON payload. Throws a JsonSyntaxException if the - * payload is not valid JSON, and a SignatureVerificationException if the signature verification - * fails for any reason. + * payload is not valid JSON, a SignatureVerificationException if the signature verification fails + * for any reason, and an IllegalArgumentException if you pass the wrong type of input. * * @param payload the payload sent by Stripe. * @param sigHeader the contents of the signature header sent by Stripe. @@ -72,6 +72,13 @@ public static Event constructEvent( Event event = StripeObject.deserializeStripeObject( payload, Event.class, ApiResource.getGlobalResponseGetter()); + + if ("v2.core.event".equals(event.getObject())) { + throw new IllegalArgumentException( + "You passed an event notification to Webhook.constructEvent, which expects a webhook payload." + + " Use StripeClient.parseEventNotification instead."); + } + Signature.verifyHeader(payload, sigHeader, secret, tolerance, clock); // StripeObjects source their raw JSON object from their last response, but constructed webhooks // don't have that diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index e665e74e32d..9c6f3d452c8 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -42801,10 +42801,6 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Preferred transaction settlement speed. */ - @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -42852,7 +42848,6 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, ApiRequestParams.EnumParam transactionPurpose, @@ -42861,7 +42856,6 @@ private UsBankAccount( this.financialConnections = financialConnections; this.mandateOptions = mandateOptions; this.networks = networks; - this.preferredSettlementSpeed = preferredSettlementSpeed; this.setupFutureUsage = setupFutureUsage; this.targetDate = targetDate; this.transactionPurpose = transactionPurpose; @@ -42881,8 +42875,6 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; - private ApiRequestParams.EnumParam setupFutureUsage; private String targetDate; @@ -42898,7 +42890,6 @@ public PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount build() { this.financialConnections, this.mandateOptions, this.networks, - this.preferredSettlementSpeed, this.setupFutureUsage, this.targetDate, this.transactionPurpose, @@ -42958,20 +42949,6 @@ public Builder setNetworks( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed( - PaymentIntentConfirmParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed - preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -43817,21 +43794,6 @@ public enum Requested implements ApiRequestParams.EnumParam { } } - public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam { - @SerializedName("fastest") - FASTEST("fastest"), - - @SerializedName("standard") - STANDARD("standard"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - PreferredSettlementSpeed(String value) { - this.value = value; - } - } - public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 97820a0f76a..d6565a7a5ec 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -43281,10 +43281,6 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Preferred transaction settlement speed. */ - @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -43332,7 +43328,6 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, String targetDate, ApiRequestParams.EnumParam transactionPurpose, @@ -43341,7 +43336,6 @@ private UsBankAccount( this.financialConnections = financialConnections; this.mandateOptions = mandateOptions; this.networks = networks; - this.preferredSettlementSpeed = preferredSettlementSpeed; this.setupFutureUsage = setupFutureUsage; this.targetDate = targetDate; this.transactionPurpose = transactionPurpose; @@ -43361,8 +43355,6 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; - private ApiRequestParams.EnumParam setupFutureUsage; private String targetDate; @@ -43378,7 +43370,6 @@ public PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount build() { this.financialConnections, this.mandateOptions, this.networks, - this.preferredSettlementSpeed, this.setupFutureUsage, this.targetDate, this.transactionPurpose, @@ -43436,20 +43427,6 @@ public Builder setNetworks( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed( - PaymentIntentCreateParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed - preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -44295,21 +44272,6 @@ public enum Requested implements ApiRequestParams.EnumParam { } } - public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam { - @SerializedName("fastest") - FASTEST("fastest"), - - @SerializedName("standard") - STANDARD("standard"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - PreferredSettlementSpeed(String value) { - this.value = value; - } - } - public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 478aae19285..0e48eb8da81 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -45182,10 +45182,6 @@ public static class UsBankAccount { @SerializedName("networks") Networks networks; - /** Preferred transaction settlement speed. */ - @SerializedName("preferred_settlement_speed") - ApiRequestParams.EnumParam preferredSettlementSpeed; - /** * Indicates that you intend to make future payments with this PaymentIntent's payment method. * @@ -45233,7 +45229,6 @@ private UsBankAccount( FinancialConnections financialConnections, MandateOptions mandateOptions, Networks networks, - ApiRequestParams.EnumParam preferredSettlementSpeed, ApiRequestParams.EnumParam setupFutureUsage, Object targetDate, ApiRequestParams.EnumParam transactionPurpose, @@ -45242,7 +45237,6 @@ private UsBankAccount( this.financialConnections = financialConnections; this.mandateOptions = mandateOptions; this.networks = networks; - this.preferredSettlementSpeed = preferredSettlementSpeed; this.setupFutureUsage = setupFutureUsage; this.targetDate = targetDate; this.transactionPurpose = transactionPurpose; @@ -45262,8 +45256,6 @@ public static class Builder { private Networks networks; - private ApiRequestParams.EnumParam preferredSettlementSpeed; - private ApiRequestParams.EnumParam setupFutureUsage; private Object targetDate; @@ -45279,7 +45271,6 @@ public PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount build() { this.financialConnections, this.mandateOptions, this.networks, - this.preferredSettlementSpeed, this.setupFutureUsage, this.targetDate, this.transactionPurpose, @@ -45337,20 +45328,6 @@ public Builder setNetworks( return this; } - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed( - PaymentIntentUpdateParams.PaymentMethodOptions.UsBankAccount.PreferredSettlementSpeed - preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - - /** Preferred transaction settlement speed. */ - public Builder setPreferredSettlementSpeed(EmptyParam preferredSettlementSpeed) { - this.preferredSettlementSpeed = preferredSettlementSpeed; - return this; - } - /** * Indicates that you intend to make future payments with this PaymentIntent's payment * method. @@ -46221,21 +46198,6 @@ public enum Requested implements ApiRequestParams.EnumParam { } } - public enum PreferredSettlementSpeed implements ApiRequestParams.EnumParam { - @SerializedName("fastest") - FASTEST("fastest"), - - @SerializedName("standard") - STANDARD("standard"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - PreferredSettlementSpeed(String value) { - this.value = value; - } - } - public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"), diff --git a/src/main/java/com/stripe/param/v2/billing/ActionServiceCreateParams.java b/src/main/java/com/stripe/param/v2/billing/ActionServiceCreateParams.java index 1be8e11f0fc..f4f421c5954 100644 --- a/src/main/java/com/stripe/param/v2/billing/ActionServiceCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/ActionServiceCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -175,7 +176,7 @@ public Builder setType(ActionServiceCreateParams.Type type) { public static class CreditGrant { /** Required. The amount of the credit grant. */ @SerializedName("amount") - Amount amount; + com.stripe.param.v2.billing.ActionServiceCreateParams.CreditGrant.Amount amount; /** Required. Defines the scope where the credit grant is applicable. */ @SerializedName("applicability_config") @@ -210,7 +211,7 @@ public static class CreditGrant { Long priority; private CreditGrant( - Amount amount, + com.stripe.param.v2.billing.ActionServiceCreateParams.CreditGrant.Amount amount, ApplicabilityConfig applicabilityConfig, Category category, ExpiryConfig expiryConfig, @@ -231,7 +232,7 @@ public static Builder builder() { } public static class Builder { - private Amount amount; + private com.stripe.param.v2.billing.ActionServiceCreateParams.CreditGrant.Amount amount; private ApplicabilityConfig applicabilityConfig; @@ -346,7 +347,7 @@ public static class Amount { /** The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. */ @SerializedName("monetary") - Monetary monetary; + com.stripe.v2.Amount monetary; /** * Required. The type of the credit grant amount. We currently support {@code @@ -358,7 +359,7 @@ public static class Amount { private Amount( CustomPricingUnit customPricingUnit, Map extraParams, - Monetary monetary, + com.stripe.v2.Amount monetary, Type type) { this.customPricingUnit = customPricingUnit; this.extraParams = extraParams; @@ -375,7 +376,7 @@ public static class Builder { private Map extraParams; - private Monetary monetary; + private com.stripe.v2.Amount monetary; private Type type; @@ -426,7 +427,7 @@ public Builder putAllExtraParam(Map map) { /** * The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. */ - public Builder setMonetary(ActionServiceCreateParams.CreditGrant.Amount.Monetary monetary) { + public Builder setMonetary(com.stripe.v2.Amount monetary) { this.monetary = monetary; return this; } @@ -463,9 +464,9 @@ public static class CustomPricingUnit { * string. */ @SerializedName("value") - String value; + BigDecimal value; - private CustomPricingUnit(Map extraParams, String id, String value) { + private CustomPricingUnit(Map extraParams, String id, BigDecimal value) { this.extraParams = extraParams; this.id = id; this.value = value; @@ -480,7 +481,7 @@ public static class Builder { private String id; - private String value; + private BigDecimal value; /** Finalize and obtain parameter instance from this builder. */ public ActionServiceCreateParams.CreditGrant.Amount.CustomPricingUnit build() { @@ -528,109 +529,7 @@ public Builder setId(String id) { * Required. The value of the credit grant, decimal value represented as * a string. */ - public Builder setValue(String value) { - this.value = value; - return this; - } - } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Monetary { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its parent - * instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the - * smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Monetary(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public ActionServiceCreateParams.CreditGrant.Amount.Monetary build() { - return new ActionServiceCreateParams.CreditGrant.Amount.Monetary( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 ActionServiceCreateParams.CreditGrant.Amount.Monetary#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 ActionServiceCreateParams.CreditGrant.Amount.Monetary#extraParams} for - * the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { + public Builder setValue(BigDecimal value) { this.value = value; return this; } @@ -971,7 +870,7 @@ public enum Category implements ApiRequestParams.EnumParam { public static class CreditGrantPerTenant { /** Required. The amount of the credit grant. */ @SerializedName("amount") - Amount amount; + com.stripe.param.v2.billing.ActionServiceCreateParams.CreditGrantPerTenant.Amount amount; /** Required. Defines the scope where the credit grant is applicable. */ @SerializedName("applicability_config") @@ -1010,7 +909,7 @@ public static class CreditGrantPerTenant { Long priority; private CreditGrantPerTenant( - Amount amount, + com.stripe.param.v2.billing.ActionServiceCreateParams.CreditGrantPerTenant.Amount amount, ApplicabilityConfig applicabilityConfig, Category category, ExpiryConfig expiryConfig, @@ -1033,7 +932,8 @@ public static Builder builder() { } public static class Builder { - private Amount amount; + private com.stripe.param.v2.billing.ActionServiceCreateParams.CreditGrantPerTenant.Amount + amount; private ApplicabilityConfig applicabilityConfig; @@ -1159,7 +1059,7 @@ public static class Amount { /** The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. */ @SerializedName("monetary") - Monetary monetary; + com.stripe.v2.Amount monetary; /** * Required. The type of the credit grant amount. We currently support {@code @@ -1171,7 +1071,7 @@ public static class Amount { private Amount( CustomPricingUnit customPricingUnit, Map extraParams, - Monetary monetary, + com.stripe.v2.Amount monetary, Type type) { this.customPricingUnit = customPricingUnit; this.extraParams = extraParams; @@ -1188,7 +1088,7 @@ public static class Builder { private Map extraParams; - private Monetary monetary; + private com.stripe.v2.Amount monetary; private Type type; @@ -1240,8 +1140,7 @@ public Builder putAllExtraParam(Map map) { /** * The monetary amount of the credit grant. Required if {@code type} is {@code monetary}. */ - public Builder setMonetary( - ActionServiceCreateParams.CreditGrantPerTenant.Amount.Monetary monetary) { + public Builder setMonetary(com.stripe.v2.Amount monetary) { this.monetary = monetary; return this; } @@ -1278,9 +1177,9 @@ public static class CustomPricingUnit { * string. */ @SerializedName("value") - String value; + BigDecimal value; - private CustomPricingUnit(Map extraParams, String id, String value) { + private CustomPricingUnit(Map extraParams, String id, BigDecimal value) { this.extraParams = extraParams; this.id = id; this.value = value; @@ -1295,7 +1194,7 @@ public static class Builder { private String id; - private String value; + private BigDecimal value; /** Finalize and obtain parameter instance from this builder. */ public ActionServiceCreateParams.CreditGrantPerTenant.Amount.CustomPricingUnit build() { @@ -1343,111 +1242,7 @@ public Builder setId(String id) { * Required. The value of the credit grant, decimal value represented as * a string. */ - public Builder setValue(String value) { - this.value = value; - return this; - } - } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Monetary { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its parent - * instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the - * smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Monetary(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public ActionServiceCreateParams.CreditGrantPerTenant.Amount.Monetary build() { - return new ActionServiceCreateParams.CreditGrantPerTenant.Amount.Monetary( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * ActionServiceCreateParams.CreditGrantPerTenant.Amount.Monetary#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 - * ActionServiceCreateParams.CreditGrantPerTenant.Amount.Monetary#extraParams} for the - * field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { + public Builder setValue(BigDecimal value) { this.value = value; return this; } diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java index a4ae606600f..6eab345b23f 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import java.util.ArrayList; import java.util.HashMap; @@ -1016,6 +1018,7 @@ public Builder setRequestThreeDSecure( public static class MandateOptions { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ 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 b4eb433b47e..95fb6832134 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; import java.util.ArrayList; @@ -1088,6 +1090,7 @@ public Builder setRequestThreeDSecure( public static class MandateOptions { /** Amount to be charged for future payments. */ @SerializedName("amount") + @JsonAdapter(StringInt64TypeAdapter.class) Long amount; /** The AmountType for the mandate. One of {@code fixed} or {@code maximum}. */ diff --git a/src/main/java/com/stripe/param/v2/billing/IntentCreateParams.java b/src/main/java/com/stripe/param/v2/billing/IntentCreateParams.java index 975bc82827e..e766ad0b7ba 100644 --- a/src/main/java/com/stripe/param/v2/billing/IntentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/IntentCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -42,17 +43,23 @@ public class IntentCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Select additional fields to include in the response. */ + @SerializedName("include") + List include; + private IntentCreateParams( List actions, String cadence, CadenceData cadenceData, String currency, - Map extraParams) { + Map extraParams, + List include) { this.actions = actions; this.cadence = cadence; this.cadenceData = cadenceData; this.currency = currency; this.extraParams = extraParams; + this.include = include; } public static Builder builder() { @@ -70,10 +77,17 @@ public static class Builder { private Map extraParams; + private List include; + /** Finalize and obtain parameter instance from this builder. */ public IntentCreateParams build() { return new IntentCreateParams( - this.actions, this.cadence, this.cadenceData, this.currency, this.extraParams); + this.actions, + this.cadence, + this.cadenceData, + this.currency, + this.extraParams, + this.include); } /** @@ -148,6 +162,32 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * IntentCreateParams#include} for the field documentation. + */ + public Builder addInclude(IntentCreateParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * IntentCreateParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } } @Getter @@ -300,7 +340,11 @@ public Builder setType(IntentCreateParams.Action.Type type) { @Getter @EqualsAndHashCode(callSuper = false) public static class Apply { - /** When the apply action will take effect. Defaults to on_reserve if not specified. */ + /** Details for applying a discount. */ + @SerializedName("discount") + Discount discount; + + /** When the apply action will take effect. If not specified, defaults to on_reserve. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -328,11 +372,13 @@ public static class Apply { Type type; private Apply( + Discount discount, EffectiveAt effectiveAt, Map extraParams, InvoiceDiscountRule invoiceDiscountRule, SpendModifierRule spendModifierRule, Type type) { + this.discount = discount; this.effectiveAt = effectiveAt; this.extraParams = extraParams; this.invoiceDiscountRule = invoiceDiscountRule; @@ -345,6 +391,8 @@ public static Builder builder() { } public static class Builder { + private Discount discount; + private EffectiveAt effectiveAt; private Map extraParams; @@ -358,6 +406,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public IntentCreateParams.Action.Apply build() { return new IntentCreateParams.Action.Apply( + this.discount, this.effectiveAt, this.extraParams, this.invoiceDiscountRule, @@ -365,7 +414,13 @@ public IntentCreateParams.Action.Apply build() { this.type); } - /** When the apply action will take effect. Defaults to on_reserve if not specified. */ + /** Details for applying a discount. */ + public Builder setDiscount(IntentCreateParams.Action.Apply.Discount discount) { + this.discount = discount; + return this; + } + + /** When the apply action will take effect. If not specified, defaults to on_reserve. */ public Builder setEffectiveAt(IntentCreateParams.Action.Apply.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; return this; @@ -420,6 +475,121 @@ public Builder setType(IntentCreateParams.Action.Apply.Type type) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Discount { + /** The ID of the Coupon to apply. */ + @SerializedName("coupon") + String coupon; + + /** + * 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 ID of the PromotionCode to apply. */ + @SerializedName("promotion_code") + String promotionCode; + + /** Required. Type of the discount. */ + @SerializedName("type") + Type type; + + private Discount( + String coupon, Map extraParams, String promotionCode, Type type) { + this.coupon = coupon; + this.extraParams = extraParams; + this.promotionCode = promotionCode; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String coupon; + + private Map extraParams; + + private String promotionCode; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public IntentCreateParams.Action.Apply.Discount build() { + return new IntentCreateParams.Action.Apply.Discount( + this.coupon, this.extraParams, this.promotionCode, this.type); + } + + /** The ID of the Coupon to apply. */ + public Builder setCoupon(String coupon) { + this.coupon = coupon; + 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 IntentCreateParams.Action.Apply.Discount#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 IntentCreateParams.Action.Apply.Discount#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 ID of the PromotionCode to apply. */ + public Builder setPromotionCode(String promotionCode) { + this.promotionCode = promotionCode; + return this; + } + + /** Required. Type of the discount. */ + public Builder setType(IntentCreateParams.Action.Apply.Discount.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("coupon") + COUPON("coupon"), + + @SerializedName("promotion_code") + PROMOTION_CODE("promotion_code"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class EffectiveAt { @@ -433,12 +603,20 @@ public static class EffectiveAt { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The timestamp at which the apply action will take effect. Only present if type is + * timestamp. Only allowed for discount actions. + */ + @SerializedName("timestamp") + Instant timestamp; + /** Required. When the apply action will take effect. */ @SerializedName("type") Type type; - private EffectiveAt(Map extraParams, Type type) { + private EffectiveAt(Map extraParams, Instant timestamp, Type type) { this.extraParams = extraParams; + this.timestamp = timestamp; this.type = type; } @@ -449,11 +627,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Instant timestamp; + private Type type; /** Finalize and obtain parameter instance from this builder. */ public IntentCreateParams.Action.Apply.EffectiveAt build() { - return new IntentCreateParams.Action.Apply.EffectiveAt(this.extraParams, this.type); + return new IntentCreateParams.Action.Apply.EffectiveAt( + this.extraParams, this.timestamp, this.type); } /** @@ -484,6 +665,15 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The timestamp at which the apply action will take effect. Only present if type is + * timestamp. Only allowed for discount actions. + */ + public Builder setTimestamp(Instant timestamp) { + this.timestamp = timestamp; + return this; + } + /** Required. When the apply action will take effect. */ public Builder setType(IntentCreateParams.Action.Apply.EffectiveAt.Type type) { this.type = type; @@ -495,11 +685,17 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("current_billing_period_end") CURRENT_BILLING_PERIOD_END("current_billing_period_end"), + @SerializedName("current_billing_period_start") + CURRENT_BILLING_PERIOD_START("current_billing_period_start"), + @SerializedName("next_billing_period_start") NEXT_BILLING_PERIOD_START("next_billing_period_start"), @SerializedName("on_reserve") - ON_RESERVE("on_reserve"); + ON_RESERVE("on_reserve"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); @Getter(onMethod_ = {@Override}) private final String value; @@ -645,12 +841,12 @@ public static class PercentOff { * percent_off of 50.0 will make $100 amount $50 instead. */ @SerializedName("percent_off") - String percentOff; + BigDecimal percentOff; private PercentOff( Map extraParams, MaximumApplications maximumApplications, - String percentOff) { + BigDecimal percentOff) { this.extraParams = extraParams; this.maximumApplications = maximumApplications; this.percentOff = percentOff; @@ -665,7 +861,7 @@ public static class Builder { private MaximumApplications maximumApplications; - private String percentOff; + private BigDecimal percentOff; /** Finalize and obtain parameter instance from this builder. */ public IntentCreateParams.Action.Apply.InvoiceDiscountRule.PercentOff build() { @@ -718,7 +914,7 @@ public Builder setMaximumApplications( * Required. Percent that will be taken off of the amount. For example, * percent_off of 50.0 will make $100 amount $50 instead. */ - public Builder setPercentOff(String percentOff) { + public Builder setPercentOff(BigDecimal percentOff) { this.percentOff = percentOff; return this; } @@ -961,8 +1157,8 @@ public static class MaxBillingPeriodSpend { Amount amount; /** - * Required. The configration for the overage rate for the custom pricing - * unit. + * Required. The configuration for the overage rate for the custom + * pricing unit. */ @SerializedName("custom_pricing_unit_overage_rate") CustomPricingUnitOverageRate customPricingUnitOverageRate; @@ -1012,7 +1208,7 @@ public Builder setAmount( } /** - * Required. The configration for the overage rate for the custom + * Required. The configuration for the overage rate for the custom * pricing unit. */ public Builder setCustomPricingUnitOverageRate( @@ -1343,6 +1539,9 @@ public enum Type implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("discount") + DISCOUNT("discount"), + @SerializedName("invoice_discount_rule") INVOICE_DISCOUNT_RULE("invoice_discount_rule"), @@ -2174,7 +2373,10 @@ public enum CreditProrationBehavior implements ApiRequestParams.EnumParam { public enum Type implements ApiRequestParams.EnumParam { @SerializedName("license_fee") - LICENSE_FEE("license_fee"); + LICENSE_FEE("license_fee"), + + @SerializedName("recurring_credit_grant") + RECURRING_CREDIT_GRANT("recurring_credit_grant"); @Getter(onMethod_ = {@Override}) private final String value; @@ -3114,7 +3316,10 @@ public enum DebitProrationBehavior implements ApiRequestParams.EnumParam { public enum Type implements ApiRequestParams.EnumParam { @SerializedName("license_fee") - LICENSE_FEE("license_fee"); + LICENSE_FEE("license_fee"), + + @SerializedName("recurring_credit_grant") + RECURRING_CREDIT_GRANT("recurring_credit_grant"); @Getter(onMethod_ = {@Override}) private final String value; @@ -3161,7 +3366,7 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Remove { - /** When the remove action will take effect. Defaults to on_reserve if not specified. */ + /** When the remove action will take effect. If not specified, defaults to on_reserve. */ @SerializedName("effective_at") EffectiveAt effectiveAt; @@ -3224,7 +3429,7 @@ public IntentCreateParams.Action.Remove build() { this.type); } - /** When the remove action will take effect. Defaults to on_reserve if not specified. */ + /** When the remove action will take effect. If not specified, defaults to on_reserve. */ public Builder setEffectiveAt(IntentCreateParams.Action.Remove.EffectiveAt effectiveAt) { this.effectiveAt = effectiveAt; return this; @@ -4276,7 +4481,10 @@ public enum DebitProrationBehavior implements ApiRequestParams.EnumParam { public enum Type implements ApiRequestParams.EnumParam { @SerializedName("license_fee") - LICENSE_FEE("license_fee"); + LICENSE_FEE("license_fee"), + + @SerializedName("recurring_credit_grant") + RECURRING_CREDIT_GRANT("recurring_credit_grant"); @Getter(onMethod_ = {@Override}) private final String value; @@ -4475,7 +4683,7 @@ public static class Item { @SerializedName("price") String price; - /** Quantity for this item. If not provided, will default to 1. */ + /** Quantity for this item. If not provided, defaults to 1. */ @SerializedName("quantity") Long quantity; @@ -4575,7 +4783,7 @@ public Builder setPrice(String price) { return this; } - /** Quantity for this item. If not provided, will default to 1. */ + /** Quantity for this item. If not provided, defaults to 1. */ public Builder setQuantity(Long quantity) { this.quantity = quantity; return this; @@ -6294,4 +6502,16 @@ public Builder setVersion(String version) { } } } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("invoice_resources.preview_invoice") + INVOICE_RESOURCES__PREVIEW_INVOICE("invoice_resources.preview_invoice"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } } diff --git a/src/main/java/com/stripe/param/v2/billing/IntentReserveParams.java b/src/main/java/com/stripe/param/v2/billing/IntentReserveParams.java new file mode 100644 index 00000000000..f624819c634 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/IntentReserveParams.java @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class IntentReserveParams 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; + + /** Select additional fields to include in the response. */ + @SerializedName("include") + List include; + + private IntentReserveParams( + Map extraParams, List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public IntentReserveParams build() { + return new IntentReserveParams(this.extraParams, this.include); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * IntentReserveParams#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 IntentReserveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * IntentReserveParams#include} for the field documentation. + */ + public Builder addInclude(IntentReserveParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * IntentReserveParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("invoice_resources.preview_invoice") + INVOICE_RESOURCES__PREVIEW_INVOICE("invoice_resources.preview_invoice"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/LicenseFeeCreateParams.java b/src/main/java/com/stripe/param/v2/billing/LicenseFeeCreateParams.java index beb736e8731..2a9620309ba 100644 --- a/src/main/java/com/stripe/param/v2/billing/LicenseFeeCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/LicenseFeeCreateParams.java @@ -1,8 +1,11 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -392,7 +395,7 @@ public static class Tier { * up_to_decimal} and {@code up_to_inf} may be set. */ @SerializedName("up_to_decimal") - String upToDecimal; + BigDecimal upToDecimal; /** * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may be @@ -405,7 +408,7 @@ private Tier( Map extraParams, String flatAmount, String unitAmount, - String upToDecimal, + BigDecimal upToDecimal, UpToInf upToInf) { this.extraParams = extraParams; this.flatAmount = flatAmount; @@ -425,7 +428,7 @@ public static class Builder { private String unitAmount; - private String upToDecimal; + private BigDecimal upToDecimal; private UpToInf upToInf; @@ -483,7 +486,7 @@ public Builder setUnitAmount(String unitAmount) { * Up to and including this quantity will be contained in the tier. Only one of {@code * up_to_decimal} and {@code up_to_inf} may be set. */ - public Builder setUpToDecimal(String upToDecimal) { + public Builder setUpToDecimal(BigDecimal upToDecimal) { this.upToDecimal = upToDecimal; return this; } @@ -516,6 +519,7 @@ public enum UpToInf implements ApiRequestParams.EnumParam { public static class TransformQuantity { /** Required. Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** diff --git a/src/main/java/com/stripe/param/v2/billing/LicenseFeeUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/LicenseFeeUpdateParams.java index 83a356b9d73..bde2a29bdd9 100644 --- a/src/main/java/com/stripe/param/v2/billing/LicenseFeeUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/LicenseFeeUpdateParams.java @@ -1,9 +1,12 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -469,7 +472,7 @@ public Builder setUnitAmount(EmptyParam unitAmount) { * Up to and including this quantity will be contained in the tier. Only one of {@code * up_to_decimal} and {@code up_to_inf} may be set. */ - public Builder setUpToDecimal(String upToDecimal) { + public Builder setUpToDecimal(BigDecimal upToDecimal) { this.upToDecimal = upToDecimal; return this; } @@ -511,6 +514,7 @@ public enum UpToInf implements ApiRequestParams.EnumParam { public static class TransformQuantity { /** Required. Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** diff --git a/src/main/java/com/stripe/param/v2/billing/LicensedItemCreateParams.java b/src/main/java/com/stripe/param/v2/billing/LicensedItemCreateParams.java index e7cfbecb215..7a8d2be36ba 100644 --- a/src/main/java/com/stripe/param/v2/billing/LicensedItemCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/LicensedItemCreateParams.java @@ -28,8 +28,8 @@ public class LicensedItemCreateParams extends ApiRequestParams { Map extraParams; /** - * An internal key you can use to search for a particular billable item. Must be unique among - * billable items. Maximum length of 200 characters. + * An internal key you can use to search for a particular licensed item. Must be unique among + * licensed items. Maximum length of 200 characters. */ @SerializedName("lookup_key") String lookupKey; @@ -134,8 +134,8 @@ public Builder putAllExtraParam(Map map) { } /** - * An internal key you can use to search for a particular billable item. Must be unique among - * billable items. Maximum length of 200 characters. + * An internal key you can use to search for a particular licensed item. Must be unique among + * licensed items. Maximum length of 200 characters. */ public Builder setLookupKey(String lookupKey) { this.lookupKey = lookupKey; diff --git a/src/main/java/com/stripe/param/v2/billing/LicensedItemUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/LicensedItemUpdateParams.java index 8a2b7bc2696..730c53c18f1 100644 --- a/src/main/java/com/stripe/param/v2/billing/LicensedItemUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/LicensedItemUpdateParams.java @@ -28,7 +28,7 @@ public class LicensedItemUpdateParams extends ApiRequestParams { Map extraParams; /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular licensed item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ @SerializedName("lookup_key") @@ -143,7 +143,7 @@ public Builder putAllExtraParam(Map map) { } /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular licensed item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ public Builder setLookupKey(String lookupKey) { @@ -152,7 +152,7 @@ public Builder setLookupKey(String lookupKey) { } /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular licensed item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ public Builder setLookupKey(EmptyParam lookupKey) { diff --git a/src/main/java/com/stripe/param/v2/billing/MeteredItemCreateParams.java b/src/main/java/com/stripe/param/v2/billing/MeteredItemCreateParams.java index 5939e5c3e5d..29f990f702b 100644 --- a/src/main/java/com/stripe/param/v2/billing/MeteredItemCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/MeteredItemCreateParams.java @@ -34,8 +34,8 @@ public class MeteredItemCreateParams extends ApiRequestParams { List invoicePresentationDimensions; /** - * An internal key you can use to search for a particular billable item. Must be unique among - * billable items. Maximum length of 200 characters. + * An internal key you can use to search for a particular metered item. Must be unique among + * metered items. Maximum length of 200 characters. */ @SerializedName("lookup_key") String lookupKey; @@ -189,8 +189,8 @@ public Builder addAllInvoicePresentationDimension(List elements) { } /** - * An internal key you can use to search for a particular billable item. Must be unique among - * billable items. Maximum length of 200 characters. + * An internal key you can use to search for a particular metered item. Must be unique among + * metered items. Maximum length of 200 characters. */ public Builder setLookupKey(String lookupKey) { this.lookupKey = lookupKey; diff --git a/src/main/java/com/stripe/param/v2/billing/MeteredItemUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/MeteredItemUpdateParams.java index 29fa0ba96cc..313f2feb53c 100644 --- a/src/main/java/com/stripe/param/v2/billing/MeteredItemUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/MeteredItemUpdateParams.java @@ -28,7 +28,7 @@ public class MeteredItemUpdateParams extends ApiRequestParams { Map extraParams; /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular metered item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ @SerializedName("lookup_key") @@ -144,7 +144,7 @@ public Builder putAllExtraParam(Map map) { } /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular metered item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ public Builder setLookupKey(String lookupKey) { @@ -153,7 +153,7 @@ public Builder setLookupKey(String lookupKey) { } /** - * An internal key you can use to search for a particular billable item. Maximum length of 200 + * An internal key you can use to search for a particular metered item. Maximum length of 200 * characters. To remove the lookup_key from the object, set it to null in the request. */ public Builder setLookupKey(EmptyParam lookupKey) { diff --git a/src/main/java/com/stripe/param/v2/billing/OneTimeItemCreateParams.java b/src/main/java/com/stripe/param/v2/billing/OneTimeItemCreateParams.java index fb8ad764f7c..832518f1e90 100644 --- a/src/main/java/com/stripe/param/v2/billing/OneTimeItemCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/OneTimeItemCreateParams.java @@ -29,7 +29,7 @@ public class OneTimeItemCreateParams extends ApiRequestParams { /** * An internal key you can use to search for a particular one-time item. Must be unique among - * billable items. Maximum length of 200 characters. + * one-time items. Maximum length of 200 characters. */ @SerializedName("lookup_key") String lookupKey; @@ -134,7 +134,7 @@ public Builder putAllExtraParam(Map map) { /** * An internal key you can use to search for a particular one-time item. Must be unique among - * billable items. Maximum length of 200 characters. + * one-time items. Maximum length of 200 characters. */ public Builder setLookupKey(String lookupKey) { this.lookupKey = lookupKey; diff --git a/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionListParams.java b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionListParams.java index 178b4fb135f..26c9095bb24 100644 --- a/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionListParams.java +++ b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionListParams.java @@ -3,7 +3,9 @@ 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; @@ -27,6 +29,13 @@ public class PricingPlanSubscriptionListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Expand to include additional data such as discount_details, billing_cadence_details, or + * pricing_plan_component_details. + */ + @SerializedName("include") + List include; + /** Optionally set the maximum number of results per page. Defaults to 20. */ @SerializedName("limit") Long limit; @@ -39,14 +48,14 @@ public class PricingPlanSubscriptionListParams extends ApiRequestParams { Payer payer; /** - * Filter by PricingPlan ID. Mutually exlcusive with {@code billing_cadence}, {@code payer}, and + * Filter by PricingPlan ID. Mutually exclusive with {@code billing_cadence}, {@code payer}, and * {@code pricing_plan_version}. */ @SerializedName("pricing_plan") String pricingPlan; /** - * Filter by Pricing Plan Version ID. Mutually exlcusive with {@code billing_cadence}, {@code + * Filter by Pricing Plan Version ID. Mutually exclusive with {@code billing_cadence}, {@code * payer}, and {@code pricing_plan}. */ @SerializedName("pricing_plan_version") @@ -59,6 +68,7 @@ public class PricingPlanSubscriptionListParams extends ApiRequestParams { private PricingPlanSubscriptionListParams( String billingCadence, Map extraParams, + List include, Long limit, Payer payer, String pricingPlan, @@ -66,6 +76,7 @@ private PricingPlanSubscriptionListParams( ServicingStatus servicingStatus) { this.billingCadence = billingCadence; this.extraParams = extraParams; + this.include = include; this.limit = limit; this.payer = payer; this.pricingPlan = pricingPlan; @@ -82,6 +93,8 @@ public static class Builder { private Map extraParams; + private List include; + private Long limit; private Payer payer; @@ -97,6 +110,7 @@ public PricingPlanSubscriptionListParams build() { return new PricingPlanSubscriptionListParams( this.billingCadence, this.extraParams, + this.include, this.limit, this.payer, this.pricingPlan, @@ -139,6 +153,32 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionListParams#include} for the field documentation. + */ + public Builder addInclude(PricingPlanSubscriptionListParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionListParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + /** Optionally set the maximum number of results per page. Defaults to 20. */ public Builder setLimit(Long limit) { this.limit = limit; @@ -155,7 +195,7 @@ public Builder setPayer(PricingPlanSubscriptionListParams.Payer payer) { } /** - * Filter by PricingPlan ID. Mutually exlcusive with {@code billing_cadence}, {@code payer}, and + * Filter by PricingPlan ID. Mutually exclusive with {@code billing_cadence}, {@code payer}, and * {@code pricing_plan_version}. */ public Builder setPricingPlan(String pricingPlan) { @@ -164,7 +204,7 @@ public Builder setPricingPlan(String pricingPlan) { } /** - * Filter by Pricing Plan Version ID. Mutually exlcusive with {@code billing_cadence}, {@code + * Filter by Pricing Plan Version ID. Mutually exclusive with {@code billing_cadence}, {@code * payer}, and {@code pricing_plan}. */ public Builder setPricingPlanVersion(String pricingPlanVersion) { @@ -288,6 +328,21 @@ public enum Type implements ApiRequestParams.EnumParam { } } + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("discount_details") + DISCOUNT_DETAILS("discount_details"), + + @SerializedName("pricing_plan_component_details") + PRICING_PLAN_COMPONENT_DETAILS("pricing_plan_component_details"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } + public enum ServicingStatus implements ApiRequestParams.EnumParam { @SerializedName("active") ACTIVE("active"), diff --git a/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRemoveDiscountsParams.java b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRemoveDiscountsParams.java new file mode 100644 index 00000000000..29dbbe83465 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRemoveDiscountsParams.java @@ -0,0 +1,119 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PricingPlanSubscriptionRemoveDiscountsParams 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; + + /** Expand to include additional data such as discount_details. */ + @SerializedName("include") + List include; + + private PricingPlanSubscriptionRemoveDiscountsParams( + Map extraParams, + List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public PricingPlanSubscriptionRemoveDiscountsParams build() { + return new PricingPlanSubscriptionRemoveDiscountsParams(this.extraParams, this.include); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PricingPlanSubscriptionRemoveDiscountsParams#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 PricingPlanSubscriptionRemoveDiscountsParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionRemoveDiscountsParams#include} for the field documentation. + */ + public Builder addInclude(PricingPlanSubscriptionRemoveDiscountsParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionRemoveDiscountsParams#include} for the field documentation. + */ + public Builder addAllInclude( + List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("discount_details") + DISCOUNT_DETAILS("discount_details"), + + @SerializedName("pricing_plan_component_details") + PRICING_PLAN_COMPONENT_DETAILS("pricing_plan_component_details"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRetrieveParams.java b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRetrieveParams.java new file mode 100644 index 00000000000..a22e25a5fb7 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/PricingPlanSubscriptionRetrieveParams.java @@ -0,0 +1,117 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PricingPlanSubscriptionRetrieveParams 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; + + /** Expand to include additional data such as discount_details. */ + @SerializedName("include") + List include; + + private PricingPlanSubscriptionRetrieveParams( + Map extraParams, + List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public PricingPlanSubscriptionRetrieveParams build() { + return new PricingPlanSubscriptionRetrieveParams(this.extraParams, this.include); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PricingPlanSubscriptionRetrieveParams#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 PricingPlanSubscriptionRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionRetrieveParams#include} for the field documentation. + */ + public Builder addInclude(PricingPlanSubscriptionRetrieveParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PricingPlanSubscriptionRetrieveParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("discount_details") + DISCOUNT_DETAILS("discount_details"), + + @SerializedName("pricing_plan_component_details") + PRICING_PLAN_COMPONENT_DETAILS("pricing_plan_component_details"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/RateCardModifyRatesParams.java b/src/main/java/com/stripe/param/v2/billing/RateCardModifyRatesParams.java new file mode 100644 index 00000000000..0e1c1791ab8 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/billing/RateCardModifyRatesParams.java @@ -0,0 +1,1013 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.billing; + +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; +import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; +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 RateCardModifyRatesParams 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; + + /** + * Required. The list of RateCard rates to create or update. Maximum of 100 + * rates. + */ + @SerializedName("rates_to_create") + List ratesToCreate; + + /** Required. The list of RateCard rates to delete. Maximum of 100 rates. */ + @SerializedName("rates_to_delete") + List ratesToDelete; + + private RateCardModifyRatesParams( + Map extraParams, + List ratesToCreate, + List ratesToDelete) { + this.extraParams = extraParams; + this.ratesToCreate = ratesToCreate; + this.ratesToDelete = ratesToDelete; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List ratesToCreate; + + private List ratesToDelete; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams build() { + return new RateCardModifyRatesParams( + this.extraParams, this.ratesToCreate, this.ratesToDelete); + } + + /** + * 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 + * RateCardModifyRatesParams#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 RateCardModifyRatesParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `ratesToCreate` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams#ratesToCreate} for the field documentation. + */ + public Builder addRatesToCreate(RateCardModifyRatesParams.RatesToCreate element) { + if (this.ratesToCreate == null) { + this.ratesToCreate = new ArrayList<>(); + } + this.ratesToCreate.add(element); + return this; + } + + /** + * Add all elements to `ratesToCreate` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams#ratesToCreate} for the field documentation. + */ + public Builder addAllRatesToCreate(List elements) { + if (this.ratesToCreate == null) { + this.ratesToCreate = new ArrayList<>(); + } + this.ratesToCreate.addAll(elements); + return this; + } + + /** + * Add an element to `ratesToDelete` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams#ratesToDelete} for the field documentation. + */ + public Builder addRatesToDelete(RateCardModifyRatesParams.RatesToDelete element) { + if (this.ratesToDelete == null) { + this.ratesToDelete = new ArrayList<>(); + } + this.ratesToDelete.add(element); + return this; + } + + /** + * Add all elements to `ratesToDelete` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams#ratesToDelete} for the field documentation. + */ + public Builder addAllRatesToDelete(List elements) { + if (this.ratesToDelete == null) { + this.ratesToDelete = new ArrayList<>(); + } + this.ratesToDelete.addAll(elements); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RatesToCreate { + /** + * 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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * The Metered Item that this rate binds to. Cannot be set if {@code metered_item_data} is + * provided, and must be set if it isn't. + */ + @SerializedName("metered_item") + String meteredItem; + + /** + * The data to create a metered item that binds to this rate. Cannot be set if {@code + * metered_item} is provided, and must be set if it isn't. + */ + @SerializedName("metered_item_data") + MeteredItemData meteredItemData; + + /** + * Defines whether the tiered price should be graduated or volume-based. In volume-based + * tiering, the maximum quantity within a period determines the per-unit price. In graduated + * tiering, the pricing changes as the quantity grows into new tiers. Can only be set if {@code + * tiers} is set. + */ + @SerializedName("tiering_mode") + TieringMode tieringMode; + + /** Each element represents a pricing tier. Cannot be set if {@code unit_amount} is provided. */ + @SerializedName("tiers") + List tiers; + + /** + * Apply a transformation to the reported usage or set quantity before computing the amount + * billed. + */ + @SerializedName("transform_quantity") + TransformQuantity transformQuantity; + + /** + * The per-unit amount to be charged, represented as a decimal string in minor currency units + * with at most 12 decimal places. Cannot be set if {@code tiers} is provided. + */ + @SerializedName("unit_amount") + String unitAmount; + + private RatesToCreate( + Map extraParams, + Map metadata, + String meteredItem, + MeteredItemData meteredItemData, + TieringMode tieringMode, + List tiers, + TransformQuantity transformQuantity, + String unitAmount) { + this.extraParams = extraParams; + this.metadata = metadata; + this.meteredItem = meteredItem; + this.meteredItemData = meteredItemData; + this.tieringMode = tieringMode; + this.tiers = tiers; + this.transformQuantity = transformQuantity; + this.unitAmount = unitAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Map metadata; + + private String meteredItem; + + private MeteredItemData meteredItemData; + + private TieringMode tieringMode; + + private List tiers; + + private TransformQuantity transformQuantity; + + private String unitAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate build() { + return new RateCardModifyRatesParams.RatesToCreate( + this.extraParams, + this.metadata, + this.meteredItem, + this.meteredItemData, + this.tieringMode, + this.tiers, + this.transformQuantity, + this.unitAmount); + } + + /** + * 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 + * RateCardModifyRatesParams.RatesToCreate#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 RateCardModifyRatesParams.RatesToCreate#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 + * RateCardModifyRatesParams.RatesToCreate#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 RateCardModifyRatesParams.RatesToCreate#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 Metered Item that this rate binds to. Cannot be set if {@code metered_item_data} is + * provided, and must be set if it isn't. + */ + public Builder setMeteredItem(String meteredItem) { + this.meteredItem = meteredItem; + return this; + } + + /** + * The data to create a metered item that binds to this rate. Cannot be set if {@code + * metered_item} is provided, and must be set if it isn't. + */ + public Builder setMeteredItemData( + RateCardModifyRatesParams.RatesToCreate.MeteredItemData meteredItemData) { + this.meteredItemData = meteredItemData; + return this; + } + + /** + * Defines whether the tiered price should be graduated or volume-based. In volume-based + * tiering, the maximum quantity within a period determines the per-unit price. In graduated + * tiering, the pricing changes as the quantity grows into new tiers. Can only be set if + * {@code tiers} is set. + */ + public Builder setTieringMode( + RateCardModifyRatesParams.RatesToCreate.TieringMode tieringMode) { + this.tieringMode = tieringMode; + return this; + } + + /** + * Add an element to `tiers` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams.RatesToCreate#tiers} for the field documentation. + */ + public Builder addTier(RateCardModifyRatesParams.RatesToCreate.Tier element) { + if (this.tiers == null) { + this.tiers = new ArrayList<>(); + } + this.tiers.add(element); + return this; + } + + /** + * Add all elements to `tiers` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * RateCardModifyRatesParams.RatesToCreate#tiers} for the field documentation. + */ + public Builder addAllTier(List elements) { + if (this.tiers == null) { + this.tiers = new ArrayList<>(); + } + this.tiers.addAll(elements); + return this; + } + + /** + * Apply a transformation to the reported usage or set quantity before computing the amount + * billed. + */ + public Builder setTransformQuantity( + RateCardModifyRatesParams.RatesToCreate.TransformQuantity transformQuantity) { + this.transformQuantity = transformQuantity; + return this; + } + + /** + * The per-unit amount to be charged, represented as a decimal string in minor currency units + * with at most 12 decimal places. Cannot be set if {@code tiers} is provided. + */ + public Builder setUnitAmount(String unitAmount) { + this.unitAmount = unitAmount; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MeteredItemData { + /** + * Required. Description that customers will see in the invoice line item. + * Maximum length of 250 characters. + */ + @SerializedName("display_name") + String displayName; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * An internal key you can use to search for a particular metered item. Must be unique among + * metered items. Maximum length of 200 characters. + */ + @SerializedName("lookup_key") + String lookupKey; + + /** Required. ID of the Meter that measures usage for this Metered Item. */ + @SerializedName("meter") + String meter; + + /** + * Required. Optional array of Meter segments to filter event dimension keys + * for billing. + */ + @SerializedName("meter_segment_conditions") + List + meterSegmentConditions; + + /** + * The unit to use when displaying prices for this billable item in places like Checkout. For + * example, set this field to "CPU-hour" for Checkout to display "(price) per + * CPU-hour", or "1 million events" to display "(price) per 1 million + * events". Maximum length of 100 characters. + */ + @SerializedName("unit_label") + String unitLabel; + + private MeteredItemData( + String displayName, + Map extraParams, + String lookupKey, + String meter, + List + meterSegmentConditions, + String unitLabel) { + this.displayName = displayName; + this.extraParams = extraParams; + this.lookupKey = lookupKey; + this.meter = meter; + this.meterSegmentConditions = meterSegmentConditions; + this.unitLabel = unitLabel; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String displayName; + + private Map extraParams; + + private String lookupKey; + + private String meter; + + private List + meterSegmentConditions; + + private String unitLabel; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate.MeteredItemData build() { + return new RateCardModifyRatesParams.RatesToCreate.MeteredItemData( + this.displayName, + this.extraParams, + this.lookupKey, + this.meter, + this.meterSegmentConditions, + this.unitLabel); + } + + /** + * Required. Description that customers will see in the invoice line item. + * Maximum length of 250 characters. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RateCardModifyRatesParams.RatesToCreate.MeteredItemData#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 RateCardModifyRatesParams.RatesToCreate.MeteredItemData#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * An internal key you can use to search for a particular metered item. Must be unique among + * metered items. Maximum length of 200 characters. + */ + public Builder setLookupKey(String lookupKey) { + this.lookupKey = lookupKey; + return this; + } + + /** Required. ID of the Meter that measures usage for this Metered Item. */ + public Builder setMeter(String meter) { + this.meter = meter; + return this; + } + + /** + * Add an element to `meterSegmentConditions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link + * RateCardModifyRatesParams.RatesToCreate.MeteredItemData#meterSegmentConditions} for the + * field documentation. + */ + public Builder addMeterSegmentCondition( + RateCardModifyRatesParams.RatesToCreate.MeteredItemData.MeterSegmentCondition element) { + if (this.meterSegmentConditions == null) { + this.meterSegmentConditions = new ArrayList<>(); + } + this.meterSegmentConditions.add(element); + return this; + } + + /** + * Add all elements to `meterSegmentConditions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link + * RateCardModifyRatesParams.RatesToCreate.MeteredItemData#meterSegmentConditions} for the + * field documentation. + */ + public Builder addAllMeterSegmentCondition( + List + elements) { + if (this.meterSegmentConditions == null) { + this.meterSegmentConditions = new ArrayList<>(); + } + this.meterSegmentConditions.addAll(elements); + return this; + } + + /** + * The unit to use when displaying prices for this billable item in places like Checkout. + * For example, set this field to "CPU-hour" for Checkout to display "(price) + * per CPU-hour", or "1 million events" to display "(price) per 1 + * million events". Maximum length of 100 characters. + */ + public Builder setUnitLabel(String unitLabel) { + this.unitLabel = unitLabel; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MeterSegmentCondition { + /** Required. A Meter dimension. */ + @SerializedName("dimension") + String dimension; + + /** + * 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 count usage towards this metered item, the dimension must + * have this value. + */ + @SerializedName("value") + String value; + + private MeterSegmentCondition( + String dimension, Map extraParams, String value) { + this.dimension = dimension; + this.extraParams = extraParams; + this.value = value; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String dimension; + + private Map extraParams; + + private String value; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate.MeteredItemData.MeterSegmentCondition + build() { + return new RateCardModifyRatesParams.RatesToCreate.MeteredItemData + .MeterSegmentCondition(this.dimension, this.extraParams, this.value); + } + + /** Required. A Meter dimension. */ + public Builder setDimension(String dimension) { + this.dimension = dimension; + 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 + * RateCardModifyRatesParams.RatesToCreate.MeteredItemData.MeterSegmentCondition#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 + * RateCardModifyRatesParams.RatesToCreate.MeteredItemData.MeterSegmentCondition#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 count usage towards this metered item, the dimension must + * have this value. + */ + public Builder setValue(String value) { + this.value = value; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tier { + /** + * 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; + + /** + * Price for the entire tier, represented as a decimal string in minor currency units with at + * most 12 decimal places. + */ + @SerializedName("flat_amount") + String flatAmount; + + /** + * Per-unit price for units included in this tier, represented as a decimal string in minor + * currency units with at most 12 decimal places. + */ + @SerializedName("unit_amount") + String unitAmount; + + /** + * Up to and including this quantity will be contained in the tier. Only one of {@code + * up_to_decimal} and {@code up_to_inf} may be set. + */ + @SerializedName("up_to_decimal") + BigDecimal upToDecimal; + + /** + * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may be + * set. + */ + @SerializedName("up_to_inf") + UpToInf upToInf; + + private Tier( + Map extraParams, + String flatAmount, + String unitAmount, + BigDecimal upToDecimal, + UpToInf upToInf) { + this.extraParams = extraParams; + this.flatAmount = flatAmount; + this.unitAmount = unitAmount; + this.upToDecimal = upToDecimal; + this.upToInf = upToInf; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String flatAmount; + + private String unitAmount; + + private BigDecimal upToDecimal; + + private UpToInf upToInf; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate.Tier build() { + return new RateCardModifyRatesParams.RatesToCreate.Tier( + this.extraParams, this.flatAmount, this.unitAmount, this.upToDecimal, this.upToInf); + } + + /** + * 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 RateCardModifyRatesParams.RatesToCreate.Tier#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 RateCardModifyRatesParams.RatesToCreate.Tier#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Price for the entire tier, represented as a decimal string in minor currency units with + * at most 12 decimal places. + */ + public Builder setFlatAmount(String flatAmount) { + this.flatAmount = flatAmount; + return this; + } + + /** + * Per-unit price for units included in this tier, represented as a decimal string in minor + * currency units with at most 12 decimal places. + */ + public Builder setUnitAmount(String unitAmount) { + this.unitAmount = unitAmount; + return this; + } + + /** + * Up to and including this quantity will be contained in the tier. Only one of {@code + * up_to_decimal} and {@code up_to_inf} may be set. + */ + public Builder setUpToDecimal(BigDecimal upToDecimal) { + this.upToDecimal = upToDecimal; + return this; + } + + /** + * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may + * be set. + */ + public Builder setUpToInf(RateCardModifyRatesParams.RatesToCreate.Tier.UpToInf upToInf) { + this.upToInf = upToInf; + return this; + } + } + + public enum UpToInf implements ApiRequestParams.EnumParam { + @SerializedName("inf") + INF("inf"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + UpToInf(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TransformQuantity { + /** Required. Divide usage by this number. */ + @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) + Long divideBy; + + /** + * 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. After division, round the result up or down. */ + @SerializedName("round") + Round round; + + private TransformQuantity(Long divideBy, Map extraParams, Round round) { + this.divideBy = divideBy; + this.extraParams = extraParams; + this.round = round; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long divideBy; + + private Map extraParams; + + private Round round; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToCreate.TransformQuantity build() { + return new RateCardModifyRatesParams.RatesToCreate.TransformQuantity( + this.divideBy, this.extraParams, this.round); + } + + /** Required. Divide usage by this number. */ + public Builder setDivideBy(Long divideBy) { + this.divideBy = divideBy; + 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 RateCardModifyRatesParams.RatesToCreate.TransformQuantity#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 RateCardModifyRatesParams.RatesToCreate.TransformQuantity#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. After division, round the result up or down. */ + public Builder setRound( + RateCardModifyRatesParams.RatesToCreate.TransformQuantity.Round round) { + this.round = round; + return this; + } + } + + public enum Round implements ApiRequestParams.EnumParam { + @SerializedName("down") + DOWN("down"), + + @SerializedName("up") + UP("up"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Round(String value) { + this.value = value; + } + } + } + + public enum TieringMode implements ApiRequestParams.EnumParam { + @SerializedName("graduated") + GRADUATED("graduated"), + + @SerializedName("volume") + VOLUME("volume"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TieringMode(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RatesToDelete { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The ID of the RateCard rate to delete. */ + @SerializedName("id") + String id; + + private RatesToDelete(Map extraParams, String id) { + this.extraParams = extraParams; + this.id = id; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String id; + + /** Finalize and obtain parameter instance from this builder. */ + public RateCardModifyRatesParams.RatesToDelete build() { + return new RateCardModifyRatesParams.RatesToDelete(this.extraParams, this.id); + } + + /** + * 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 + * RateCardModifyRatesParams.RatesToDelete#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 RateCardModifyRatesParams.RatesToDelete#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The ID of the RateCard rate to delete. */ + public Builder setId(String id) { + this.id = id; + return this; + } + } + } +} diff --git a/src/main/java/com/stripe/param/v2/billing/RateCardSubscriptionListParams.java b/src/main/java/com/stripe/param/v2/billing/RateCardSubscriptionListParams.java index 3e6def0f721..a43c51bdf54 100644 --- a/src/main/java/com/stripe/param/v2/billing/RateCardSubscriptionListParams.java +++ b/src/main/java/com/stripe/param/v2/billing/RateCardSubscriptionListParams.java @@ -27,7 +27,7 @@ public class RateCardSubscriptionListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The page size limit, if not provided the default is 20. */ + /** The page size limit. Defaults to 20. */ @SerializedName("limit") Long limit; @@ -140,7 +140,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The page size limit, if not provided the default is 20. */ + /** The page size limit. Defaults to 20. */ public Builder setLimit(Long limit) { this.limit = limit; return this; diff --git a/src/main/java/com/stripe/param/v2/billing/pricingplans/ComponentCreateParams.java b/src/main/java/com/stripe/param/v2/billing/pricingplans/ComponentCreateParams.java index 66f1f0f786d..6594e61eb5b 100644 --- a/src/main/java/com/stripe/param/v2/billing/pricingplans/ComponentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/pricingplans/ComponentCreateParams.java @@ -195,7 +195,7 @@ public static class LicenseFee { @SerializedName("id") String id; - /** The version of the LicenseFee. Defaults to 'latest', if not specified. */ + /** The ID of the License Fee Version. If not specified, defaults to 'latest'. */ @SerializedName("version") String version; @@ -253,7 +253,7 @@ public Builder setId(String id) { return this; } - /** The version of the LicenseFee. Defaults to 'latest', if not specified. */ + /** The ID of the License Fee Version. If not specified, defaults to 'latest'. */ public Builder setVersion(String version) { this.version = version; return this; @@ -277,7 +277,7 @@ public static class RateCard { @SerializedName("id") String id; - /** The version of the RateCard. Defaults to 'latest', if not specified. */ + /** The ID of the Rate Card Version. If not specified, defaults to 'latest'. */ @SerializedName("version") String version; @@ -335,7 +335,7 @@ public Builder setId(String id) { return this; } - /** The version of the RateCard. Defaults to 'latest', if not specified. */ + /** The ID of the Rate Card Version. If not specified, defaults to 'latest'. */ public Builder setVersion(String version) { this.version = version; return this; diff --git a/src/main/java/com/stripe/param/v2/billing/ratecards/RateCreateParams.java b/src/main/java/com/stripe/param/v2/billing/ratecards/RateCreateParams.java index df85b03f099..e9286bce9c8 100644 --- a/src/main/java/com/stripe/param/v2/billing/ratecards/RateCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/ratecards/RateCreateParams.java @@ -1,8 +1,11 @@ // File generated from our OpenAPI spec package com.stripe.param.v2.billing.ratecards; +import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; +import com.stripe.model.StringInt64TypeAdapter; import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -364,7 +367,7 @@ public static class Tier { * up_to_decimal} and {@code up_to_inf} may be set. */ @SerializedName("up_to_decimal") - String upToDecimal; + BigDecimal upToDecimal; /** * No upper bound to this tier. Only one of {@code up_to_decimal} and {@code up_to_inf} may be @@ -377,7 +380,7 @@ private Tier( Map extraParams, String flatAmount, String unitAmount, - String upToDecimal, + BigDecimal upToDecimal, UpToInf upToInf) { this.extraParams = extraParams; this.flatAmount = flatAmount; @@ -397,7 +400,7 @@ public static class Builder { private String unitAmount; - private String upToDecimal; + private BigDecimal upToDecimal; private UpToInf upToInf; @@ -455,7 +458,7 @@ public Builder setUnitAmount(String unitAmount) { * Up to and including this quantity will be contained in the tier. Only one of {@code * up_to_decimal} and {@code up_to_inf} may be set. */ - public Builder setUpToDecimal(String upToDecimal) { + public Builder setUpToDecimal(BigDecimal upToDecimal) { this.upToDecimal = upToDecimal; return this; } @@ -488,6 +491,7 @@ public enum UpToInf implements ApiRequestParams.EnumParam { public static class TransformQuantity { /** Required. Divide usage by this number. */ @SerializedName("divide_by") + @JsonAdapter(StringInt64TypeAdapter.class) Long divideBy; /** 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 698cbe234e6..c8f28ae8c5a 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java @@ -3,6 +3,8 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -13583,17 +13585,26 @@ public static class Defaults { @SerializedName("responsibilities") Responsibilities responsibilities; + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + @SerializedName("timezone") + String timezone; + private Defaults( String currency, Map extraParams, List locales, Profile profile, - Responsibilities responsibilities) { + Responsibilities responsibilities, + String timezone) { this.currency = currency; this.extraParams = extraParams; this.locales = locales; this.profile = profile; this.responsibilities = responsibilities; + this.timezone = timezone; } public static Builder builder() { @@ -13611,10 +13622,17 @@ public static class Builder { private Responsibilities responsibilities; + private String timezone; + /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Defaults build() { return new AccountCreateParams.Defaults( - this.currency, this.extraParams, this.locales, this.profile, this.responsibilities); + this.currency, + this.extraParams, + this.locales, + this.profile, + this.responsibilities, + this.timezone); } /** @@ -13691,6 +13709,15 @@ public Builder setResponsibilities( this.responsibilities = responsibilities; return this; } + + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + public Builder setTimezone(String timezone) { + this.timezone = timezone; + return this; + } } @Getter @@ -23002,8 +23029,7 @@ public AccountCreateParams.Identity.BusinessDetails.AnnualRevenue build() { } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -23045,112 +23071,6 @@ public Builder setFiscalYearEnd(String fiscalYearEnd) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount build() { - return new AccountCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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.BusinessDetails.AnnualRevenue.Amount#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.BusinessDetails.AnnualRevenue.Amount#extraParams} for - * the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -25365,8 +25285,7 @@ public AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue buil } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -25401,113 +25320,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - build() { - return new AccountCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue - .Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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.BusinessDetails.MonthlyEstimatedRevenue.Amount#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.BusinessDetails.MonthlyEstimatedRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -28819,7 +28631,7 @@ public static class Relationship { /** The percent owned by the person of the account's legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** The person's title (e.g., CEO, Support Engineer). */ @SerializedName("title") @@ -28830,7 +28642,7 @@ private Relationship( Boolean executive, Map extraParams, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, String title) { this.director = director; this.executive = executive; @@ -28853,7 +28665,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private String title; @@ -28922,7 +28734,7 @@ public Builder setOwner(Boolean owner) { } /** The percent owned by the person of the account's legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/AccountEvaluationCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountEvaluationCreateParams.java new file mode 100644 index 00000000000..60026c95e24 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/AccountEvaluationCreateParams.java @@ -0,0 +1,557 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core; + +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 AccountEvaluationCreateParams extends ApiRequestParams { + /** The account ID to evaluate. Exactly one of account or account_data must be provided. */ + @SerializedName("account") + String account; + + /** + * Account data for entity-less evaluation. Exactly one of account or account_data must be + * provided. + */ + @SerializedName("account_data") + AccountData accountData; + + /** + * 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. List of signals to evaluate. */ + @SerializedName("signals") + List signals; + + private AccountEvaluationCreateParams( + String account, + AccountData accountData, + Map extraParams, + List signals) { + this.account = account; + this.accountData = accountData; + this.extraParams = extraParams; + this.signals = signals; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String account; + + private AccountData accountData; + + private Map extraParams; + + private List signals; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams build() { + return new AccountEvaluationCreateParams( + this.account, this.accountData, this.extraParams, this.signals); + } + + /** The account ID to evaluate. Exactly one of account or account_data must be provided. */ + public Builder setAccount(String account) { + this.account = account; + return this; + } + + /** + * Account data for entity-less evaluation. Exactly one of account or account_data must be + * provided. + */ + public Builder setAccountData(AccountEvaluationCreateParams.AccountData accountData) { + this.accountData = accountData; + 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 + * AccountEvaluationCreateParams#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 AccountEvaluationCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `signals` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * AccountEvaluationCreateParams#signals} for the field documentation. + */ + public Builder addSignal(AccountEvaluationCreateParams.Signal element) { + if (this.signals == null) { + this.signals = new ArrayList<>(); + } + this.signals.add(element); + return this; + } + + /** + * Add all elements to `signals` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * AccountEvaluationCreateParams#signals} for the field documentation. + */ + public Builder addAllSignal(List elements) { + if (this.signals == null) { + this.signals = new ArrayList<>(); + } + this.signals.addAll(elements); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AccountData { + /** Default account settings. */ + @SerializedName("defaults") + Defaults defaults; + + /** + * 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; + + /** Identity data. */ + @SerializedName("identity") + Identity identity; + + private AccountData(Defaults defaults, Map extraParams, Identity identity) { + this.defaults = defaults; + this.extraParams = extraParams; + this.identity = identity; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Defaults defaults; + + private Map extraParams; + + private Identity identity; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData build() { + return new AccountEvaluationCreateParams.AccountData( + this.defaults, this.extraParams, this.identity); + } + + /** Default account settings. */ + public Builder setDefaults(AccountEvaluationCreateParams.AccountData.Defaults defaults) { + this.defaults = defaults; + 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 + * AccountEvaluationCreateParams.AccountData#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 AccountEvaluationCreateParams.AccountData#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Identity data. */ + public Builder setIdentity(AccountEvaluationCreateParams.AccountData.Identity identity) { + this.identity = identity; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Defaults { + /** + * 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. Account profile data. */ + @SerializedName("profile") + Profile profile; + + private Defaults(Map extraParams, Profile profile) { + this.extraParams = extraParams; + this.profile = profile; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Profile profile; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData.Defaults build() { + return new AccountEvaluationCreateParams.AccountData.Defaults( + this.extraParams, this.profile); + } + + /** + * 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 AccountEvaluationCreateParams.AccountData.Defaults#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 AccountEvaluationCreateParams.AccountData.Defaults#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. Account profile data. */ + public Builder setProfile( + AccountEvaluationCreateParams.AccountData.Defaults.Profile profile) { + this.profile = profile; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Profile { + /** Required. The business URL. */ + @SerializedName("business_url") + String businessUrl; + + /** Doing business as (DBA) name. */ + @SerializedName("doing_business_as") + String doingBusinessAs; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Description of the account's product or service. */ + @SerializedName("product_description") + String productDescription; + + private Profile( + String businessUrl, + String doingBusinessAs, + Map extraParams, + String productDescription) { + this.businessUrl = businessUrl; + this.doingBusinessAs = doingBusinessAs; + this.extraParams = extraParams; + this.productDescription = productDescription; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String businessUrl; + + private String doingBusinessAs; + + private Map extraParams; + + private String productDescription; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData.Defaults.Profile build() { + return new AccountEvaluationCreateParams.AccountData.Defaults.Profile( + this.businessUrl, this.doingBusinessAs, this.extraParams, this.productDescription); + } + + /** Required. The business URL. */ + public Builder setBusinessUrl(String businessUrl) { + this.businessUrl = businessUrl; + return this; + } + + /** Doing business as (DBA) name. */ + public Builder setDoingBusinessAs(String doingBusinessAs) { + this.doingBusinessAs = doingBusinessAs; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountEvaluationCreateParams.AccountData.Defaults.Profile#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountEvaluationCreateParams.AccountData.Defaults.Profile#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Description of the account's product or service. */ + public Builder setProductDescription(String productDescription) { + this.productDescription = productDescription; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Identity { + /** Required. Business details for identity data. */ + @SerializedName("business_details") + BusinessDetails businessDetails; + + /** + * 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 Identity(BusinessDetails businessDetails, Map extraParams) { + this.businessDetails = businessDetails; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BusinessDetails businessDetails; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData.Identity build() { + return new AccountEvaluationCreateParams.AccountData.Identity( + this.businessDetails, this.extraParams); + } + + /** Required. Business details for identity data. */ + public Builder setBusinessDetails( + AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails businessDetails) { + this.businessDetails = businessDetails; + 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 AccountEvaluationCreateParams.AccountData.Identity#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 AccountEvaluationCreateParams.AccountData.Identity#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 BusinessDetails { + /** + * 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; + + /** Registered business name. */ + @SerializedName("registered_name") + String registeredName; + + private BusinessDetails(Map extraParams, String registeredName) { + this.extraParams = extraParams; + this.registeredName = registeredName; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String registeredName; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails build() { + return new AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails( + this.extraParams, this.registeredName); + } + + /** + * 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 + * AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails#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 + * AccountEvaluationCreateParams.AccountData.Identity.BusinessDetails#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Registered business name. */ + public Builder setRegisteredName(String registeredName) { + this.registeredName = registeredName; + return this; + } + } + } + } + } + + public enum Signal implements ApiRequestParams.EnumParam { + @SerializedName("fraudulent_website") + FRAUDULENT_WEBSITE("fraudulent_website"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Signal(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java index 9485d08657b..ee37187eb92 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountTokenCreateParams.java @@ -4,6 +4,8 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -3690,8 +3692,7 @@ public AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue build() { } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -3735,112 +3736,6 @@ public Builder setFiscalYearEnd(String fiscalYearEnd) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount build() { - return new AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#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 - * AccountTokenCreateParams.Identity.BusinessDetails.AnnualRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -6068,9 +5963,7 @@ public AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -6105,113 +5998,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - build() { - return new AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue - .Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#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 - * AccountTokenCreateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -9556,7 +9342,7 @@ public static class Relationship { /** The percent owned by the person of the account's legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** The person's title (e.g., CEO, Support Engineer). */ @SerializedName("title") @@ -9567,7 +9353,7 @@ private Relationship( Boolean executive, Map extraParams, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, String title) { this.director = director; this.executive = executive; @@ -9590,7 +9376,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private String title; @@ -9659,7 +9445,7 @@ public Builder setOwner(Boolean owner) { } /** The percent owned by the person of the account's legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } 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 b6cd8950893..6d17da5fb8d 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java @@ -4,6 +4,8 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import com.stripe.v2.Amount; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -14237,17 +14239,26 @@ public static class Defaults { @SerializedName("responsibilities") Responsibilities responsibilities; + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + @SerializedName("timezone") + Object timezone; + private Defaults( Object currency, Map extraParams, List locales, Profile profile, - Responsibilities responsibilities) { + Responsibilities responsibilities, + Object timezone) { this.currency = currency; this.extraParams = extraParams; this.locales = locales; this.profile = profile; this.responsibilities = responsibilities; + this.timezone = timezone; } public static Builder builder() { @@ -14265,10 +14276,17 @@ public static class Builder { private Responsibilities responsibilities; + private Object timezone; + /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Defaults build() { return new AccountUpdateParams.Defaults( - this.currency, this.extraParams, this.locales, this.profile, this.responsibilities); + this.currency, + this.extraParams, + this.locales, + this.profile, + this.responsibilities, + this.timezone); } /** @@ -14355,6 +14373,24 @@ public Builder setResponsibilities( this.responsibilities = responsibilities; return this; } + + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + public Builder setTimezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * The Account's local timezone. A list of possible time zone values is maintained at the IANA Time Zone Database. + */ + public Builder setTimezone(EmptyParam timezone) { + this.timezone = timezone; + return this; + } } @Getter @@ -24480,8 +24516,7 @@ public AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue build() { } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -24532,123 +24567,6 @@ public Builder setFiscalYearEnd(EmptyParam fiscalYearEnd) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - Object currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(Object currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Object currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount build() { - return new AccountUpdateParams.Identity.BusinessDetails.AnnualRevenue.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(EmptyParam currency) { - this.currency = currency; - 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.BusinessDetails.AnnualRevenue.Amount#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.BusinessDetails.AnnualRevenue.Amount#extraParams} for - * the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -26898,8 +26816,7 @@ public AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue buil } /** A non-negative integer representing the amount in the smallest currency unit. */ - public Builder setAmount( - AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -26934,124 +26851,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - @SerializedName("currency") - Object currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field - * (serialized) name in this param object. Effectively, this map is flattened to its - * parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - @SerializedName("value") - Long value; - - private Amount(Object currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Object currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue.Amount - build() { - return new AccountUpdateParams.Identity.BusinessDetails.MonthlyEstimatedRevenue - .Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported - * currency. - */ - public Builder setCurrency(EmptyParam currency) { - this.currency = currency; - 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.BusinessDetails.MonthlyEstimatedRevenue.Amount#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.BusinessDetails.MonthlyEstimatedRevenue.Amount#extraParams} - * for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in - * the smallest currency - * unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -30770,7 +30569,7 @@ public Builder setOwner(Boolean owner) { } /** The percent owned by the person of the account's legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java b/src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java new file mode 100644 index 00000000000..34c67d543af --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/BatchJobCreateParams.java @@ -0,0 +1,356 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core; + +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 BatchJobCreateParams extends ApiRequestParams { + /** Required. The endpoint configuration for the batch job. */ + @SerializedName("endpoint") + Endpoint endpoint; + + /** + * 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; + + /** + * Optional field that allows the user to control how fast they want this batch job to run. Gives + * them a control over the number of webhooks they receive. + */ + @SerializedName("maximum_rps") + Long maximumRps; + + /** Required. The metadata of the {@code BatchJob} object. */ + @SerializedName("metadata") + Map metadata; + + /** Notification suppression settings for the batch job. */ + @SerializedName("notification_suppression") + NotificationSuppression notificationSuppression; + + /** Required. Allows the user to skip validation. */ + @SerializedName("skip_validation") + Boolean skipValidation; + + private BatchJobCreateParams( + Endpoint endpoint, + Map extraParams, + Long maximumRps, + Map metadata, + NotificationSuppression notificationSuppression, + Boolean skipValidation) { + this.endpoint = endpoint; + this.extraParams = extraParams; + this.maximumRps = maximumRps; + this.metadata = metadata; + this.notificationSuppression = notificationSuppression; + this.skipValidation = skipValidation; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Endpoint endpoint; + + private Map extraParams; + + private Long maximumRps; + + private Map metadata; + + private NotificationSuppression notificationSuppression; + + private Boolean skipValidation; + + /** Finalize and obtain parameter instance from this builder. */ + public BatchJobCreateParams build() { + return new BatchJobCreateParams( + this.endpoint, + this.extraParams, + this.maximumRps, + this.metadata, + this.notificationSuppression, + this.skipValidation); + } + + /** Required. The endpoint configuration for the batch job. */ + public Builder setEndpoint(BatchJobCreateParams.Endpoint endpoint) { + this.endpoint = endpoint; + 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 + * BatchJobCreateParams#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 BatchJobCreateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Optional field that allows the user to control how fast they want this batch job to run. + * Gives them a control over the number of webhooks they receive. + */ + public Builder setMaximumRps(Long maximumRps) { + this.maximumRps = maximumRps; + 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 + * BatchJobCreateParams#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 BatchJobCreateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** Notification suppression settings for the batch job. */ + public Builder setNotificationSuppression( + BatchJobCreateParams.NotificationSuppression notificationSuppression) { + this.notificationSuppression = notificationSuppression; + return this; + } + + /** Required. Allows the user to skip validation. */ + public Builder setSkipValidation(Boolean skipValidation) { + this.skipValidation = skipValidation; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Endpoint { + /** + * 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 HTTP method to use when calling the endpoint. */ + @SerializedName("http_method") + HttpMethod httpMethod; + + /** + * Required. The path of the endpoint to run this batch job against. In the + * form used in the documentation. For instance, for subscription migration this would be {@code + * /v1/subscriptions/:id/migrate}. + */ + @SerializedName("path") + String path; + + private Endpoint(Map extraParams, HttpMethod httpMethod, String path) { + this.extraParams = extraParams; + this.httpMethod = httpMethod; + this.path = path; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private HttpMethod httpMethod; + + private String path; + + /** Finalize and obtain parameter instance from this builder. */ + public BatchJobCreateParams.Endpoint build() { + return new BatchJobCreateParams.Endpoint(this.extraParams, this.httpMethod, this.path); + } + + /** + * 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 + * BatchJobCreateParams.Endpoint#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 BatchJobCreateParams.Endpoint#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 HTTP method to use when calling the endpoint. */ + public Builder setHttpMethod(BatchJobCreateParams.Endpoint.HttpMethod httpMethod) { + this.httpMethod = httpMethod; + return this; + } + + /** + * Required. The path of the endpoint to run this batch job against. In the + * form used in the documentation. For instance, for subscription migration this would be + * {@code /v1/subscriptions/:id/migrate}. + */ + public Builder setPath(String path) { + this.path = path; + return this; + } + } + + public enum HttpMethod implements ApiRequestParams.EnumParam { + @SerializedName("post") + POST("post"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + HttpMethod(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NotificationSuppression { + /** + * 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 scope of notification suppression. */ + @SerializedName("scope") + Scope scope; + + private NotificationSuppression(Map extraParams, Scope scope) { + this.extraParams = extraParams; + this.scope = scope; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Scope scope; + + /** Finalize and obtain parameter instance from this builder. */ + public BatchJobCreateParams.NotificationSuppression build() { + return new BatchJobCreateParams.NotificationSuppression(this.extraParams, this.scope); + } + + /** + * 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 + * BatchJobCreateParams.NotificationSuppression#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 BatchJobCreateParams.NotificationSuppression#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 scope of notification suppression. */ + public Builder setScope(BatchJobCreateParams.NotificationSuppression.Scope scope) { + this.scope = scope; + return this; + } + } + + public enum Scope implements ApiRequestParams.EnumParam { + @SerializedName("all") + ALL("all"), + + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Scope(String value) { + this.value = value; + } + } + } +} diff --git a/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java b/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java index 946287f6e15..ac0f1c63ee2 100644 --- a/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/EventDestinationCreateParams.java @@ -17,6 +17,10 @@ public class EventDestinationCreateParams extends ApiRequestParams { @SerializedName("amazon_eventbridge") AmazonEventbridge amazonEventbridge; + /** Azure Event Grid configuration. */ + @SerializedName("azure_event_grid") + AzureEventGrid azureEventGrid; + /** An optional description of what the event destination is used for. */ @SerializedName("description") String description; @@ -29,9 +33,16 @@ public class EventDestinationCreateParams extends ApiRequestParams { @SerializedName("event_payload") EventPayload eventPayload; - /** Where events should be routed from. */ + /** + * Specifies which accounts' events route to this destination. {@code @self}: Receive events from + * the account that owns the event destination. {@code @accounts}: Receive events emitted from + * other accounts you manage which includes your v1 and v2 accounts. + * {@code @organization_members}: Receive events from accounts directly linked to the + * organization. {@code @organization_members/@accounts}: Receive events from all accounts + * connected to any platform accounts in the organization. + */ @SerializedName("events_from") - List eventsFrom; + List eventsFrom; /** * Map of extra parameters for custom features not available in this client library. The content @@ -68,10 +79,11 @@ public class EventDestinationCreateParams extends ApiRequestParams { private EventDestinationCreateParams( AmazonEventbridge amazonEventbridge, + AzureEventGrid azureEventGrid, String description, List enabledEvents, EventPayload eventPayload, - List eventsFrom, + List eventsFrom, Map extraParams, List include, Map metadata, @@ -80,6 +92,7 @@ private EventDestinationCreateParams( Type type, WebhookEndpoint webhookEndpoint) { this.amazonEventbridge = amazonEventbridge; + this.azureEventGrid = azureEventGrid; this.description = description; this.enabledEvents = enabledEvents; this.eventPayload = eventPayload; @@ -100,13 +113,15 @@ public static Builder builder() { public static class Builder { private AmazonEventbridge amazonEventbridge; + private AzureEventGrid azureEventGrid; + private String description; private List enabledEvents; private EventPayload eventPayload; - private List eventsFrom; + private List eventsFrom; private Map extraParams; @@ -126,6 +141,7 @@ public static class Builder { public EventDestinationCreateParams build() { return new EventDestinationCreateParams( this.amazonEventbridge, + this.azureEventGrid, this.description, this.enabledEvents, this.eventPayload, @@ -146,6 +162,12 @@ public Builder setAmazonEventbridge( return this; } + /** Azure Event Grid configuration. */ + public Builder setAzureEventGrid(EventDestinationCreateParams.AzureEventGrid azureEventGrid) { + this.azureEventGrid = azureEventGrid; + return this; + } + /** An optional description of what the event destination is used for. */ public Builder setDescription(String description) { this.description = description; @@ -189,7 +211,7 @@ public Builder setEventPayload(EventDestinationCreateParams.EventPayload eventPa * and subsequent calls adds additional elements to the original list. See {@link * EventDestinationCreateParams#eventsFrom} for the field documentation. */ - public Builder addEventsFrom(EventDestinationCreateParams.EventsFrom element) { + public Builder addEventsFrom(String element) { if (this.eventsFrom == null) { this.eventsFrom = new ArrayList<>(); } @@ -202,7 +224,7 @@ public Builder addEventsFrom(EventDestinationCreateParams.EventsFrom element) { * and subsequent calls adds additional elements to the original list. See {@link * EventDestinationCreateParams#eventsFrom} for the field documentation. */ - public Builder addAllEventsFrom(List elements) { + public Builder addAllEventsFrom(List elements) { if (this.eventsFrom == null) { this.eventsFrom = new ArrayList<>(); } @@ -399,6 +421,110 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AzureEventGrid { + /** Required. The Azure region. */ + @SerializedName("azure_region") + String azureRegion; + + /** Required. The name of the Azure resource group. */ + @SerializedName("azure_resource_group_name") + String azureResourceGroupName; + + /** Required. The Azure subscription ID. */ + @SerializedName("azure_subscription_id") + String azureSubscriptionId; + + /** + * 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 AzureEventGrid( + String azureRegion, + String azureResourceGroupName, + String azureSubscriptionId, + Map extraParams) { + this.azureRegion = azureRegion; + this.azureResourceGroupName = azureResourceGroupName; + this.azureSubscriptionId = azureSubscriptionId; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String azureRegion; + + private String azureResourceGroupName; + + private String azureSubscriptionId; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public EventDestinationCreateParams.AzureEventGrid build() { + return new EventDestinationCreateParams.AzureEventGrid( + this.azureRegion, + this.azureResourceGroupName, + this.azureSubscriptionId, + this.extraParams); + } + + /** Required. The Azure region. */ + public Builder setAzureRegion(String azureRegion) { + this.azureRegion = azureRegion; + return this; + } + + /** Required. The name of the Azure resource group. */ + public Builder setAzureResourceGroupName(String azureResourceGroupName) { + this.azureResourceGroupName = azureResourceGroupName; + return this; + } + + /** Required. The Azure subscription ID. */ + public Builder setAzureSubscriptionId(String azureSubscriptionId) { + this.azureSubscriptionId = azureSubscriptionId; + 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 + * EventDestinationCreateParams.AzureEventGrid#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 EventDestinationCreateParams.AzureEventGrid#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 WebhookEndpoint { @@ -484,21 +610,6 @@ public enum EventPayload implements ApiRequestParams.EnumParam { } } - public enum EventsFrom implements ApiRequestParams.EnumParam { - @SerializedName("other_accounts") - OTHER_ACCOUNTS("other_accounts"), - - @SerializedName("self") - SELF("self"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - EventsFrom(String value) { - this.value = value; - } - } - public enum Include implements ApiRequestParams.EnumParam { @SerializedName("webhook_endpoint.signing_secret") WEBHOOK_ENDPOINT__SIGNING_SECRET("webhook_endpoint.signing_secret"), @@ -518,6 +629,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("amazon_eventbridge") AMAZON_EVENTBRIDGE("amazon_eventbridge"), + @SerializedName("azure_event_grid") + AZURE_EVENT_GRID("azure_event_grid"), + @SerializedName("webhook_endpoint") WEBHOOK_ENDPOINT("webhook_endpoint"); diff --git a/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java b/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java index cb190454762..23964e137e1 100644 --- a/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/accounts/PersonCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -2575,7 +2576,7 @@ public static class Relationship { /** The percentage of ownership the person has in the associated legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** Indicates whether the person is a representative of the associated legal entity. */ @SerializedName("representative") @@ -2592,7 +2593,7 @@ private Relationship( Map extraParams, Boolean legalGuardian, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, Boolean representative, String title) { this.authorizer = authorizer; @@ -2623,7 +2624,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private Boolean representative; @@ -2700,7 +2701,7 @@ public Builder setOwner(Boolean owner) { } /** The percentage of ownership the person has in the associated legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java b/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java index 5d4fae4ceb8..47d2c7f0f15 100644 --- a/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/accounts/PersonTokenCreateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -2545,7 +2546,7 @@ public static class Relationship { /** The percentage of ownership the person has in the associated legal entity. */ @SerializedName("percent_ownership") - String percentOwnership; + BigDecimal percentOwnership; /** Indicates whether the person is a representative of the associated legal entity. */ @SerializedName("representative") @@ -2562,7 +2563,7 @@ private Relationship( Map extraParams, Boolean legalGuardian, Boolean owner, - String percentOwnership, + BigDecimal percentOwnership, Boolean representative, String title) { this.authorizer = authorizer; @@ -2593,7 +2594,7 @@ public static class Builder { private Boolean owner; - private String percentOwnership; + private BigDecimal percentOwnership; private Boolean representative; @@ -2670,7 +2671,7 @@ public Builder setOwner(Boolean owner) { } /** The percentage of ownership the person has in the associated legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java b/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java index c886d483511..001c826555a 100644 --- a/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/accounts/PersonUpdateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -2918,7 +2919,7 @@ public Builder setOwner(Boolean owner) { } /** The percentage of ownership the person has in the associated legal entity. */ - public Builder setPercentOwnership(String percentOwnership) { + public Builder setPercentOwnership(BigDecimal percentOwnership) { this.percentOwnership = percentOwnership; return this; } diff --git a/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java index 99bab7392cc..d2d92082548 100644 --- a/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountCreateParams.java @@ -11,7 +11,7 @@ @Getter @EqualsAndHashCode(callSuper = false) public class GbBankAccountCreateParams extends ApiRequestParams { - /** Required. The Account Number of the bank account. */ + /** The Account Number of the bank account. */ @SerializedName("account_number") String accountNumber; @@ -27,6 +27,10 @@ public class GbBankAccountCreateParams extends ApiRequestParams { @SerializedName("confirmation_of_payee") ConfirmationOfPayee confirmationOfPayee; + /** Required. The currency of the bank account. */ + @SerializedName("currency") + String currency; + /** * Map of extra parameters for custom features not available in this client library. The content * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each @@ -36,7 +40,11 @@ public class GbBankAccountCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. The Sort Code of the bank account. */ + /** The IBAN of the bank account. */ + @SerializedName("iban") + String iban; + + /** The Sort Code of the bank account. */ @SerializedName("sort_code") String sortCode; @@ -44,12 +52,16 @@ private GbBankAccountCreateParams( String accountNumber, BankAccountType bankAccountType, ConfirmationOfPayee confirmationOfPayee, + String currency, Map extraParams, + String iban, String sortCode) { this.accountNumber = accountNumber; this.bankAccountType = bankAccountType; this.confirmationOfPayee = confirmationOfPayee; + this.currency = currency; this.extraParams = extraParams; + this.iban = iban; this.sortCode = sortCode; } @@ -64,8 +76,12 @@ public static class Builder { private ConfirmationOfPayee confirmationOfPayee; + private String currency; + private Map extraParams; + private String iban; + private String sortCode; /** Finalize and obtain parameter instance from this builder. */ @@ -74,11 +90,13 @@ public GbBankAccountCreateParams build() { this.accountNumber, this.bankAccountType, this.confirmationOfPayee, + this.currency, this.extraParams, + this.iban, this.sortCode); } - /** Required. The Account Number of the bank account. */ + /** The Account Number of the bank account. */ public Builder setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; return this; @@ -101,6 +119,12 @@ public Builder setConfirmationOfPayee( return this; } + /** Required. The currency of the bank account. */ + public Builder setCurrency(String currency) { + this.currency = currency; + 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 @@ -127,7 +151,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. The Sort Code of the bank account. */ + /** The IBAN of the bank account. */ + public Builder setIban(String iban) { + this.iban = iban; + return this; + } + + /** The Sort Code of the bank account. */ public Builder setSortCode(String sortCode) { this.sortCode = sortCode; return this; diff --git a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java index a4e185f8968..fbfcc96efce 100644 --- a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountCreateParams.java @@ -19,6 +19,10 @@ public class UsBankAccountCreateParams extends ApiRequestParams { @SerializedName("bank_account_type") BankAccountType bankAccountType; + /** Required. The currency of the bank account. */ + @SerializedName("currency") + String currency; + /** * Map of extra parameters for custom features not available in this client library. The content * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each @@ -45,11 +49,13 @@ public class UsBankAccountCreateParams extends ApiRequestParams { private UsBankAccountCreateParams( String accountNumber, BankAccountType bankAccountType, + String currency, Map extraParams, String fedwireRoutingNumber, String routingNumber) { this.accountNumber = accountNumber; this.bankAccountType = bankAccountType; + this.currency = currency; this.extraParams = extraParams; this.fedwireRoutingNumber = fedwireRoutingNumber; this.routingNumber = routingNumber; @@ -64,6 +70,8 @@ public static class Builder { private BankAccountType bankAccountType; + private String currency; + private Map extraParams; private String fedwireRoutingNumber; @@ -75,6 +83,7 @@ public UsBankAccountCreateParams build() { return new UsBankAccountCreateParams( this.accountNumber, this.bankAccountType, + this.currency, this.extraParams, this.fedwireRoutingNumber, this.routingNumber); @@ -92,6 +101,12 @@ public Builder setBankAccountType(UsBankAccountCreateParams.BankAccountType bank return this; } + /** Required. The currency of the bank account. */ + public Builder setCurrency(String currency) { + this.currency = currency; + 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/moneymanagement/CurrencyConversionCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/CurrencyConversionCreateParams.java index 712020d691f..b09290b3fb8 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/CurrencyConversionCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/CurrencyConversionCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -155,7 +156,7 @@ public CurrencyConversionCreateParams.From build() { } /** Amount object. */ - public Builder setAmount(CurrencyConversionCreateParams.From.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -192,105 +193,6 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) - * name in this param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public CurrencyConversionCreateParams.From.Amount build() { - return new CurrencyConversionCreateParams.From.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 CurrencyConversionCreateParams.From.Amount#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 CurrencyConversionCreateParams.From.Amount#extraParams} for the field - * documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the - * smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } @Getter @@ -336,7 +238,7 @@ public CurrencyConversionCreateParams.To build() { } /** Amount object. */ - public Builder setAmount(CurrencyConversionCreateParams.To.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -373,104 +275,5 @@ public Builder putAllExtraParam(Map map) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The - * content in this map is not serialized under this field's {@code @SerializedName} value. - * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) - * name in this param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public CurrencyConversionCreateParams.To.Amount build() { - return new CurrencyConversionCreateParams.To.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 CurrencyConversionCreateParams.To.Amount#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 CurrencyConversionCreateParams.To.Amount#extraParams} for the field - * documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the - * smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } } diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountListParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountListParams.java index 4be827660d7..66e16693045 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountListParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountListParams.java @@ -22,6 +22,10 @@ public class FinancialAccountListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Additional fields to include in the response. */ + @SerializedName("include") + List include; + /** The page limit. */ @SerializedName("limit") Long limit; @@ -42,10 +46,12 @@ public class FinancialAccountListParams extends ApiRequestParams { private FinancialAccountListParams( Map extraParams, + List include, Long limit, Status status, List types) { this.extraParams = extraParams; + this.include = include; this.limit = limit; this.status = status; this.types = types; @@ -58,6 +64,8 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private List include; + private Long limit; private Status status; @@ -66,7 +74,8 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public FinancialAccountListParams build() { - return new FinancialAccountListParams(this.extraParams, this.limit, this.status, this.types); + return new FinancialAccountListParams( + this.extraParams, this.include, this.limit, this.status, this.types); } /** @@ -95,6 +104,32 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancialAccountListParams#include} for the field documentation. + */ + public Builder addInclude(FinancialAccountListParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * FinancialAccountListParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + /** The page limit. */ public Builder setLimit(Long limit) { this.limit = limit; @@ -137,6 +172,18 @@ public Builder addAllType(List elements) { } } + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("payments.balance_by_funds_type") + PAYMENTS__BALANCE_BY_FUNDS_TYPE("payments.balance_by_funds_type"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } + public enum Status implements ApiRequestParams.EnumParam { @SerializedName("closed") CLOSED("closed"), diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountRetrieveParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountRetrieveParams.java new file mode 100644 index 00000000000..2fa4a2b63a0 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountRetrieveParams.java @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.moneymanagement; + +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 FinancialAccountRetrieveParams extends ApiRequestParams { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Additional fields to include in the response. */ + @SerializedName("include") + List include; + + private FinancialAccountRetrieveParams( + Map extraParams, List include) { + this.extraParams = extraParams; + this.include = include; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List include; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancialAccountRetrieveParams build() { + return new FinancialAccountRetrieveParams(this.extraParams, this.include); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * FinancialAccountRetrieveParams#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 FinancialAccountRetrieveParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `include` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * FinancialAccountRetrieveParams#include} for the field documentation. + */ + public Builder addInclude(FinancialAccountRetrieveParams.Include element) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(element); + return this; + } + + /** + * Add all elements to `include` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * FinancialAccountRetrieveParams#include} for the field documentation. + */ + public Builder addAllInclude(List elements) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.addAll(elements); + return this; + } + } + + public enum Include implements ApiRequestParams.EnumParam { + @SerializedName("payments.balance_by_funds_type") + PAYMENTS__BALANCE_BY_FUNDS_TYPE("payments.balance_by_funds_type"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Include(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/InboundTransferCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/InboundTransferCreateParams.java index 15f5d5937f6..9be96532c88 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/InboundTransferCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/InboundTransferCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -75,7 +76,7 @@ public InboundTransferCreateParams build() { * Required. The amount, in specified currency, by which the FinancialAccount * balance will increase due to the InboundTransfer. */ - public Builder setAmount(InboundTransferCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -128,102 +129,6 @@ public Builder setTo(InboundTransferCreateParams.To to) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public InboundTransferCreateParams.Amount build() { - return new InboundTransferCreateParams.Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * InboundTransferCreateParams.Amount#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 InboundTransferCreateParams.Amount#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class From { diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java index 7d54dbea75d..6fe4644f9ad 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -65,6 +66,13 @@ public class OutboundPaymentCreateParams extends ApiRequestParams { @SerializedName("recipient_verification") String recipientVerification; + /** + * The description that appears on the receiving end for an OutboundPayment (for example, on a + * bank statement). Must be between 3 and 22 characters long, and not contain profanity. + */ + @SerializedName("statement_descriptor") + String statementDescriptor; + /** Required. To which payout method to send the OutboundPayment. */ @SerializedName("to") To to; @@ -80,6 +88,7 @@ private OutboundPaymentCreateParams( Purpose purpose, RecipientNotification recipientNotification, String recipientVerification, + String statementDescriptor, To to) { this.amount = amount; this.deliveryOptions = deliveryOptions; @@ -91,6 +100,7 @@ private OutboundPaymentCreateParams( this.purpose = purpose; this.recipientNotification = recipientNotification; this.recipientVerification = recipientVerification; + this.statementDescriptor = statementDescriptor; this.to = to; } @@ -119,6 +129,8 @@ public static class Builder { private String recipientVerification; + private String statementDescriptor; + private To to; /** Finalize and obtain parameter instance from this builder. */ @@ -134,13 +146,14 @@ public OutboundPaymentCreateParams build() { this.purpose, this.recipientNotification, this.recipientVerification, + this.statementDescriptor, this.to); } /** * Required. The "presentment amount" to be sent to the recipient. */ - public Builder setAmount(OutboundPaymentCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -250,106 +263,19 @@ public Builder setRecipientVerification(String recipientVerification) { return this; } - /** Required. To which payout method to send the OutboundPayment. */ - public Builder setTo(OutboundPaymentCreateParams.To to) { - this.to = to; - return this; - } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * 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. + * The description that appears on the receiving end for an OutboundPayment (for example, on a + * bank statement). Must be between 3 and 22 characters long, and not contain profanity. */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); + public Builder setStatementDescriptor(String statementDescriptor) { + this.statementDescriptor = statementDescriptor; + return this; } - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public OutboundPaymentCreateParams.Amount build() { - return new OutboundPaymentCreateParams.Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * OutboundPaymentCreateParams.Amount#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 OutboundPaymentCreateParams.Amount#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } + /** Required. To which payout method to send the OutboundPayment. */ + public Builder setTo(OutboundPaymentCreateParams.To to) { + this.to = to; + return this; } } diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentQuoteCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentQuoteCreateParams.java index 775729fc241..23ddfb84112 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentQuoteCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundPaymentQuoteCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -73,7 +74,7 @@ public OutboundPaymentQuoteCreateParams build() { /** * Required. The "presentment amount" to be sent to the recipient. */ - public Builder setAmount(OutboundPaymentQuoteCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -126,104 +127,6 @@ public Builder setTo(OutboundPaymentQuoteCreateParams.To to) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public OutboundPaymentQuoteCreateParams.Amount build() { - return new OutboundPaymentQuoteCreateParams.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * OutboundPaymentQuoteCreateParams.Amount#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 OutboundPaymentQuoteCreateParams.Amount#extraParams} for the field - * documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class DeliveryOptions { diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java index a26592fb16e..8f7a6c6b4b6 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentCreateParams.java @@ -265,6 +265,10 @@ public static class BankAccount { @SerializedName("country") String country; + /** Required. The currency of the bank account. */ + @SerializedName("currency") + String currency; + /** * Map of extra parameters for custom features not available in this client library. The * content in this map is not serialized under this field's {@code @SerializedName} value. @@ -287,6 +291,7 @@ private BankAccount( BankAccountType bankAccountType, String branchNumber, String country, + String currency, Map extraParams, String routingNumber, String swiftCode) { @@ -294,6 +299,7 @@ private BankAccount( this.bankAccountType = bankAccountType; this.branchNumber = branchNumber; this.country = country; + this.currency = currency; this.extraParams = extraParams; this.routingNumber = routingNumber; this.swiftCode = swiftCode; @@ -312,6 +318,8 @@ public static class Builder { private String country; + private String currency; + private Map extraParams; private String routingNumber; @@ -325,6 +333,7 @@ public OutboundSetupIntentCreateParams.PayoutMethodData.BankAccount build() { this.bankAccountType, this.branchNumber, this.country, + this.currency, this.extraParams, this.routingNumber, this.swiftCode); @@ -356,6 +365,12 @@ public Builder setCountry(String country) { return this; } + /** Required. The currency of the bank account. */ + public Builder setCurrency(String currency) { + this.currency = currency; + 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 @@ -416,6 +431,10 @@ public enum BankAccountType implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Card { + /** Required. The currency of the card. */ + @SerializedName("currency") + String currency; + /** Required. The expiration month of the card. */ @SerializedName("exp_month") String expMonth; @@ -438,7 +457,12 @@ public static class Card { String number; private Card( - String expMonth, String expYear, Map extraParams, String number) { + String currency, + String expMonth, + String expYear, + Map extraParams, + String number) { + this.currency = currency; this.expMonth = expMonth; this.expYear = expYear; this.extraParams = extraParams; @@ -450,6 +474,8 @@ public static Builder builder() { } public static class Builder { + private String currency; + private String expMonth; private String expYear; @@ -461,7 +487,13 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public OutboundSetupIntentCreateParams.PayoutMethodData.Card build() { return new OutboundSetupIntentCreateParams.PayoutMethodData.Card( - this.expMonth, this.expYear, this.extraParams, this.number); + this.currency, this.expMonth, this.expYear, this.extraParams, this.number); + } + + /** Required. The currency of the card. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; } /** Required. The expiration month of the card. */ diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java index d40727bc9b0..6b0199fbf5d 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundSetupIntentUpdateParams.java @@ -226,6 +226,10 @@ public static class BankAccount { @SerializedName("country") Object country; + /** Required. The currency of the bank account. */ + @SerializedName("currency") + Object currency; + /** * Map of extra parameters for custom features not available in this client library. The * content in this map is not serialized under this field's {@code @SerializedName} value. @@ -248,6 +252,7 @@ private BankAccount( BankAccountType bankAccountType, Object branchNumber, Object country, + Object currency, Map extraParams, Object routingNumber, Object swiftCode) { @@ -255,6 +260,7 @@ private BankAccount( this.bankAccountType = bankAccountType; this.branchNumber = branchNumber; this.country = country; + this.currency = currency; this.extraParams = extraParams; this.routingNumber = routingNumber; this.swiftCode = swiftCode; @@ -273,6 +279,8 @@ public static class Builder { private Object country; + private Object currency; + private Map extraParams; private Object routingNumber; @@ -286,6 +294,7 @@ public OutboundSetupIntentUpdateParams.PayoutMethodData.BankAccount build() { this.bankAccountType, this.branchNumber, this.country, + this.currency, this.extraParams, this.routingNumber, this.swiftCode); @@ -335,6 +344,18 @@ public Builder setCountry(EmptyParam country) { return this; } + /** Required. The currency of the bank account. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** Required. The currency of the bank account. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + 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 @@ -407,6 +428,10 @@ public enum BankAccountType implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Card { + /** The currency of the card. */ + @SerializedName("currency") + Object currency; + /** The expiration month of the card. */ @SerializedName("exp_month") Object expMonth; @@ -432,7 +457,12 @@ public static class Card { Object number; private Card( - Object expMonth, Object expYear, Map extraParams, Object number) { + Object currency, + Object expMonth, + Object expYear, + Map extraParams, + Object number) { + this.currency = currency; this.expMonth = expMonth; this.expYear = expYear; this.extraParams = extraParams; @@ -444,6 +474,8 @@ public static Builder builder() { } public static class Builder { + private Object currency; + private Object expMonth; private Object expYear; @@ -455,7 +487,19 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public OutboundSetupIntentUpdateParams.PayoutMethodData.Card build() { return new OutboundSetupIntentUpdateParams.PayoutMethodData.Card( - this.expMonth, this.expYear, this.extraParams, this.number); + this.currency, this.expMonth, this.expYear, this.extraParams, this.number); + } + + /** The currency of the card. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** The currency of the card. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; } /** The expiration month of the card. */ diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java index d62fa6e4232..3002be4543b 100644 --- a/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java +++ b/src/main/java/com/stripe/param/v2/moneymanagement/OutboundTransferCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -50,6 +51,13 @@ public class OutboundTransferCreateParams extends ApiRequestParams { @SerializedName("recipient_verification") String recipientVerification; + /** + * The description that appears on the receiving end for an OutboundTransfer (for example, on a + * bank statement). Must be between 3 and 22 characters long, and not contain profanity. + */ + @SerializedName("statement_descriptor") + String statementDescriptor; + /** Required. To which payout method to send the OutboundTransfer. */ @SerializedName("to") To to; @@ -62,6 +70,7 @@ private OutboundTransferCreateParams( From from, Map metadata, String recipientVerification, + String statementDescriptor, To to) { this.amount = amount; this.deliveryOptions = deliveryOptions; @@ -70,6 +79,7 @@ private OutboundTransferCreateParams( this.from = from; this.metadata = metadata; this.recipientVerification = recipientVerification; + this.statementDescriptor = statementDescriptor; this.to = to; } @@ -92,6 +102,8 @@ public static class Builder { private String recipientVerification; + private String statementDescriptor; + private To to; /** Finalize and obtain parameter instance from this builder. */ @@ -104,11 +116,12 @@ public OutboundTransferCreateParams build() { this.from, this.metadata, this.recipientVerification, + this.statementDescriptor, this.to); } /** Required. The "presentment amount" for the OutboundPayment. */ - public Builder setAmount(OutboundTransferCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -195,106 +208,19 @@ public Builder setRecipientVerification(String recipientVerification) { return this; } - /** Required. To which payout method to send the OutboundTransfer. */ - public Builder setTo(OutboundTransferCreateParams.To to) { - this.to = to; - return this; - } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. + * The description that appears on the receiving end for an OutboundTransfer (for example, on a + * bank statement). Must be between 3 and 22 characters long, and not contain profanity. */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); + public Builder setStatementDescriptor(String statementDescriptor) { + this.statementDescriptor = statementDescriptor; + return this; } - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public OutboundTransferCreateParams.Amount build() { - return new OutboundTransferCreateParams.Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * OutboundTransferCreateParams.Amount#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 OutboundTransferCreateParams.Amount#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } + /** Required. To which payout method to send the OutboundTransfer. */ + public Builder setTo(OutboundTransferCreateParams.To to) { + this.to = to; + return this; } } diff --git a/src/main/java/com/stripe/param/v2/payments/OffSessionPaymentCreateParams.java b/src/main/java/com/stripe/param/v2/payments/OffSessionPaymentCreateParams.java index 1cbb2ac66be..e256020de47 100644 --- a/src/main/java/com/stripe/param/v2/payments/OffSessionPaymentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/payments/OffSessionPaymentCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -198,7 +199,7 @@ public OffSessionPaymentCreateParams build() { } /** Required. The “presentment amount” to be collected from the customer. */ - public Builder setAmount(OffSessionPaymentCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -355,103 +356,6 @@ public Builder setTransferData(OffSessionPaymentCreateParams.TransferData transf } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public OffSessionPaymentCreateParams.Amount build() { - return new OffSessionPaymentCreateParams.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` - * call, and subsequent calls add additional key/value pairs to the original map. See {@link - * OffSessionPaymentCreateParams.Amount#extraParams} for the field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); - return this; - } - - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. - * See {@link OffSessionPaymentCreateParams.Amount#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - @Getter @EqualsAndHashCode(callSuper = false) public static class Capture { diff --git a/src/main/java/com/stripe/param/v2/payments/SettlementAllocationIntentCreateParams.java b/src/main/java/com/stripe/param/v2/payments/SettlementAllocationIntentCreateParams.java index 0ae7e7e422f..b5fd65d7115 100644 --- a/src/main/java/com/stripe/param/v2/payments/SettlementAllocationIntentCreateParams.java +++ b/src/main/java/com/stripe/param/v2/payments/SettlementAllocationIntentCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.time.Instant; import java.util.HashMap; import java.util.Map; @@ -100,7 +101,7 @@ public SettlementAllocationIntentCreateParams build() { * Required. The amount and currency of the SettlementAllocationIntent. Allowed * Currencies are {@code gbp} | {@code eur}. */ - public Builder setAmount(SettlementAllocationIntentCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -184,102 +185,4 @@ public Builder setReference(String reference) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public SettlementAllocationIntentCreateParams.Amount build() { - return new SettlementAllocationIntentCreateParams.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * SettlementAllocationIntentCreateParams.Amount#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 SettlementAllocationIntentCreateParams.Amount#extraParams} for the field - * documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } diff --git a/src/main/java/com/stripe/param/v2/payments/SettlementAllocationIntentUpdateParams.java b/src/main/java/com/stripe/param/v2/payments/SettlementAllocationIntentUpdateParams.java index 8c4e36e300f..d95661afe71 100644 --- a/src/main/java/com/stripe/param/v2/payments/SettlementAllocationIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/payments/SettlementAllocationIntentUpdateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -60,7 +61,7 @@ public SettlementAllocationIntentUpdateParams build() { * The new amount for the SettlementAllocationIntent. Only amount.value can be updated and * currency must remain same. */ - public Builder setAmount(SettlementAllocationIntentUpdateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -103,112 +104,4 @@ public Builder setReference(EmptyParam reference) { return this; } } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - Object currency; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(Object currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private Object currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public SettlementAllocationIntentUpdateParams.Amount build() { - return new SettlementAllocationIntentUpdateParams.Amount( - this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - return this; - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(EmptyParam currency) { - this.currency = currency; - 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 - * SettlementAllocationIntentUpdateParams.Amount#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 SettlementAllocationIntentUpdateParams.Amount#extraParams} for the field - * documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } } diff --git a/src/main/java/com/stripe/param/v2/payments/settlementallocationintents/SplitCreateParams.java b/src/main/java/com/stripe/param/v2/payments/settlementallocationintents/SplitCreateParams.java index aa73d91058e..79850a22743 100644 --- a/src/main/java/com/stripe/param/v2/payments/settlementallocationintents/SplitCreateParams.java +++ b/src/main/java/com/stripe/param/v2/payments/settlementallocationintents/SplitCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -84,7 +85,7 @@ public Builder setAccount(String account) { /** * Required. The amount and currency of the SettlementAllocationIntentSplit. */ - public Builder setAmount(SplitCreateParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -148,102 +149,6 @@ public Builder setType(SplitCreateParams.Type type) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public SplitCreateParams.Amount build() { - return new SplitCreateParams.Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * SplitCreateParams.Amount#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 SplitCreateParams.Amount#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - public enum Type implements ApiRequestParams.EnumParam { @SerializedName("credit") CREDIT("credit"), diff --git a/src/main/java/com/stripe/param/v2/tax/ManualRuleCreateParams.java b/src/main/java/com/stripe/param/v2/tax/ManualRuleCreateParams.java index b04ebe48578..9b351bd2c7b 100644 --- a/src/main/java/com/stripe/param/v2/tax/ManualRuleCreateParams.java +++ b/src/main/java/com/stripe/param/v2/tax/ManualRuleCreateParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -505,7 +506,7 @@ public static class Rate { * decimal points. */ @SerializedName("percentage") - String percentage; + BigDecimal percentage; /** State of the tax rate. */ @SerializedName("state") @@ -517,7 +518,7 @@ private Rate( String displayName, Map extraParams, String jurisdiction, - String percentage, + BigDecimal percentage, String state) { this.country = country; this.description = description; @@ -543,7 +544,7 @@ public static class Builder { private String jurisdiction; - private String percentage; + private BigDecimal percentage; private String state; @@ -618,7 +619,7 @@ public Builder setJurisdiction(String jurisdiction) { * Required. Percentage of the tax rate. Must be positive and maximum of 4 * decimal points. */ - public Builder setPercentage(String percentage) { + public Builder setPercentage(BigDecimal percentage) { this.percentage = percentage; return this; } diff --git a/src/main/java/com/stripe/param/v2/tax/ManualRuleUpdateParams.java b/src/main/java/com/stripe/param/v2/tax/ManualRuleUpdateParams.java index c6156d792b7..369149d11da 100644 --- a/src/main/java/com/stripe/param/v2/tax/ManualRuleUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/tax/ManualRuleUpdateParams.java @@ -4,6 +4,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; import com.stripe.param.common.EmptyParam; +import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.HashMap; @@ -676,7 +677,7 @@ public Builder setJurisdiction(EmptyParam jurisdiction) { * Required. Percentage of the tax rate. Must be positive and maximum of 4 * decimal points. */ - public Builder setPercentage(String percentage) { + public Builder setPercentage(BigDecimal percentage) { this.percentage = percentage; return this; } diff --git a/src/main/java/com/stripe/param/v2/testhelpers/FinancialAddressCreditParams.java b/src/main/java/com/stripe/param/v2/testhelpers/FinancialAddressCreditParams.java index ec5e7780f91..b76549eb9e0 100644 --- a/src/main/java/com/stripe/param/v2/testhelpers/FinancialAddressCreditParams.java +++ b/src/main/java/com/stripe/param/v2/testhelpers/FinancialAddressCreditParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.v2.Amount; import java.util.HashMap; import java.util.Map; import lombok.EqualsAndHashCode; @@ -66,7 +67,7 @@ public FinancialAddressCreditParams build() { } /** Required. Object containing the amount value and currency to credit. */ - public Builder setAmount(FinancialAddressCreditParams.Amount amount) { + public Builder setAmount(Amount amount) { this.amount = amount; return this; } @@ -116,102 +117,6 @@ public Builder setStatementDescriptor(String statementDescriptor) { } } - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Amount { - /** - * Required. Three-letter ISO currency code, in lowercase. - * Must be a supported currency. - */ - @SerializedName("currency") - String currency; - - /** - * Map of extra parameters for custom features not available in this client library. The content - * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each - * key/value pair is serialized as if the key is a root-level field (serialized) name in this - * param object. Effectively, this map is flattened to its parent instance. - */ - @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) - Map extraParams; - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - @SerializedName("value") - Long value; - - private Amount(String currency, Map extraParams, Long value) { - this.currency = currency; - this.extraParams = extraParams; - this.value = value; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private String currency; - - private Map extraParams; - - private Long value; - - /** Finalize and obtain parameter instance from this builder. */ - public FinancialAddressCreditParams.Amount build() { - return new FinancialAddressCreditParams.Amount(this.currency, this.extraParams, this.value); - } - - /** - * Required. Three-letter ISO currency code, in - * lowercase. Must be a supported currency. - */ - public Builder setCurrency(String currency) { - this.currency = currency; - 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 - * FinancialAddressCreditParams.Amount#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 FinancialAddressCreditParams.Amount#extraParams} for the field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); - return this; - } - - /** - * Required. A non-negative integer representing how much to charge in the smallest currency unit. - */ - public Builder setValue(Long value) { - this.value = value; - return this; - } - } - } - public enum Network implements ApiRequestParams.EnumParam { @SerializedName("ach") ACH("ach"), diff --git a/src/main/java/com/stripe/service/v2/BillingService.java b/src/main/java/com/stripe/service/v2/BillingService.java index ab9f1dbf960..415e10e9c96 100644 --- a/src/main/java/com/stripe/service/v2/BillingService.java +++ b/src/main/java/com/stripe/service/v2/BillingService.java @@ -29,11 +29,6 @@ public com.stripe.service.v2.billing.IntentService intents() { return new com.stripe.service.v2.billing.IntentService(this.getResponseGetter()); } - public com.stripe.service.v2.billing.LicenseFeeSubscriptionService licenseFeeSubscriptions() { - return new com.stripe.service.v2.billing.LicenseFeeSubscriptionService( - this.getResponseGetter()); - } - public com.stripe.service.v2.billing.LicenseFeeService licenseFees() { return new com.stripe.service.v2.billing.LicenseFeeService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/v2/CoreService.java b/src/main/java/com/stripe/service/v2/CoreService.java index 12aa1f729ac..c9b3483b610 100644 --- a/src/main/java/com/stripe/service/v2/CoreService.java +++ b/src/main/java/com/stripe/service/v2/CoreService.java @@ -9,6 +9,10 @@ public CoreService(StripeResponseGetter responseGetter) { super(responseGetter); } + public com.stripe.service.v2.core.AccountEvaluationService accountEvaluations() { + return new com.stripe.service.v2.core.AccountEvaluationService(this.getResponseGetter()); + } + public com.stripe.service.v2.core.AccountLinkService accountLinks() { return new com.stripe.service.v2.core.AccountLinkService(this.getResponseGetter()); } @@ -21,6 +25,10 @@ public com.stripe.service.v2.core.AccountService accounts() { return new com.stripe.service.v2.core.AccountService(this.getResponseGetter()); } + public com.stripe.service.v2.core.BatchJobService batchJobs() { + return new com.stripe.service.v2.core.BatchJobService(this.getResponseGetter()); + } + public com.stripe.service.v2.core.ClaimableSandboxService claimableSandboxes() { return new com.stripe.service.v2.core.ClaimableSandboxService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/service/v2/billing/IntentService.java b/src/main/java/com/stripe/service/v2/billing/IntentService.java index c5a24a174dc..1f023ff54c8 100644 --- a/src/main/java/com/stripe/service/v2/billing/IntentService.java +++ b/src/main/java/com/stripe/service/v2/billing/IntentService.java @@ -15,6 +15,7 @@ import com.stripe.param.v2.billing.IntentCommitParams; import com.stripe.param.v2.billing.IntentCreateParams; import com.stripe.param.v2.billing.IntentListParams; +import com.stripe.param.v2.billing.IntentReserveParams; public final class IntentService extends ApiService { public IntentService(StripeResponseGetter responseGetter) { @@ -122,14 +123,28 @@ public Intent releaseReservation(String id, RequestOptions options) throws Strip return this.request(request, Intent.class); } /** Reserve a Billing Intent. */ - public Intent reserve(String id) throws StripeException { - return reserve(id, (RequestOptions) null); + public Intent reserve(String id, IntentReserveParams params) throws StripeException { + return reserve(id, params, (RequestOptions) null); } /** Reserve a Billing Intent. */ public Intent reserve(String id, RequestOptions options) throws StripeException { + return reserve(id, (IntentReserveParams) null, options); + } + /** Reserve a Billing Intent. */ + public Intent reserve(String id) throws StripeException { + return reserve(id, (IntentReserveParams) null, (RequestOptions) null); + } + /** Reserve a Billing Intent. */ + public Intent reserve(String id, IntentReserveParams params, RequestOptions options) + throws StripeException { String path = String.format("/v2/billing/intents/%s/reserve", ApiResource.urlEncodeId(id)); ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); return this.request(request, Intent.class); } diff --git a/src/main/java/com/stripe/service/v2/billing/LicenseFeeSubscriptionService.java b/src/main/java/com/stripe/service/v2/billing/LicenseFeeSubscriptionService.java deleted file mode 100644 index a31dc9e4366..00000000000 --- a/src/main/java/com/stripe/service/v2/billing/LicenseFeeSubscriptionService.java +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.service.v2.billing; - -import com.stripe.exception.StripeException; -import com.stripe.model.v2.billing.LicenseFeeSubscription; -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 LicenseFeeSubscriptionService extends ApiService { - public LicenseFeeSubscriptionService(StripeResponseGetter responseGetter) { - super(responseGetter); - } - - /** Retrieve a License Fee Subscription object. */ - public LicenseFeeSubscription retrieve(String id) throws StripeException { - return retrieve(id, (RequestOptions) null); - } - /** Retrieve a License Fee Subscription object. */ - public LicenseFeeSubscription retrieve(String id, RequestOptions options) throws StripeException { - String path = - String.format("/v2/billing/license_fee_subscriptions/%s", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); - return this.request(request, LicenseFeeSubscription.class); - } -} 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 6cd752e267f..8e1366e3e83 100644 --- a/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java +++ b/src/main/java/com/stripe/service/v2/billing/PricingPlanSubscriptionService.java @@ -13,6 +13,8 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.v2.billing.PricingPlanSubscriptionListParams; +import com.stripe.param.v2.billing.PricingPlanSubscriptionRemoveDiscountsParams; +import com.stripe.param.v2.billing.PricingPlanSubscriptionRetrieveParams; import com.stripe.param.v2.billing.PricingPlanSubscriptionUpdateParams; public final class PricingPlanSubscriptionService extends ApiService { @@ -49,16 +51,32 @@ public StripeCollection list( request, new TypeToken>() {}.getType()); } /** Retrieve a Pricing Plan Subscription object. */ - public PricingPlanSubscription retrieve(String id) throws StripeException { - return retrieve(id, (RequestOptions) null); + public PricingPlanSubscription retrieve(String id, PricingPlanSubscriptionRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); } /** Retrieve a Pricing Plan Subscription object. */ public PricingPlanSubscription retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (PricingPlanSubscriptionRetrieveParams) null, options); + } + /** Retrieve a Pricing Plan Subscription object. */ + public PricingPlanSubscription retrieve(String id) throws StripeException { + return retrieve(id, (PricingPlanSubscriptionRetrieveParams) null, (RequestOptions) null); + } + /** Retrieve a Pricing Plan Subscription object. */ + public PricingPlanSubscription retrieve( + String id, PricingPlanSubscriptionRetrieveParams params, RequestOptions options) + throws StripeException { String path = String.format("/v2/billing/pricing_plan_subscriptions/%s", ApiResource.urlEncodeId(id)); ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); return this.request(request, PricingPlanSubscription.class); } /** Update a Pricing Plan Subscription object. */ @@ -89,9 +107,36 @@ 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()); + /** Remove Discounts from a Pricing Plan Subscription. */ + public PricingPlanSubscription removeDiscounts( + String id, PricingPlanSubscriptionRemoveDiscountsParams params) throws StripeException { + return removeDiscounts(id, params, (RequestOptions) null); + } + /** Remove Discounts from a Pricing Plan Subscription. */ + public PricingPlanSubscription removeDiscounts(String id, RequestOptions options) + throws StripeException { + return removeDiscounts(id, (PricingPlanSubscriptionRemoveDiscountsParams) null, options); + } + /** Remove Discounts from a Pricing Plan Subscription. */ + public PricingPlanSubscription removeDiscounts(String id) throws StripeException { + return removeDiscounts( + id, (PricingPlanSubscriptionRemoveDiscountsParams) null, (RequestOptions) null); + } + /** Remove Discounts from a Pricing Plan Subscription. */ + public PricingPlanSubscription removeDiscounts( + String id, PricingPlanSubscriptionRemoveDiscountsParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v2/billing/pricing_plan_subscriptions/%s/remove_discounts", + ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PricingPlanSubscription.class); } } diff --git a/src/main/java/com/stripe/service/v2/billing/RateCardService.java b/src/main/java/com/stripe/service/v2/billing/RateCardService.java index 13da3ce7fb6..e56d818dc58 100644 --- a/src/main/java/com/stripe/service/v2/billing/RateCardService.java +++ b/src/main/java/com/stripe/service/v2/billing/RateCardService.java @@ -5,6 +5,7 @@ import com.stripe.exception.StripeException; import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.billing.RateCard; +import com.stripe.model.v2.billing.RateCardVersion; import com.stripe.net.ApiRequest; import com.stripe.net.ApiRequestParams; import com.stripe.net.ApiResource; @@ -14,6 +15,7 @@ import com.stripe.net.StripeResponseGetter; import com.stripe.param.v2.billing.RateCardCreateParams; import com.stripe.param.v2.billing.RateCardListParams; +import com.stripe.param.v2.billing.RateCardModifyRatesParams; import com.stripe.param.v2.billing.RateCardUpdateParams; public final class RateCardService extends ApiService { @@ -99,6 +101,25 @@ public RateCard update(String id, RateCardUpdateParams params, RequestOptions op options); return this.request(request, RateCard.class); } + /** Creates, updates, and/or deletes multiple Rates on a Rate Card atomically. */ + public RateCardVersion modifyRates(String id, RateCardModifyRatesParams params) + throws StripeException { + return modifyRates(id, params, (RequestOptions) null); + } + /** Creates, updates, and/or deletes multiple Rates on a Rate Card atomically. */ + public RateCardVersion modifyRates( + String id, RateCardModifyRatesParams params, RequestOptions options) throws StripeException { + String path = + String.format("/v2/billing/rate_cards/%s/modify_rates", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, RateCardVersion.class); + } public com.stripe.service.v2.billing.ratecards.CustomPricingUnitOverageRateService customPricingUnitOverageRates() { 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 deleted file mode 100644 index 5275dc18ee0..00000000000 --- a/src/main/java/com/stripe/service/v2/billing/pricingplansubscriptions/ComponentService.java +++ /dev/null @@ -1,32 +0,0 @@ -// 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/billing/ratecards/RateService.java b/src/main/java/com/stripe/service/v2/billing/ratecards/RateService.java index f1b9cfcaeef..b89c10a866c 100644 --- a/src/main/java/com/stripe/service/v2/billing/ratecards/RateService.java +++ b/src/main/java/com/stripe/service/v2/billing/ratecards/RateService.java @@ -22,7 +22,7 @@ public RateService(StripeResponseGetter responseGetter) { } /** - * List all Rates associated with a Rate Card for a specific version (defaults to latest). Rates + * List all Rates associated with a Rate Card for a specific version. Defaults to latest. Rates * remain active for all subsequent versions until a new rate is created for the same Metered * Item. */ @@ -31,7 +31,7 @@ public StripeCollection list(String rateCardId, RateListParams par return list(rateCardId, params, (RequestOptions) null); } /** - * List all Rates associated with a Rate Card for a specific version (defaults to latest). Rates + * List all Rates associated with a Rate Card for a specific version. Defaults to latest. Rates * remain active for all subsequent versions until a new rate is created for the same Metered * Item. */ @@ -40,7 +40,7 @@ public StripeCollection list(String rateCardId, RequestOptions opt return list(rateCardId, (RateListParams) null, options); } /** - * List all Rates associated with a Rate Card for a specific version (defaults to latest). Rates + * List all Rates associated with a Rate Card for a specific version. Defaults to latest. Rates * remain active for all subsequent versions until a new rate is created for the same Metered * Item. */ @@ -48,7 +48,7 @@ public StripeCollection list(String rateCardId) throws StripeExcep return list(rateCardId, (RateListParams) null, (RequestOptions) null); } /** - * List all Rates associated with a Rate Card for a specific version (defaults to latest). Rates + * List all Rates associated with a Rate Card for a specific version. Defaults to latest. Rates * remain active for all subsequent versions until a new rate is created for the same Metered * Item. */ diff --git a/src/main/java/com/stripe/service/v2/core/AccountEvaluationService.java b/src/main/java/com/stripe/service/v2/core/AccountEvaluationService.java new file mode 100644 index 00000000000..b01a4e244e7 --- /dev/null +++ b/src/main/java/com/stripe/service/v2/core/AccountEvaluationService.java @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.core; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.AccountEvaluation; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.v2.core.AccountEvaluationCreateParams; + +public final class AccountEvaluationService extends ApiService { + public AccountEvaluationService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** + * Creates a new account evaluation to trigger signal evaluations on an account or account data. + */ + public AccountEvaluation create(AccountEvaluationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** + * Creates a new account evaluation to trigger signal evaluations on an account or account data. + */ + public AccountEvaluation create(AccountEvaluationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v2/core/account_evaluations"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, AccountEvaluation.class); + } +} diff --git a/src/main/java/com/stripe/service/v2/core/BatchJobService.java b/src/main/java/com/stripe/service/v2/core/BatchJobService.java new file mode 100644 index 00000000000..49f56c52677 --- /dev/null +++ b/src/main/java/com/stripe/service/v2/core/BatchJobService.java @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec +package com.stripe.service.v2.core; + +import com.stripe.exception.StripeException; +import com.stripe.model.v2.core.BatchJob; +import com.stripe.net.ApiRequest; +import com.stripe.net.ApiRequestParams; +import com.stripe.net.ApiResource; +import com.stripe.net.ApiService; +import com.stripe.net.BaseAddress; +import com.stripe.net.RequestOptions; +import com.stripe.net.StripeResponseGetter; +import com.stripe.param.v2.core.BatchJobCreateParams; + +public final class BatchJobService extends ApiService { + public BatchJobService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Creates a new batch job. */ + public BatchJob create(BatchJobCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); + } + /** Creates a new batch job. */ + public BatchJob create(BatchJobCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v2/core/batch_jobs"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, BatchJob.class); + } + /** Retrieves an existing batch job. */ + public BatchJob retrieve(String id) throws StripeException { + return retrieve(id, (RequestOptions) null); + } + /** Retrieves an existing batch job. */ + public BatchJob retrieve(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/core/batch_jobs/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); + return this.request(request, BatchJob.class); + } + /** Cancels an existing batch job. */ + public BatchJob cancel(String id) throws StripeException { + return cancel(id, (RequestOptions) null); + } + /** Cancels an existing batch job. */ + public BatchJob cancel(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/core/batch_jobs/%s/cancel", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + return this.request(request, BatchJob.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 c5a8104c4d8..a7b9fd6f4df 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.FinancialAccountRetrieveParams; import com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams; public final class FinancialAccountService extends ApiService { @@ -70,15 +71,31 @@ public FinancialAccount create(FinancialAccountCreateParams params, RequestOptio return this.request(request, FinancialAccount.class); } /** Retrieves the details of an existing FinancialAccount. */ - public FinancialAccount retrieve(String id) throws StripeException { - return retrieve(id, (RequestOptions) null); + public FinancialAccount retrieve(String id, FinancialAccountRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); } /** Retrieves the details of an existing FinancialAccount. */ public FinancialAccount retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (FinancialAccountRetrieveParams) null, options); + } + /** Retrieves the details of an existing FinancialAccount. */ + public FinancialAccount retrieve(String id) throws StripeException { + return retrieve(id, (FinancialAccountRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves the details of an existing FinancialAccount. */ + public FinancialAccount retrieve( + String id, FinancialAccountRetrieveParams 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.GET, path, null, options); + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); return this.request(request, FinancialAccount.class); } /** Updates an existing FinancialAccount. */ diff --git a/src/test/java/com/stripe/StripeClientTest.java b/src/test/java/com/stripe/StripeClientTest.java index a26737f57cd..aa97216e5a4 100644 --- a/src/test/java/com/stripe/StripeClientTest.java +++ b/src/test/java/com/stripe/StripeClientTest.java @@ -140,7 +140,7 @@ public void checksWebhookSignature() StripeClient client = new StripeClient("sk_123"); String payload = - "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"event\"\n}"; + "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"v2.core.event\"\n}"; String secret = "whsec_test_secret"; Map options = new HashMap<>(); @@ -159,7 +159,7 @@ public void failsWebhookVerification() StripeClient client = new StripeClient("sk_123"); String payload = - "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"event\"\n}"; + "{\n \"id\": \"evt_test_webhook\",\n \"type\": \"v1.whatever\",\n \"object\": \"v2.core.event\"\n}"; String secret = "whsec_test_secret"; String signature = "bad signature"; @@ -173,7 +173,7 @@ public void failsWebhookVerification() static final String v2EventNotificationWithRelatedObject = "{\n" + " \"id\": \"evt_234\",\n" - + " \"object\": \"event\",\n" + + " \"object\": \"v2.core.event\",\n" + " \"type\": \"v1.billing.meter.error_report_triggered\",\n" + " \"livemode\": false,\n" + " \"context\": \"org_123\",\n" @@ -191,7 +191,7 @@ public void failsWebhookVerification() static final String v2EventNotificationWithoutRelatedObject = "{\n" + " \"id\": \"evt_234\",\n" - + " \"object\": \"event\",\n" + + " \"object\": \"v2.core.event\",\n" + " \"type\": \"v1.billing.meter.no_meter_found\",\n" + " \"livemode\": false,\n" + " \"created\": \"2022-02-15T00:27:45.330Z\"\n" @@ -200,7 +200,7 @@ public void failsWebhookVerification() static final String v2UnknownEventNotification = "{\n" + " \"id\": \"evt_234\",\n" - + " \"object\": \"event\",\n" + + " \"object\": \"v2.core.event\",\n" + " \"type\": \"v1.imaginary_event\",\n" + " \"livemode\": false,\n" + " \"created\": \"2022-02-15T00:27:45.330Z\"\n" @@ -417,4 +417,28 @@ public void parseEventNotificationAndPull() assertEquals("org_123", v.getOptions().getStripeContext()); } } + + @Test + public void parseEventNotificationRejectsV1Payload() + throws InvalidKeyException, NoSuchAlgorithmException { + StripeClient client = new StripeClient("sk_123"); + + String payload = + "{\n \"id\": \"evt_test_webhook\",\n \"object\": \"event\",\n \"type\": \"charge.succeeded\"\n}"; + String secret = "whsec_test_secret"; + + Map options = new HashMap<>(); + options.put("payload", payload); + options.put("secret", secret); + + String signature = WebhookTest.generateSigHeader(options); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> { + client.parseEventNotification(payload, signature, secret); + }); + assertTrue(exception.getMessage().contains("constructEvent")); + } } diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index 20e759cbbe2..20b115c3d5b 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -25056,7 +25056,7 @@ public void testV2BillingIntentGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.billing.Intent>>() {}.getType(), - "{\"data\":[{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.IntentListParams params = @@ -25082,7 +25082,7 @@ public void testV2BillingIntentPostServices() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.IntentCreateParams params = @@ -25095,13 +25095,23 @@ public void testV2BillingIntentPostServices() throws StripeException { .setEffectiveAt( com.stripe.param.v2.billing.IntentCreateParams.Action.Apply .EffectiveAt.builder() + .setTimestamp(Instant.parse("1970-01-01T15:18:46.294Z")) .setType( com.stripe.param.v2.billing.IntentCreateParams.Action.Apply .EffectiveAt.Type.CURRENT_BILLING_PERIOD_END) .build()) .setType( com.stripe.param.v2.billing.IntentCreateParams.Action.Apply.Type - .INVOICE_DISCOUNT_RULE) + .DISCOUNT) + .setDiscount( + com.stripe.param.v2.billing.IntentCreateParams.Action.Apply.Discount + .builder() + .setCoupon("coupon") + .setPromotionCode("promotion_code") + .setType( + com.stripe.param.v2.billing.IntentCreateParams.Action.Apply + .Discount.Type.COUPON) + .build()) .setInvoiceDiscountRule( com.stripe.param.v2.billing.IntentCreateParams.Action.Apply .InvoiceDiscountRule.builder() @@ -25124,7 +25134,7 @@ public void testV2BillingIntentPostServices() throws StripeException { .InvoiceDiscountRule.PercentOff .MaximumApplications.Type.INDEFINITE) .build()) - .setPercentOff("percent_off") + .setPercentOff(new BigDecimal("991934883.3333334")) .build()) .build()) .setSpendModifierRule( @@ -25415,7 +25425,7 @@ public void testV2BillingIntentGet2Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.Intent intent = client.v2().billing().intents().retrieve("id_123"); @@ -25433,7 +25443,7 @@ public void testV2BillingIntentPost2Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.Intent intent = client.v2().billing().intents().cancel("id_123"); @@ -25455,7 +25465,7 @@ public void testV2BillingIntentPost3Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.IntentCommitParams params = @@ -25481,7 +25491,7 @@ public void testV2BillingIntentPost4Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.Intent intent = @@ -25504,16 +25514,20 @@ public void testV2BillingIntentPost5Services() throws StripeException { null, null, com.stripe.model.v2.billing.Intent.class, - "{\"amount_details\":{\"currency\":\"usd\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount_details\":{\"amount_due\":\"amount_due\",\"currency\":\"usd\",\"customer_balance_applied\":\"customer_balance_applied\",\"discount\":\"discount\",\"shipping\":\"shipping\",\"subtotal\":\"subtotal\",\"tax\":\"tax\",\"total\":\"total\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"id\":\"obj_123\",\"object\":\"v2.billing.intent\",\"status\":\"draft\",\"status_transitions\":{\"expires_at\":\"1970-01-10T15:36:51.170Z\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.model.v2.billing.Intent intent = client.v2().billing().intents().reserve("id_123"); + com.stripe.param.v2.billing.IntentReserveParams params = + com.stripe.param.v2.billing.IntentReserveParams.builder().build(); + + com.stripe.model.v2.billing.Intent intent = + client.v2().billing().intents().reserve("id_123", params); assertNotNull(intent); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.POST, "/v2/billing/intents/id_123/reserve", - null, + params.toMap(), null); } @@ -25579,7 +25593,7 @@ public void testV2BillingLicenseFeeGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.billing.LicenseFee>>() {}.getType(), - "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.LicenseFeeListParams params = @@ -25607,7 +25621,7 @@ public void testV2BillingLicenseFeePostServices() throws StripeException { null, null, com.stripe.model.v2.billing.LicenseFee.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.LicenseFeeCreateParams params = @@ -25642,7 +25656,7 @@ public void testV2BillingLicenseFeeGet2Services() throws StripeException { null, null, com.stripe.model.v2.billing.LicenseFee.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.LicenseFee licenseFee = @@ -25665,7 +25679,7 @@ public void testV2BillingLicenseFeePost2Services() throws StripeException { null, null, com.stripe.model.v2.billing.LicenseFee.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"licensed_item\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.licensed_item\",\"livemode\":true},\"live_version\":\"live_version\",\"object\":\"v2.billing.license_fee\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"tiers\":[{}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.LicenseFeeUpdateParams params = @@ -25734,29 +25748,6 @@ public void testV2BillingLicenseFeesVersionGet2Services() throws StripeException null); } - @Test - public void testV2BillingLicenseFeeSubscriptionGetServices() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/billing/license_fee_subscriptions/id_123", - null, - null, - com.stripe.model.v2.billing.LicenseFeeSubscription.class, - "{\"billing_cadence\":\"billing_cadence\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"license_fee\":\"license_fee\",\"license_fee_version\":\"license_fee_version\",\"object\":\"v2.billing.license_fee_subscription\",\"quantity\":1285004149,\"livemode\":true}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.model.v2.billing.LicenseFeeSubscription licenseFeeSubscription = - client.v2().billing().licenseFeeSubscriptions().retrieve("id_123"); - assertNotNull(licenseFeeSubscription); - verifyRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/billing/license_fee_subscriptions/id_123", - null, - null); - } - @Test public void testV2BillingLicensedItemGetServices() throws StripeException { stubRequest( @@ -26201,7 +26192,7 @@ public void testV2BillingPricingPlanGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.billing.PricingPlan>>() {}.getType(), - "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.PricingPlanListParams params = @@ -26227,7 +26218,7 @@ public void testV2BillingPricingPlanPostServices() throws StripeException { null, null, com.stripe.model.v2.billing.PricingPlan.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.PricingPlanCreateParams params = @@ -26258,7 +26249,7 @@ public void testV2BillingPricingPlanGet2Services() throws StripeException { null, null, com.stripe.model.v2.billing.PricingPlan.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.PricingPlan pricingPlan = @@ -26281,7 +26272,7 @@ public void testV2BillingPricingPlanPost2Services() throws StripeException { null, null, com.stripe.model.v2.billing.PricingPlan.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan\",\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.PricingPlanUpdateParams params = @@ -26525,14 +26516,17 @@ public void testV2BillingPricingPlanSubscriptionGet2Services() throws StripeExce "{\"billing_cadence\":\"billing_cadence\",\"collection_status\":\"past_due\",\"collection_status_transitions\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan_subscription\",\"pricing_plan\":\"pricing_plan\",\"pricing_plan_version\":\"pricing_plan_version\",\"servicing_status\":\"pending\",\"servicing_status_transitions\":{},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); + com.stripe.param.v2.billing.PricingPlanSubscriptionRetrieveParams params = + com.stripe.param.v2.billing.PricingPlanSubscriptionRetrieveParams.builder().build(); + com.stripe.model.v2.billing.PricingPlanSubscription pricingPlanSubscription = - client.v2().billing().pricingPlanSubscriptions().retrieve("id_123"); + client.v2().billing().pricingPlanSubscriptions().retrieve("id_123", params); assertNotNull(pricingPlanSubscription); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/billing/pricing_plan_subscriptions/id_123", - null, + params.toMap(), null); } @@ -26563,26 +26557,28 @@ public void testV2BillingPricingPlanSubscriptionPostServices() throws StripeExce } @Test - public void testV2BillingPricingPlanSubscriptionsComponentGetServices() throws StripeException { + public void testV2BillingPricingPlanSubscriptionPost2Services() throws StripeException { stubRequest( BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/billing/pricing_plan_subscriptions/id_123/components", + ApiResource.RequestMethod.POST, + "/v2/billing/pricing_plan_subscriptions/id_123/remove_discounts", 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}"); + com.stripe.model.v2.billing.PricingPlanSubscription.class, + "{\"billing_cadence\":\"billing_cadence\",\"collection_status\":\"past_due\",\"collection_status_transitions\":{},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.pricing_plan_subscription\",\"pricing_plan\":\"pricing_plan\",\"pricing_plan_version\":\"pricing_plan_version\",\"servicing_status\":\"pending\",\"servicing_status_transitions\":{},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.model.v2.billing.PricingPlanSubscriptionComponents - pricingPlanSubscriptionComponents = - client.v2().billing().pricingPlanSubscriptions().components().retrieve("id_123"); - assertNotNull(pricingPlanSubscriptionComponents); + com.stripe.param.v2.billing.PricingPlanSubscriptionRemoveDiscountsParams params = + com.stripe.param.v2.billing.PricingPlanSubscriptionRemoveDiscountsParams.builder().build(); + + com.stripe.model.v2.billing.PricingPlanSubscription pricingPlanSubscription = + client.v2().billing().pricingPlanSubscriptions().removeDiscounts("id_123", params); + assertNotNull(pricingPlanSubscription); verifyRequest( BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/billing/pricing_plan_subscriptions/id_123/components", - null, + ApiResource.RequestMethod.POST, + "/v2/billing/pricing_plan_subscriptions/id_123/remove_discounts", + params.toMap(), null); } @@ -26695,7 +26691,7 @@ public void testV2BillingRateCardGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.billing.RateCard>>() {}.getType(), - "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.RateCardListParams params = @@ -26721,7 +26717,7 @@ public void testV2BillingRateCardPostServices() throws StripeException { null, null, com.stripe.model.v2.billing.RateCard.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.RateCardCreateParams params = @@ -26754,7 +26750,7 @@ public void testV2BillingRateCardGet2Services() throws StripeException { null, null, com.stripe.model.v2.billing.RateCard.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.billing.RateCard rateCard = @@ -26777,7 +26773,7 @@ public void testV2BillingRateCardPost2Services() throws StripeException { null, null, com.stripe.model.v2.billing.RateCard.class, - "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"latest_version\":\"latest_version\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_interval\":\"month\",\"service_interval_count\":1375336415,\"tax_behavior\":\"exclusive\",\"livemode\":true}"); + "{\"active\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"currency\":\"usd\",\"display_name\":\"display_name\",\"id\":\"obj_123\",\"live_version\":\"live_version\",\"object\":\"v2.billing.rate_card\",\"service_cycle\":{\"interval\":\"month\",\"interval_count\":797691627},\"tax_behavior\":\"exclusive\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.billing.RateCardUpdateParams params = @@ -26794,6 +26790,78 @@ public void testV2BillingRateCardPost2Services() throws StripeException { null); } + @Test + public void testV2BillingRateCardPost3Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/rate_cards/id_123/modify_rates", + null, + null, + com.stripe.model.v2.billing.RateCardVersion.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.rate_card_version\",\"rate_card_id\":\"rate_card_id\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.RateCardModifyRatesParams params = + com.stripe.param.v2.billing.RateCardModifyRatesParams.builder() + .addRatesToCreate( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate.builder() + .putMetadata("key", "metadata") + .setMeteredItem("metered_item") + .setMeteredItemData( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .MeteredItemData.builder() + .setDisplayName("display_name") + .setLookupKey("lookup_key") + .setMeter("meter") + .addMeterSegmentCondition( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .MeteredItemData.MeterSegmentCondition.builder() + .setDimension("dimension") + .setValue("value") + .build()) + .setUnitLabel("unit_label") + .build()) + .setTieringMode( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .TieringMode.GRADUATED) + .addTier( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate.Tier + .builder() + .setFlatAmount("flat_amount") + .setUnitAmount("unit_amount") + .setUpToDecimal(new BigDecimal("1387931359.3333333")) + .setUpToInf( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .Tier.UpToInf.INF) + .build()) + .setTransformQuantity( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .TransformQuantity.builder() + .setDivideBy(1592560163L) + .setRound( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToCreate + .TransformQuantity.Round.DOWN) + .build()) + .setUnitAmount("unit_amount") + .build()) + .addRatesToDelete( + com.stripe.param.v2.billing.RateCardModifyRatesParams.RatesToDelete.builder() + .setId("obj_123") + .build()) + .build(); + + com.stripe.model.v2.billing.RateCardVersion rateCardVersion = + client.v2().billing().rateCards().modifyRates("id_123", params); + assertNotNull(rateCardVersion); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/rate_cards/id_123/modify_rates", + params.toMap(), + null); + } + @Test public void testV2BillingRateCardsCustomPricingUnitOverageRateGetServices() throws StripeException { @@ -27588,6 +27656,35 @@ public void testV2CoreAccountsPersonTokenGetServices() throws StripeException { null); } + @Test + public void testV2CoreAccountEvaluationPostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/account_evaluations", + null, + null, + com.stripe.model.v2.core.AccountEvaluation.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"evaluations_triggered\":[\"fraudulent_website\"],\"id\":\"obj_123\",\"object\":\"v2.core.account_evaluation\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.AccountEvaluationCreateParams params = + com.stripe.param.v2.core.AccountEvaluationCreateParams.builder() + .addSignal( + com.stripe.param.v2.core.AccountEvaluationCreateParams.Signal.FRAUDULENT_WEBSITE) + .build(); + + com.stripe.model.v2.core.AccountEvaluation accountEvaluation = + client.v2().core().accountEvaluations().create(params); + assertNotNull(accountEvaluation); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/account_evaluations", + params.toMap(), + null); + } + @Test public void testV2CoreAccountLinkPostServices() throws StripeException { stubRequest( @@ -27754,6 +27851,80 @@ public void testV2CoreAccountTokenGetServices() throws StripeException { null); } + @Test + public void testV2CoreBatchJobPostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs", + null, + null, + com.stripe.model.v2.core.BatchJob.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"maximum_rps\":1686015830,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.core.batch_job\",\"skip_validation\":true,\"status\":\"batch_failed\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.BatchJobCreateParams params = + com.stripe.param.v2.core.BatchJobCreateParams.builder() + .setEndpoint( + com.stripe.param.v2.core.BatchJobCreateParams.Endpoint.builder() + .setHttpMethod( + com.stripe.param.v2.core.BatchJobCreateParams.Endpoint.HttpMethod.POST) + .setPath("path") + .build()) + .putMetadata("key", "metadata") + .setSkipValidation(true) + .build(); + + com.stripe.model.v2.core.BatchJob batchJob = client.v2().core().batchJobs().create(params); + assertNotNull(batchJob); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs", + params.toMap(), + null); + } + + @Test + public void testV2CoreBatchJobGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/batch_jobs/id_123", + null, + null, + com.stripe.model.v2.core.BatchJob.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"maximum_rps\":1686015830,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.core.batch_job\",\"skip_validation\":true,\"status\":\"batch_failed\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.core.BatchJob batchJob = client.v2().core().batchJobs().retrieve("id_123"); + assertNotNull(batchJob); + verifyRequest( + BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/batch_jobs/id_123", null, null); + } + + @Test + public void testV2CoreBatchJobPost2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs/id_123/cancel", + null, + null, + com.stripe.model.v2.core.BatchJob.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"maximum_rps\":1686015830,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.core.batch_job\",\"skip_validation\":true,\"status\":\"batch_failed\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.core.BatchJob batchJob = client.v2().core().batchJobs().cancel("id_123"); + assertNotNull(batchJob); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/batch_jobs/id_123/cancel", + null, + null); + } + @Test public void testV2CoreClaimableSandboxPostServices() throws StripeException { stubRequest( @@ -28124,7 +28295,7 @@ public void testV2CoreVaultGbBankAccountGetServices() throws StripeException { 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}"); + "{\"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\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.GbBankAccountListParams params = @@ -28150,13 +28321,12 @@ public void testV2CoreVaultGbBankAccountPostServices() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"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}"); + "{\"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\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.GbBankAccountCreateParams params = com.stripe.param.v2.core.vault.GbBankAccountCreateParams.builder() - .setAccountNumber("account_number") - .setSortCode("sort_code") + .setCurrency("usd") .build(); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -28179,7 +28349,7 @@ public void testV2CoreVaultGbBankAccountGet2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"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}"); + "{\"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\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -28202,7 +28372,7 @@ public void testV2CoreVaultGbBankAccountPost2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"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}"); + "{\"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\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -28225,7 +28395,7 @@ public void testV2CoreVaultGbBankAccountPost3Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"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}"); + "{\"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\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.GbBankAccount gbBankAccount = @@ -28248,7 +28418,7 @@ public void testV2CoreVaultGbBankAccountPost4Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.GbBankAccount.class, - "{\"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}"); + "{\"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\",\"supported_currencies\":[\"supported_currencies\"],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.GbBankAccountInitiateConfirmationOfPayeeParams params = @@ -28277,7 +28447,7 @@ public void testV2CoreVaultUsBankAccountGetServices() throws StripeException { 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}"); + "{\"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\",\"supported_currencies\":[\"supported_currencies\"],\"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 = @@ -28303,12 +28473,13 @@ 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\",\"verification\":{\"status\":\"verification_failed\"},\"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\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -28331,7 +28502,7 @@ public void testV2CoreVaultUsBankAccountGet2Services() 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\",\"verification\":{\"status\":\"verification_failed\"},\"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\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -28354,7 +28525,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\",\"verification\":{\"status\":\"verification_failed\"},\"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\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountUpdateParams params = @@ -28380,7 +28551,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\",\"verification\":{\"status\":\"verification_failed\"},\"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\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -28403,7 +28574,7 @@ public void testV2CoreVaultUsBankAccountPost4Services() 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\",\"verification\":{\"status\":\"verification_failed\"},\"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\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountConfirmMicrodepositsParams params = @@ -28429,7 +28600,7 @@ public void testV2CoreVaultUsBankAccountPost5Services() 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\",\"verification\":{\"status\":\"verification_failed\"},\"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\",\"supported_currencies\":[\"supported_currencies\"],\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -28590,7 +28761,7 @@ public void testV2MoneyManagementAdjustmentGetServices() throws StripeException new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.Adjustment>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.adjustment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.adjustment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.AdjustmentListParams params = @@ -28616,7 +28787,7 @@ public void testV2MoneyManagementAdjustmentGet2Services() throws StripeException null, null, com.stripe.model.v2.moneymanagement.Adjustment.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.adjustment\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.adjustment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.Adjustment adjustment = @@ -28641,7 +28812,7 @@ public void testV2MoneyManagementCurrencyConversionGetServices() throws StripeEx new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.CurrencyConversion>>() {}.getType(), - "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"exchange_rate\":\"exchange_rate\",\"financial_account\":\"financial_account\",\"from\":{\"amount\":{\"value\":111972721,\"currency\":\"usd\"}},\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.money_management.currency_conversion\",\"to\":{\"amount\":{\"value\":111972721,\"currency\":\"usd\"}}}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"exchange_rate\":\"exchange_rate\",\"financial_account\":\"financial_account\",\"from\":{\"amount\":{\"currency\":\"USD\",\"value\":96}},\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.money_management.currency_conversion\",\"to\":{\"amount\":{\"currency\":\"USD\",\"value\":96}}}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.CurrencyConversionListParams params = @@ -28667,7 +28838,7 @@ public void testV2MoneyManagementCurrencyConversionPostServices() throws StripeE null, null, com.stripe.model.v2.moneymanagement.CurrencyConversion.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"exchange_rate\":\"exchange_rate\",\"financial_account\":\"financial_account\",\"from\":{\"amount\":{\"value\":111972721,\"currency\":\"usd\"}},\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.money_management.currency_conversion\",\"to\":{\"amount\":{\"value\":111972721,\"currency\":\"usd\"}}}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"exchange_rate\":\"exchange_rate\",\"financial_account\":\"financial_account\",\"from\":{\"amount\":{\"currency\":\"USD\",\"value\":96}},\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.money_management.currency_conversion\",\"to\":{\"amount\":{\"currency\":\"USD\",\"value\":96}}}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.CurrencyConversionCreateParams params = @@ -28675,22 +28846,12 @@ public void testV2MoneyManagementCurrencyConversionPostServices() throws StripeE .setFinancialAccount("financial_account") .setFrom( com.stripe.param.v2.moneymanagement.CurrencyConversionCreateParams.From.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.CurrencyConversionCreateParams.From - .Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setCurrency("usd") .build()) .setTo( com.stripe.param.v2.moneymanagement.CurrencyConversionCreateParams.To.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.CurrencyConversionCreateParams.To.Amount - .builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setCurrency("usd") .build()) .build(); @@ -28715,7 +28876,7 @@ public void testV2MoneyManagementCurrencyConversionGet2Services() throws StripeE null, null, com.stripe.model.v2.moneymanagement.CurrencyConversion.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"exchange_rate\":\"exchange_rate\",\"financial_account\":\"financial_account\",\"from\":{\"amount\":{\"value\":111972721,\"currency\":\"usd\"}},\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.money_management.currency_conversion\",\"to\":{\"amount\":{\"value\":111972721,\"currency\":\"usd\"}}}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"exchange_rate\":\"exchange_rate\",\"financial_account\":\"financial_account\",\"from\":{\"amount\":{\"currency\":\"USD\",\"value\":96}},\"id\":\"obj_123\",\"livemode\":true,\"object\":\"v2.money_management.currency_conversion\",\"to\":{\"amount\":{\"currency\":\"USD\",\"value\":96}}}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.CurrencyConversion currencyConversion = @@ -28740,7 +28901,7 @@ public void testV2MoneyManagementFinancialAccountGetServices() throws StripeExce new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.FinancialAccount>>() {}.getType(), - "{\"data\":[{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"payments\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"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\":\"payments\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.FinancialAccountListParams params = @@ -28766,7 +28927,7 @@ public void testV2MoneyManagementFinancialAccountPostServices() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.FinancialAccount.class, - "{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"payments\",\"livemode\":true}"); + "{\"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\":\"payments\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.FinancialAccountCreateParams params = @@ -28794,17 +28955,20 @@ public void testV2MoneyManagementFinancialAccountGet2Services() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.FinancialAccount.class, - "{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"payments\",\"livemode\":true}"); + "{\"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\":\"payments\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); + com.stripe.param.v2.moneymanagement.FinancialAccountRetrieveParams params = + com.stripe.param.v2.moneymanagement.FinancialAccountRetrieveParams.builder().build(); + com.stripe.model.v2.moneymanagement.FinancialAccount financialAccount = - client.v2().moneyManagement().financialAccounts().retrieve("id_123"); + client.v2().moneyManagement().financialAccounts().retrieve("id_123", params); assertNotNull(financialAccount); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/money_management/financial_accounts/id_123", - null, + params.toMap(), null); } @@ -28817,7 +28981,7 @@ public void testV2MoneyManagementFinancialAccountPost2Services() throws StripeEx null, null, com.stripe.model.v2.moneymanagement.FinancialAccount.class, - "{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"payments\",\"livemode\":true}"); + "{\"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\":\"payments\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams params = @@ -28843,7 +29007,7 @@ public void testV2MoneyManagementFinancialAccountPost3Services() throws StripeEx null, null, com.stripe.model.v2.moneymanagement.FinancialAccount.class, - "{\"balance\":{\"available\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"inbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}},\"outbound_pending\":{\"key\":{\"value\":111972721,\"currency\":\"usd\"}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"payments\",\"livemode\":true}"); + "{\"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\":\"payments\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.FinancialAccountCloseParams params = @@ -28956,7 +29120,7 @@ public void testV2MoneyManagementInboundTransferGetServices() throws StripeExcep new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.InboundTransfer>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.InboundTransferListParams params = @@ -28982,16 +29146,12 @@ public void testV2MoneyManagementInboundTransferPostServices() throws StripeExce null, null, com.stripe.model.v2.moneymanagement.InboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.InboundTransferCreateParams params = com.stripe.param.v2.moneymanagement.InboundTransferCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.InboundTransferCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.InboundTransferCreateParams.From.builder() .setCurrency("usd") @@ -29024,7 +29184,7 @@ public void testV2MoneyManagementInboundTransferGet2Services() throws StripeExce null, null, com.stripe.model.v2.moneymanagement.InboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"payment_method\":{\"type\":\"type\"}},\"id\":\"obj_123\",\"object\":\"v2.money_management.inbound_transfer\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"financial_account\":\"financial_account\"},\"transfer_history\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"level\":\"canonical\",\"type\":\"bank_debit_failed\"}],\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.InboundTransfer inboundTransfer = @@ -29049,7 +29209,7 @@ public void testV2MoneyManagementOutboundPaymentGetServices() throws StripeExcep new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.OutboundPayment>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundPaymentListParams params = @@ -29075,16 +29235,12 @@ public void testV2MoneyManagementOutboundPaymentPostServices() throws StripeExce null, null, com.stripe.model.v2.moneymanagement.OutboundPayment.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams params = com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.From.builder() .setCurrency("usd") @@ -29118,7 +29274,7 @@ public void testV2MoneyManagementOutboundPaymentGet2Services() throws StripeExce null, null, com.stripe.model.v2.moneymanagement.OutboundPayment.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundPayment outboundPayment = @@ -29141,7 +29297,7 @@ public void testV2MoneyManagementOutboundPaymentPost2Services() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.OutboundPayment.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment\",\"recipient_notification\":{\"setting\":\"configured\"},\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundPayment outboundPayment = @@ -29164,17 +29320,12 @@ public void testV2MoneyManagementOutboundPaymentQuotePostServices() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundPaymentQuote.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"next_day_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams params = com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams.Amount - .builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundPaymentQuoteCreateParams.From.builder() .setCurrency("usd") @@ -29208,7 +29359,7 @@ public void testV2MoneyManagementOutboundPaymentQuoteGetServices() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundPaymentQuote.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"type\":\"cross_border_payout_fee\"}],\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"estimated_fees\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"type\":\"next_day_payout_fee\"}],\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"fx_quote\":{\"lock_duration\":\"five_minutes\",\"lock_status\":\"active\",\"rates\":{\"key\":{\"exchange_rate\":\"exchange_rate\"}},\"to_currency\":\"usd\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_payment_quote\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\",\"recipient\":\"recipient\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundPaymentQuote outboundPaymentQuote = @@ -29233,7 +29384,7 @@ public void testV2MoneyManagementOutboundSetupIntentGetServices() throws StripeE new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.OutboundSetupIntent>>() {}.getType(), - "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundSetupIntentListParams params = @@ -29259,7 +29410,7 @@ public void testV2MoneyManagementOutboundSetupIntentPostServices() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundSetupIntentCreateParams params = @@ -29285,7 +29436,7 @@ public void testV2MoneyManagementOutboundSetupIntentGet2Services() throws Stripe null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundSetupIntent outboundSetupIntent = @@ -29308,7 +29459,7 @@ public void testV2MoneyManagementOutboundSetupIntentPost2Services() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundSetupIntentUpdateParams params = @@ -29334,7 +29485,7 @@ public void testV2MoneyManagementOutboundSetupIntentPost3Services() throws Strip null, null, com.stripe.model.v2.moneymanagement.OutboundSetupIntent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_setup_intent\",\"payout_method\":{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true},\"status\":\"requires_payout_method\",\"usage_intent\":\"payment\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundSetupIntent outboundSetupIntent = @@ -29359,7 +29510,7 @@ public void testV2MoneyManagementOutboundTransferGetServices() throws StripeExce new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.OutboundTransfer>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundTransferListParams params = @@ -29385,16 +29536,12 @@ public void testV2MoneyManagementOutboundTransferPostServices() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.OutboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.OutboundTransferCreateParams params = com.stripe.param.v2.moneymanagement.OutboundTransferCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundTransferCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundTransferCreateParams.From.builder() .setCurrency("usd") @@ -29427,7 +29574,7 @@ public void testV2MoneyManagementOutboundTransferGet2Services() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.OutboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundTransfer outboundTransfer = @@ -29450,7 +29597,7 @@ public void testV2MoneyManagementOutboundTransferPost2Services() throws StripeEx null, null, com.stripe.model.v2.moneymanagement.OutboundTransfer.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"value\":111972721,\"currency\":\"usd\"},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"value\":111972721,\"currency\":\"usd\"},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"cancelable\":true,\"created\":\"1970-01-12T21:42:34.472Z\",\"from\":{\"debited\":{\"currency\":\"USD\",\"value\":55},\"financial_account\":\"financial_account\"},\"id\":\"obj_123\",\"object\":\"v2.money_management.outbound_transfer\",\"statement_descriptor\":\"statement_descriptor\",\"status\":\"canceled\",\"to\":{\"credited\":{\"currency\":\"USD\",\"value\":68},\"payout_method\":\"payout_method\"},\"trace_id\":{\"status\":\"pending\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.OutboundTransfer outboundTransfer = @@ -29475,7 +29622,7 @@ public void testV2MoneyManagementPayoutMethodGetServices() throws StripeExceptio new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.PayoutMethod>>() {}.getType(), - "{\"data\":[{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.PayoutMethodListParams params = @@ -29501,7 +29648,7 @@ public void testV2MoneyManagementPayoutMethodGet2Services() throws StripeExcepti null, null, com.stripe.model.v2.moneymanagement.PayoutMethod.class, - "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); + "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.PayoutMethod payoutMethod = @@ -29524,7 +29671,7 @@ public void testV2MoneyManagementPayoutMethodPostServices() throws StripeExcepti null, null, com.stripe.model.v2.moneymanagement.PayoutMethod.class, - "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); + "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.PayoutMethod payoutMethod = @@ -29547,7 +29694,7 @@ public void testV2MoneyManagementPayoutMethodPost2Services() throws StripeExcept null, null, com.stripe.model.v2.moneymanagement.PayoutMethod.class, - "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); + "{\"available_payout_speeds\":[\"standard\"],\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.payout_method\",\"restricted\":true,\"type\":\"bank_account\",\"usage_status\":{\"payments\":\"requires_action\",\"transfers\":\"invalid\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.PayoutMethod payoutMethod = @@ -29600,7 +29747,7 @@ public void testV2MoneyManagementReceivedCreditGetServices() throws StripeExcept new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.ReceivedCredit>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.ReceivedCreditListParams params = @@ -29626,7 +29773,7 @@ public void testV2MoneyManagementReceivedCreditGet2Services() throws StripeExcep null, null, com.stripe.model.v2.moneymanagement.ReceivedCredit.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_credit\",\"status\":\"returned\",\"type\":\"balance_transfer\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.ReceivedCredit receivedCredit = @@ -29651,7 +29798,7 @@ public void testV2MoneyManagementReceivedDebitGetServices() throws StripeExcepti new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.ReceivedDebit>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"balance_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"balance_transfer\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.ReceivedDebitListParams params = @@ -29677,7 +29824,7 @@ public void testV2MoneyManagementReceivedDebitGet2Services() throws StripeExcept null, null, com.stripe.model.v2.moneymanagement.ReceivedDebit.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"balance_transfer\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.received_debit\",\"status\":\"canceled\",\"type\":\"balance_transfer\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.ReceivedDebit receivedDebit = @@ -29776,7 +29923,7 @@ public void testV2MoneyManagementTransactionGetServices() throws StripeException new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.Transaction>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"balance_impact\":{\"available\":{\"value\":111972721,\"currency\":\"usd\"},\"inbound_pending\":{\"value\":111972721,\"currency\":\"usd\"},\"outbound_pending\":{\"value\":111972721,\"currency\":\"usd\"}},\"category\":\"received_debit_reversal\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction\",\"status\":\"pending\",\"status_transitions\":{},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"category\":\"received_debit_reversal\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction\",\"status\":\"pending\",\"status_transitions\":{},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.TransactionListParams params = @@ -29802,7 +29949,7 @@ public void testV2MoneyManagementTransactionGet2Services() throws StripeExceptio null, null, com.stripe.model.v2.moneymanagement.Transaction.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"balance_impact\":{\"available\":{\"value\":111972721,\"currency\":\"usd\"},\"inbound_pending\":{\"value\":111972721,\"currency\":\"usd\"},\"outbound_pending\":{\"value\":111972721,\"currency\":\"usd\"}},\"category\":\"received_debit_reversal\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction\",\"status\":\"pending\",\"status_transitions\":{},\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"category\":\"received_debit_reversal\",\"created\":\"1970-01-12T21:42:34.472Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction\",\"status\":\"pending\",\"status_transitions\":{},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.Transaction transaction = @@ -29827,7 +29974,7 @@ public void testV2MoneyManagementTransactionEntryGetServices() throws StripeExce new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.moneymanagement.TransactionEntry>>() {}.getType(), - "{\"data\":[{\"balance_impact\":{\"available\":{\"value\":111972721,\"currency\":\"usd\"},\"inbound_pending\":{\"value\":111972721,\"currency\":\"usd\"},\"outbound_pending\":{\"value\":111972721,\"currency\":\"usd\"}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction_entry\",\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit_reversal\",\"financial_account\":\"financial_account\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction_entry\",\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit_reversal\",\"financial_account\":\"financial_account\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.moneymanagement.TransactionEntryListParams params = @@ -29853,7 +30000,7 @@ public void testV2MoneyManagementTransactionEntryGet2Services() throws StripeExc null, null, com.stripe.model.v2.moneymanagement.TransactionEntry.class, - "{\"balance_impact\":{\"available\":{\"value\":111972721,\"currency\":\"usd\"},\"inbound_pending\":{\"value\":111972721,\"currency\":\"usd\"},\"outbound_pending\":{\"value\":111972721,\"currency\":\"usd\"}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction_entry\",\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit_reversal\",\"financial_account\":\"financial_account\"},\"livemode\":true}"); + "{\"balance_impact\":{\"available\":{\"currency\":\"USD\",\"value\":35},\"inbound_pending\":{\"currency\":\"USD\",\"value\":11},\"outbound_pending\":{\"currency\":\"USD\",\"value\":60}},\"created\":\"1970-01-12T21:42:34.472Z\",\"effective_at\":\"1970-01-03T20:38:28.043Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.transaction_entry\",\"transaction\":\"transaction\",\"transaction_details\":{\"category\":\"received_debit_reversal\",\"financial_account\":\"financial_account\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.moneymanagement.TransactionEntry transactionEntry = @@ -29878,7 +30025,7 @@ public void testV2PaymentsOffSessionPaymentGetServices() throws StripeException new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.payments.OffSessionPayment>>() {}.getType(), - "{\"data\":[{\"amount_requested\":{\"value\":111972721,\"currency\":\"usd\"},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.OffSessionPaymentListParams params = @@ -29904,16 +30051,12 @@ public void testV2PaymentsOffSessionPaymentPostServices() throws StripeException null, null, com.stripe.model.v2.payments.OffSessionPayment.class, - "{\"amount_requested\":{\"value\":111972721,\"currency\":\"usd\"},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); + "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.OffSessionPaymentCreateParams params = com.stripe.param.v2.payments.OffSessionPaymentCreateParams.builder() - .setAmount( - com.stripe.param.v2.payments.OffSessionPaymentCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setCadence( com.stripe.param.v2.payments.OffSessionPaymentCreateParams.Cadence.UNSCHEDULED) .setCustomer("customer") @@ -29940,7 +30083,7 @@ public void testV2PaymentsOffSessionPaymentGet2Services() throws StripeException null, null, com.stripe.model.v2.payments.OffSessionPayment.class, - "{\"amount_requested\":{\"value\":111972721,\"currency\":\"usd\"},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); + "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.payments.OffSessionPayment offSessionPayment = @@ -29963,7 +30106,7 @@ public void testV2PaymentsOffSessionPaymentPost2Services() throws StripeExceptio null, null, com.stripe.model.v2.payments.OffSessionPayment.class, - "{\"amount_requested\":{\"value\":111972721,\"currency\":\"usd\"},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); + "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.payments.OffSessionPayment offSessionPayment = @@ -29986,7 +30129,7 @@ public void testV2PaymentsOffSessionPaymentPost3Services() throws StripeExceptio null, null, com.stripe.model.v2.payments.OffSessionPayment.class, - "{\"amount_requested\":{\"value\":111972721,\"currency\":\"usd\"},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); + "{\"amount_requested\":{\"currency\":\"USD\",\"value\":47},\"cadence\":\"unscheduled\",\"compartment_id\":\"compartment_id\",\"created\":\"1970-01-12T21:42:34.472Z\",\"customer\":\"customer\",\"id\":\"obj_123\",\"livemode\":true,\"metadata\":{\"key\":\"metadata\"},\"object\":\"v2.payments.off_session_payment\",\"payment_method\":\"payment_method\",\"payments_orchestration\":{\"enabled\":true},\"retry_details\":{\"attempts\":542738246,\"retry_strategy\":\"scheduled\"},\"status\":\"pending\"}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.OffSessionPaymentCaptureParams params = @@ -30016,7 +30159,7 @@ public void testV2PaymentsSettlementAllocationIntentGetServices() throws StripeE new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.payments.SettlementAllocationIntent>>() {}.getType(), - "{\"data\":[{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.SettlementAllocationIntentListParams params = @@ -30042,16 +30185,12 @@ public void testV2PaymentsSettlementAllocationIntentPostServices() throws Stripe null, null, com.stripe.model.v2.payments.SettlementAllocationIntent.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.SettlementAllocationIntentCreateParams params = com.stripe.param.v2.payments.SettlementAllocationIntentCreateParams.builder() - .setAmount( - com.stripe.param.v2.payments.SettlementAllocationIntentCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setExpectedSettlementDate(Instant.parse("1970-01-22T14:14:13.629Z")) .setFinancialAccount("financial_account") .setReference("reference") @@ -30077,7 +30216,7 @@ public void testV2PaymentsSettlementAllocationIntentGet2Services() throws Stripe null, null, com.stripe.model.v2.payments.SettlementAllocationIntent.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.payments.SettlementAllocationIntent settlementAllocationIntent = @@ -30100,7 +30239,7 @@ public void testV2PaymentsSettlementAllocationIntentPost2Services() throws Strip null, null, com.stripe.model.v2.payments.SettlementAllocationIntent.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.SettlementAllocationIntentUpdateParams params = @@ -30126,7 +30265,7 @@ public void testV2PaymentsSettlementAllocationIntentPost3Services() throws Strip null, null, com.stripe.model.v2.payments.SettlementAllocationIntent.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.payments.SettlementAllocationIntent settlementAllocationIntent = @@ -30149,7 +30288,7 @@ public void testV2PaymentsSettlementAllocationIntentPost4Services() throws Strip null, null, com.stripe.model.v2.payments.SettlementAllocationIntent.class, - "{\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); + "{\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"expected_settlement_date\":\"1970-01-22T14:14:13.629Z\",\"financial_account\":\"financial_account\",\"id\":\"obj_123\",\"linked_credits\":[\"linked_credits\"],\"object\":\"v2.payments.settlement_allocation_intent\",\"reference\":\"reference\",\"status\":\"canceled\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.payments.SettlementAllocationIntent settlementAllocationIntent = @@ -30174,7 +30313,7 @@ public void testV2PaymentsSettlementAllocationIntentsSplitGetServices() throws S new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.payments.SettlementAllocationIntentSplit>>() {}.getType(), - "{\"data\":[{\"account\":\"account\",\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.payments.settlement_allocation_intent_split\",\"settlement_allocation_intent\":\"settlement_allocation_intent\",\"status\":\"canceled\",\"type\":\"credit\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"account\":\"account\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.payments.settlement_allocation_intent_split\",\"settlement_allocation_intent\":\"settlement_allocation_intent\",\"status\":\"canceled\",\"type\":\"credit\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.settlementallocationintents.SplitListParams params = @@ -30207,18 +30346,13 @@ public void testV2PaymentsSettlementAllocationIntentsSplitPostServices() throws null, null, com.stripe.model.v2.payments.SettlementAllocationIntentSplit.class, - "{\"account\":\"account\",\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.payments.settlement_allocation_intent_split\",\"settlement_allocation_intent\":\"settlement_allocation_intent\",\"status\":\"canceled\",\"type\":\"credit\",\"livemode\":true}"); + "{\"account\":\"account\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.payments.settlement_allocation_intent_split\",\"settlement_allocation_intent\":\"settlement_allocation_intent\",\"status\":\"canceled\",\"type\":\"credit\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.payments.settlementallocationintents.SplitCreateParams params = com.stripe.param.v2.payments.settlementallocationintents.SplitCreateParams.builder() .setAccount("account") - .setAmount( - com.stripe.param.v2.payments.settlementallocationintents.SplitCreateParams.Amount - .builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setType( com.stripe.param.v2.payments.settlementallocationintents.SplitCreateParams.Type .CREDIT) @@ -30249,7 +30383,7 @@ public void testV2PaymentsSettlementAllocationIntentsSplitGet2Services() throws null, null, com.stripe.model.v2.payments.SettlementAllocationIntentSplit.class, - "{\"account\":\"account\",\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.payments.settlement_allocation_intent_split\",\"settlement_allocation_intent\":\"settlement_allocation_intent\",\"status\":\"canceled\",\"type\":\"credit\",\"livemode\":true}"); + "{\"account\":\"account\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.payments.settlement_allocation_intent_split\",\"settlement_allocation_intent\":\"settlement_allocation_intent\",\"status\":\"canceled\",\"type\":\"credit\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.payments.SettlementAllocationIntentSplit settlementAllocationIntentSplit = @@ -30277,7 +30411,7 @@ public void testV2PaymentsSettlementAllocationIntentsSplitPost2Services() throws null, null, com.stripe.model.v2.payments.SettlementAllocationIntentSplit.class, - "{\"account\":\"account\",\"amount\":{\"value\":111972721,\"currency\":\"usd\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.payments.settlement_allocation_intent_split\",\"settlement_allocation_intent\":\"settlement_allocation_intent\",\"status\":\"canceled\",\"type\":\"credit\",\"livemode\":true}"); + "{\"account\":\"account\",\"amount\":{\"currency\":\"USD\",\"value\":96},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.payments.settlement_allocation_intent_split\",\"settlement_allocation_intent\":\"settlement_allocation_intent\",\"status\":\"canceled\",\"type\":\"credit\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.payments.SettlementAllocationIntentSplit settlementAllocationIntentSplit = @@ -30393,7 +30527,7 @@ public void testV2TaxManualRuleGetServices() throws StripeException { new TypeToken< com.stripe.model.v2.StripeCollection< com.stripe.model.v2.tax.ManualRule>>() {}.getType(), - "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"percentage\"}]}],\"status\":\"active\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"614555204\"}]}],\"status\":\"active\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.tax.ManualRuleListParams params = @@ -30419,7 +30553,7 @@ public void testV2TaxManualRulePostServices() throws StripeException { null, null, com.stripe.model.v2.tax.ManualRule.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"percentage\"}]}],\"status\":\"active\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"614555204\"}]}],\"status\":\"active\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.tax.ManualRuleCreateParams params = @@ -30433,7 +30567,7 @@ public void testV2TaxManualRulePostServices() throws StripeException { .setDescription("description") .setDisplayName("display_name") .setJurisdiction("jurisdiction") - .setPercentage("percentage") + .setPercentage(new BigDecimal("614555204")) .setState("state") .build()) .setStartsAt(Instant.parse("1970-01-25T15:13:01.215Z")) @@ -30459,7 +30593,7 @@ public void testV2TaxManualRuleGet2Services() throws StripeException { null, null, com.stripe.model.v2.tax.ManualRule.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"percentage\"}]}],\"status\":\"active\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"614555204\"}]}],\"status\":\"active\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.tax.ManualRule manualRule = @@ -30478,7 +30612,7 @@ public void testV2TaxManualRulePost2Services() throws StripeException { null, null, com.stripe.model.v2.tax.ManualRule.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"percentage\"}]}],\"status\":\"active\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"614555204\"}]}],\"status\":\"active\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.tax.ManualRuleUpdateParams params = @@ -30492,7 +30626,7 @@ public void testV2TaxManualRulePost2Services() throws StripeException { .setDescription("description") .setDisplayName("display_name") .setJurisdiction("jurisdiction") - .setPercentage("percentage") + .setPercentage(new BigDecimal("614555204")) .setState("state") .build()) .setStartsAt(Instant.parse("1970-01-25T15:13:01.215Z")) @@ -30519,7 +30653,7 @@ public void testV2TaxManualRulePost3Services() throws StripeException { null, null, com.stripe.model.v2.tax.ManualRule.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"percentage\"}]}],\"status\":\"active\",\"livemode\":true}"); + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.tax.manual_rule\",\"products\":[{\"type\":\"licensed_item\"}],\"scheduled_tax_rates\":[{\"rates\":[{\"display_name\":\"display_name\",\"percentage\":\"614555204\"}]}],\"status\":\"active\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.tax.ManualRule manualRule = @@ -30547,11 +30681,7 @@ public void testV2TestHelpersFinancialAddressPostServices() throws StripeExcepti com.stripe.param.v2.testhelpers.FinancialAddressCreditParams params = com.stripe.param.v2.testhelpers.FinancialAddressCreditParams.builder() - .setAmount( - com.stripe.param.v2.testhelpers.FinancialAddressCreditParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setNetwork(com.stripe.param.v2.testhelpers.FinancialAddressCreditParams.Network.ACH) .build(); @@ -30575,7 +30705,7 @@ public void testV2TestHelpersFinancialAddressPost2Services() throws StripeExcept null, null, com.stripe.model.v2.FinancialAddressGeneratedMicrodeposits.class, - "{\"amounts\":[{\"value\":111972721,\"currency\":\"usd\"}],\"object\":\"financial_address_generated_microdeposits\",\"status\":\"accepted\",\"livemode\":true}"); + "{\"amounts\":[{\"currency\":\"USD\",\"value\":1}],\"object\":\"financial_address_generated_microdeposits\",\"status\":\"accepted\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.FinancialAddressGeneratedMicrodeposits @@ -30693,6 +30823,7 @@ public void testBlockedByStripeErrorServices() throws StripeException { com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); try { @@ -30849,11 +30980,7 @@ public void testInsufficientFundsErrorServices() throws StripeException { com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams params = com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.From.builder() .setCurrency("usd") @@ -30894,6 +31021,7 @@ public void testInvalidPaymentMethodErrorServices() throws StripeException { com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); try { @@ -31009,6 +31137,7 @@ public void testQuotaExceededErrorServices() throws StripeException { com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = com.stripe.param.v2.core.vault.UsBankAccountCreateParams.builder() .setAccountNumber("account_number") + .setCurrency("usd") .build(); try { @@ -31064,11 +31193,7 @@ public void testRecipientNotNotifiableErrorServices() throws StripeException { com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams params = com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.builder() - .setAmount( - com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.Amount.builder() - .setValue(111972721L) - .setCurrency("usd") - .build()) + .setAmount(new com.stripe.v2.Amount(96, "USD")) .setFrom( com.stripe.param.v2.moneymanagement.OutboundPaymentCreateParams.From.builder() .setCurrency("usd") diff --git a/src/test/java/com/stripe/net/WebhookTest.java b/src/test/java/com/stripe/net/WebhookTest.java index c6a9c89aa77..3e1357b6bf3 100644 --- a/src/test/java/com/stripe/net/WebhookTest.java +++ b/src/test/java/com/stripe/net/WebhookTest.java @@ -335,4 +335,42 @@ public void testConstructEventWithRawJson() assertNotNull(event.getRawJsonObject()); } + + @Test + public void testConstructEventRejectsV2Payload() + throws NoSuchAlgorithmException, InvalidKeyException { + final String v2Payload = + "{\n \"id\": \"evt_test_webhook\",\n \"object\": \"v2.core.event\"\n}"; + final Map options = new HashMap<>(); + options.put("payload", v2Payload); + final String sigHeader = generateSigHeader(options); + + Throwable exception = + assertThrows( + IllegalArgumentException.class, + () -> { + Webhook.constructEvent(v2Payload, sigHeader, secret); + }); + assertTrue(exception.getMessage().contains("StripeClient.parseEventNotification")); + } + + @Test + public void testClientConstructEventRejectsV2Payload() + throws NoSuchAlgorithmException, InvalidKeyException { + StripeClient client = new StripeClient(new LiveStripeResponseGetter()); + + final String v2Payload = + "{\n \"id\": \"evt_test_webhook\",\n \"object\": \"v2.core.event\"\n}"; + final Map options = new HashMap<>(); + options.put("payload", v2Payload); + final String sigHeader = generateSigHeader(options); + + Throwable exception = + assertThrows( + IllegalArgumentException.class, + () -> { + client.constructEvent(v2Payload, sigHeader, secret); + }); + assertTrue(exception.getMessage().contains("StripeClient.parseEventNotification")); + } }