diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index faffe73c57..c63a3302e6 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -ee56c4b73d856e48409065f8d7e7c82c2e805c38 \ No newline at end of file +61e410d24d6de541c86c48b265b7647c164457ee \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index abf60f2064..5e8e56a7f8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2143 \ No newline at end of file +v2151 \ No newline at end of file diff --git a/src/Stripe.net/Events/V2CoreAccountClosedEvent.cs b/src/Stripe.net/Events/V2CoreAccountClosedEvent.cs new file mode 100644 index 0000000000..d43945ac26 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountClosedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// This event occurs when an account is closed. + /// + public class V2CoreAccountClosedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountClosedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountClosedEventNotification.cs new file mode 100644 index 0000000000..3dbf62fee1 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountClosedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// This event occurs when an account is closed. + /// + public class V2CoreAccountClosedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountClosedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountCreatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountCreatedEvent.cs new file mode 100644 index 0000000000..c397561ae9 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountCreatedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account is created. + /// + public class V2CoreAccountCreatedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountCreatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountCreatedEventNotification.cs new file mode 100644 index 0000000000..f81ce777b5 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountCreatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account is created. + /// + public class V2CoreAccountCreatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountCreatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.cs new file mode 100644 index 0000000000..9818f07ad8 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent.cs @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when the status of an Account's customer configuration capability is updated. + /// + public class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent : V2.Core.Event + { + /// + /// Data for the v2.core.account[configuration.customer].capability_status_updated event. + /// + [JsonProperty("data")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("data")] +#endif + + public V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData Data { get; set; } + + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData.cs new file mode 100644 index 0000000000..a4c6b8f375 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData.cs @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData : StripeEntity + { + /// + /// Open Enum. The capability which had its status updated. + /// + [JsonProperty("updated_capability")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("updated_capability")] +#endif + public string UpdatedCapability { get; set; } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification.cs new file mode 100644 index 0000000000..ef01cc5ea3 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when the status of an Account's customer configuration capability is updated. + /// + public class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.cs new file mode 100644 index 0000000000..c54d664a2d --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerUpdatedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account's customer configuration is updated. + /// + public class V2CoreAccountIncludingConfigurationCustomerUpdatedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification.cs new file mode 100644 index 0000000000..752c4cf5e1 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account's customer configuration is updated. + /// + public class V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingConfigurationCustomerUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.cs new file mode 100644 index 0000000000..592acceefd --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.cs @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when the status of an Account's merchant configuration capability is updated. + /// + public class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent : V2.Core.Event + { + /// + /// Data for the v2.core.account[configuration.merchant].capability_status_updated event. + /// + [JsonProperty("data")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("data")] +#endif + + public V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData Data { get; set; } + + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData.cs new file mode 100644 index 0000000000..270b462be1 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData.cs @@ -0,0 +1,36 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData : StripeEntity + { + /// + /// Open Enum. The capability which had its status updated. + /// One of: ach_debit_payments, acss_debit_payments, affirm_payments, + /// afterpay_clearpay_payments, alma_payments, amazon_pay_payments, + /// au_becs_debit_payments, bacs_debit_payments, bancontact_payments, + /// blik_payments, boleto_payments, card_payments, + /// cartes_bancaires_payments, cashapp_payments, eps_payments, + /// fpx_payments, gb_bank_transfer_payments, grabpay_payments, + /// ideal_payments, jcb_payments, jp_bank_transfer_payments, + /// kakao_pay_payments, klarna_payments, konbini_payments, + /// kr_card_payments, link_payments, mobilepay_payments, + /// multibanco_payments, mx_bank_transfer_payments, naver_pay_payments, + /// oxxo_payments, p24_payments, payco_payments, + /// paynow_payments, stripe_balance.payouts, pay_by_bank_payments, + /// promptpay_payments, revolut_pay_payments, samsung_pay_payments, + /// sepa_bank_transfer_payments, sepa_debit_payments, swish_payments, + /// twint_payments, us_bank_transfer_payments, or zip_payments. + /// + [JsonProperty("updated_capability")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("updated_capability")] +#endif + public string UpdatedCapability { get; set; } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification.cs new file mode 100644 index 0000000000..b2bb5f6966 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when the status of an Account's merchant configuration capability is updated. + /// + public class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.cs new file mode 100644 index 0000000000..39cb0217a3 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantUpdatedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account's merchant configuration is updated. + /// + public class V2CoreAccountIncludingConfigurationMerchantUpdatedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification.cs new file mode 100644 index 0000000000..9935464f3a --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account's merchant configuration is updated. + /// + public class V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingConfigurationMerchantUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.cs new file mode 100644 index 0000000000..142150c7fb --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent.cs @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when the status of an Account's recipient configuration capability is updated. + /// + public class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent : V2.Core.Event + { + /// + /// Data for the v2.core.account[configuration.recipient].capability_status_updated event. + /// + [JsonProperty("data")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("data")] +#endif + + public V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData Data { get; set; } + + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData.cs new file mode 100644 index 0000000000..6bc8b12b0b --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData.cs @@ -0,0 +1,24 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData : StripeEntity + { + /// + /// Open Enum. The capability which had its status updated. + /// One of: bank_accounts.local, bank_accounts.wire, cards, + /// stripe_balance.payouts, stripe_balance.stripe_transfers, or + /// stripe.transfers. + /// + [JsonProperty("updated_capability")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("updated_capability")] +#endif + public string UpdatedCapability { get; set; } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification.cs new file mode 100644 index 0000000000..3e45c25903 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when the status of an Account's recipient configuration capability is updated. + /// + public class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.cs new file mode 100644 index 0000000000..22dbf223d2 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientUpdatedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when a Recipient's configuration is updated. + /// + public class V2CoreAccountIncludingConfigurationRecipientUpdatedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification.cs new file mode 100644 index 0000000000..9550ca9e10 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when a Recipient's configuration is updated. + /// + public class V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingConfigurationRecipientUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingDefaultsUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingDefaultsUpdatedEvent.cs new file mode 100644 index 0000000000..8c5a08ca73 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingDefaultsUpdatedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// This event occurs when account defaults are created or updated. + /// + public class V2CoreAccountIncludingDefaultsUpdatedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingDefaultsUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingDefaultsUpdatedEventNotification.cs new file mode 100644 index 0000000000..8f334e8490 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingDefaultsUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// This event occurs when account defaults are created or updated. + /// + public class V2CoreAccountIncludingDefaultsUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingDefaultsUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingFutureRequirementsUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingFutureRequirementsUpdatedEvent.cs new file mode 100644 index 0000000000..58f6ca9135 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingFutureRequirementsUpdatedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account's future requirements are updated. + /// + public class V2CoreAccountIncludingFutureRequirementsUpdatedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.cs new file mode 100644 index 0000000000..313f4ae72b --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account's future requirements are updated. + /// + public class V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingFutureRequirementsUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingIdentityUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingIdentityUpdatedEvent.cs new file mode 100644 index 0000000000..6fc981fea7 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingIdentityUpdatedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Identity is updated. + /// + public class V2CoreAccountIncludingIdentityUpdatedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingIdentityUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingIdentityUpdatedEventNotification.cs new file mode 100644 index 0000000000..4cabf17085 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingIdentityUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Identity is updated. + /// + public class V2CoreAccountIncludingIdentityUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingIdentityUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingRequirementsUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountIncludingRequirementsUpdatedEvent.cs new file mode 100644 index 0000000000..9a53ef4645 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingRequirementsUpdatedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account's requirements are updated. + /// + public class V2CoreAccountIncludingRequirementsUpdatedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountIncludingRequirementsUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountIncludingRequirementsUpdatedEventNotification.cs new file mode 100644 index 0000000000..f376286770 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountIncludingRequirementsUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account's requirements are updated. + /// + public class V2CoreAccountIncludingRequirementsUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountIncludingRequirementsUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountLinkReturnedEvent.cs b/src/Stripe.net/Events/V2CoreAccountLinkReturnedEvent.cs new file mode 100644 index 0000000000..7fcec264d9 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountLinkReturnedEvent.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when the generated AccountLink is completed. + /// + public class V2CoreAccountLinkReturnedEvent : V2.Core.Event + { + /// + /// Data for the v2.core.account_link.returned event. + /// + [JsonProperty("data")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("data")] +#endif + + public V2CoreAccountLinkReturnedEventData Data { get; set; } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountLinkReturnedEventData.cs b/src/Stripe.net/Events/V2CoreAccountLinkReturnedEventData.cs new file mode 100644 index 0000000000..24c3ed510a --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountLinkReturnedEventData.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Collections.Generic; + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class V2CoreAccountLinkReturnedEventData : StripeEntity + { + /// + /// The ID of the v2 account. + /// + [JsonProperty("account_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("account_id")] +#endif + public string AccountId { get; set; } + + /// + /// Configurations on the Account that was onboarded via the account link. + /// One of: customer, merchant, or recipient. + /// + [JsonProperty("configurations")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("configurations")] +#endif + public List Configurations { get; set; } + + /// + /// Open Enum. The use case type of the account link that has been completed. + /// One of: account_onboarding, or account_update. + /// + [JsonProperty("use_case")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("use_case")] +#endif + public string UseCase { get; set; } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountLinkReturnedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountLinkReturnedEventNotification.cs new file mode 100644 index 0000000000..2304dd065f --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountLinkReturnedEventNotification.cs @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Stripe.V2; + + /// + /// Occurs when the generated AccountLink is completed. + /// + public class V2CoreAccountLinkReturnedEventNotification : V2.Core.EventNotification + { + public V2CoreAccountLinkReturnedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountPersonCreatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountPersonCreatedEvent.cs new file mode 100644 index 0000000000..470df0cde0 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountPersonCreatedEvent.cs @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when a Person is created. + /// + public class V2CoreAccountPersonCreatedEvent : V2.Core.Event + { + /// + /// Data for the v2.core.account_person.created event. + /// + [JsonProperty("data")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("data")] +#endif + + public V2CoreAccountPersonCreatedEventData Data { get; set; } + + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.AccountPerson FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountPersonCreatedEventData.cs b/src/Stripe.net/Events/V2CoreAccountPersonCreatedEventData.cs new file mode 100644 index 0000000000..4d552070cf --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountPersonCreatedEventData.cs @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class V2CoreAccountPersonCreatedEventData : StripeEntity + { + /// + /// The ID of the v2 account. + /// + [JsonProperty("account_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("account_id")] +#endif + public string AccountId { get; set; } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountPersonCreatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountPersonCreatedEventNotification.cs new file mode 100644 index 0000000000..c797a7e3f8 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountPersonCreatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when a Person is created. + /// + public class V2CoreAccountPersonCreatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.AccountPerson FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountPersonCreatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountPersonDeletedEvent.cs b/src/Stripe.net/Events/V2CoreAccountPersonDeletedEvent.cs new file mode 100644 index 0000000000..e56f2d7c1e --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountPersonDeletedEvent.cs @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when a Person is deleted. + /// + public class V2CoreAccountPersonDeletedEvent : V2.Core.Event + { + /// + /// Data for the v2.core.account_person.deleted event. + /// + [JsonProperty("data")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("data")] +#endif + + public V2CoreAccountPersonDeletedEventData Data { get; set; } + + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.AccountPerson FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountPersonDeletedEventData.cs b/src/Stripe.net/Events/V2CoreAccountPersonDeletedEventData.cs new file mode 100644 index 0000000000..5b4bc945d6 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountPersonDeletedEventData.cs @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class V2CoreAccountPersonDeletedEventData : StripeEntity + { + /// + /// The ID of the v2 account. + /// + [JsonProperty("account_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("account_id")] +#endif + public string AccountId { get; set; } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountPersonDeletedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountPersonDeletedEventNotification.cs new file mode 100644 index 0000000000..6b54afe7e0 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountPersonDeletedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when a Person is deleted. + /// + public class V2CoreAccountPersonDeletedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.AccountPerson FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountPersonDeletedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountPersonUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountPersonUpdatedEvent.cs new file mode 100644 index 0000000000..f80b34e325 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountPersonUpdatedEvent.cs @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when a Person is updated. + /// + public class V2CoreAccountPersonUpdatedEvent : V2.Core.Event + { + /// + /// Data for the v2.core.account_person.updated event. + /// + [JsonProperty("data")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("data")] +#endif + + public V2CoreAccountPersonUpdatedEventData Data { get; set; } + + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.AccountPerson FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountPersonUpdatedEventData.cs b/src/Stripe.net/Events/V2CoreAccountPersonUpdatedEventData.cs new file mode 100644 index 0000000000..b8fee08abb --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountPersonUpdatedEventData.cs @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + public class V2CoreAccountPersonUpdatedEventData : StripeEntity + { + /// + /// The ID of the v2 account. + /// + [JsonProperty("account_id")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("account_id")] +#endif + public string AccountId { get; set; } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountPersonUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountPersonUpdatedEventNotification.cs new file mode 100644 index 0000000000..ee7f00668f --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountPersonUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when a Person is updated. + /// + public class V2CoreAccountPersonUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.AccountPerson FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountPersonUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountUpdatedEvent.cs b/src/Stripe.net/Events/V2CoreAccountUpdatedEvent.cs new file mode 100644 index 0000000000..3727c810a9 --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountUpdatedEvent.cs @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account is updated. + /// + public class V2CoreAccountUpdatedEvent : V2.Core.Event + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + } +} diff --git a/src/Stripe.net/Events/V2CoreAccountUpdatedEventNotification.cs b/src/Stripe.net/Events/V2CoreAccountUpdatedEventNotification.cs new file mode 100644 index 0000000000..41ac9fd0bf --- /dev/null +++ b/src/Stripe.net/Events/V2CoreAccountUpdatedEventNotification.cs @@ -0,0 +1,53 @@ +// File generated from our OpenAPI spec +namespace Stripe.Events +{ + using System.Threading.Tasks; + using Newtonsoft.Json; + using Stripe.V2; +#if NET6_0_OR_GREATER + using STJS = System.Text.Json.Serialization; +#endif + + /// + /// Occurs when an Account is updated. + /// + public class V2CoreAccountUpdatedEventNotification : V2.Core.EventNotification + { + /// + /// Object containing the reference to API resource relevant to the event. + /// + [JsonProperty("related_object")] +#if NET6_0_OR_GREATER + [STJS.JsonPropertyName("related_object")] +#endif + + public V2.Core.EventNotificationRelatedObject RelatedObject { get; set; } + + /// + /// Asynchronously retrieves the related object from the API. Make an API request on every + /// call. + /// + public Task FetchRelatedObjectAsync() + { + return this.FetchRelatedObjectAsync(this.RelatedObject); + } + + /// + /// Retrieves the related object from the API. Make an API request on every call. + /// + public V2.Core.Account FetchRelatedObject() + { + return this.FetchRelatedObject(this.RelatedObject); + } + + public V2CoreAccountUpdatedEvent FetchEvent() + { + return this.FetchEvent(); + } + + public Task FetchEventAsync() + { + return this.FetchEventAsync(); + } + } +} diff --git a/src/Stripe.net/Exceptions/V2/RateLimitException.cs b/src/Stripe.net/Exceptions/V2/RateLimitException.cs new file mode 100644 index 0000000000..7428b94f83 --- /dev/null +++ b/src/Stripe.net/Exceptions/V2/RateLimitException.cs @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec +namespace Stripe.V2 +{ + using System.Net; + using Newtonsoft.Json.Linq; + + public class RateLimitException : StripeException + { + private RateLimitException( + HttpStatusCode httpStatusCode, + StripeError stripeError, + string message) + : base(httpStatusCode, stripeError) + { + } + + internal static RateLimitException Parse( + HttpStatusCode httpStatusCode, + JToken body) + { + var stripeError = StripeError.FromJson(body); + return new RateLimitException(httpStatusCode, stripeError, stripeError.Message); + } + } +} \ No newline at end of file diff --git a/src/Stripe.net/Infrastructure/Public/StripeException.cs b/src/Stripe.net/Infrastructure/Public/StripeException.cs index 751f5cd577..93b5d15ee9 100644 --- a/src/Stripe.net/Infrastructure/Public/StripeException.cs +++ b/src/Stripe.net/Infrastructure/Public/StripeException.cs @@ -47,6 +47,10 @@ internal static StripeException ParseV2Exception(string type, StripeResponse res switch (type) { // The beginning of the section generated from our OpenAPI spec + case "rate_limit": + ret = Stripe.V2.RateLimitException.Parse(httpStatusCode, body); + break; + case "temporary_session_expired": ret = Stripe.V2.TemporarySessionExpiredException.Parse(httpStatusCode, body); break; diff --git a/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs b/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs index 7ba51360e5..a00f701f2c 100644 --- a/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs +++ b/src/Stripe.net/Infrastructure/Public/StripeTypeRegistry.cs @@ -212,6 +212,65 @@ public static class StripeTypeRegistry "v1.billing.meter.no_meter_found", typeof( Events.V1BillingMeterNoMeterFoundEvent) }, + { "v2.core.account.closed", typeof(Events.V2CoreAccountClosedEvent) }, + { "v2.core.account.created", typeof(Events.V2CoreAccountCreatedEvent) }, + { "v2.core.account.updated", typeof(Events.V2CoreAccountUpdatedEvent) }, + { + "v2.core.account[configuration.customer].capability_status_updated", typeof( + Events.V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent) + }, + { + "v2.core.account[configuration.customer].updated", typeof( + Events.V2CoreAccountIncludingConfigurationCustomerUpdatedEvent) + }, + { + "v2.core.account[configuration.merchant].capability_status_updated", typeof( + Events.V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent) + }, + { + "v2.core.account[configuration.merchant].updated", typeof( + Events.V2CoreAccountIncludingConfigurationMerchantUpdatedEvent) + }, + { + "v2.core.account[configuration.recipient].capability_status_updated", typeof( + Events.V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent) + }, + { + "v2.core.account[configuration.recipient].updated", typeof( + Events.V2CoreAccountIncludingConfigurationRecipientUpdatedEvent) + }, + { + "v2.core.account[defaults].updated", typeof( + Events.V2CoreAccountIncludingDefaultsUpdatedEvent) + }, + { + "v2.core.account[future_requirements].updated", typeof( + Events.V2CoreAccountIncludingFutureRequirementsUpdatedEvent) + }, + { + "v2.core.account[identity].updated", typeof( + Events.V2CoreAccountIncludingIdentityUpdatedEvent) + }, + { + "v2.core.account[requirements].updated", typeof( + Events.V2CoreAccountIncludingRequirementsUpdatedEvent) + }, + { + "v2.core.account_link.returned", typeof( + Events.V2CoreAccountLinkReturnedEvent) + }, + { + "v2.core.account_person.created", typeof( + Events.V2CoreAccountPersonCreatedEvent) + }, + { + "v2.core.account_person.deleted", typeof( + Events.V2CoreAccountPersonDeletedEvent) + }, + { + "v2.core.account_person.updated", typeof( + Events.V2CoreAccountPersonUpdatedEvent) + }, { "v2.core.event_destination.ping", typeof( Events.V2CoreEventDestinationPingEvent) @@ -232,6 +291,74 @@ public static class StripeTypeRegistry "v1.billing.meter.no_meter_found", typeof( Events.V1BillingMeterNoMeterFoundEventNotification) }, + { + "v2.core.account.closed", typeof( + Events.V2CoreAccountClosedEventNotification) + }, + { + "v2.core.account.created", typeof( + Events.V2CoreAccountCreatedEventNotification) + }, + { + "v2.core.account.updated", typeof( + Events.V2CoreAccountUpdatedEventNotification) + }, + { + "v2.core.account[configuration.customer].capability_status_updated", typeof( + Events.V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventNotification) + }, + { + "v2.core.account[configuration.customer].updated", typeof( + Events.V2CoreAccountIncludingConfigurationCustomerUpdatedEventNotification) + }, + { + "v2.core.account[configuration.merchant].capability_status_updated", typeof( + Events.V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventNotification) + }, + { + "v2.core.account[configuration.merchant].updated", typeof( + Events.V2CoreAccountIncludingConfigurationMerchantUpdatedEventNotification) + }, + { + "v2.core.account[configuration.recipient].capability_status_updated", typeof( + Events.V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventNotification) + }, + { + "v2.core.account[configuration.recipient].updated", typeof( + Events.V2CoreAccountIncludingConfigurationRecipientUpdatedEventNotification) + }, + { + "v2.core.account[defaults].updated", typeof( + Events.V2CoreAccountIncludingDefaultsUpdatedEventNotification) + }, + { + "v2.core.account[future_requirements].updated", typeof( + Events.V2CoreAccountIncludingFutureRequirementsUpdatedEventNotification) + }, + { + "v2.core.account[identity].updated", typeof( + Events.V2CoreAccountIncludingIdentityUpdatedEventNotification) + }, + { + "v2.core.account[requirements].updated", typeof( + Events.V2CoreAccountIncludingRequirementsUpdatedEventNotification) + }, + { + "v2.core.account_link.returned", typeof( + Events.V2CoreAccountLinkReturnedEventNotification) + }, + { + "v2.core.account_person.created", typeof( + Events.V2CoreAccountPersonCreatedEventNotification) + }, + { + "v2.core.account_person.deleted", typeof( + Events.V2CoreAccountPersonDeletedEventNotification) + }, + { + "v2.core.account_person.updated", typeof( + Events.V2CoreAccountPersonUpdatedEventNotification) + }, { "v2.core.event_destination.ping", typeof( Events.V2CoreEventDestinationPingEventNotification) diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs index 2690fd6103..668114649c 100644 --- a/src/StripeTests/Services/GeneratedExamplesTest.cs +++ b/src/StripeTests/Services/GeneratedExamplesTest.cs @@ -6700,6 +6700,25 @@ public void TestV2CoreEventDestinationPost5() "/v2/core/event_destinations/id_123/ping"); } + [Fact] + public void TestRateLimitError() + { + this.StubRequest( + HttpMethod.Get, + "/v2/core/accounts", + (HttpStatusCode)400, + "{\"error\":{\"type\":\"rate_limit\",\"code\":\"account_rate_limit_exceeded\"}}"); + var exception = Assert.Throws( + () => + { + var client = new StripeClient(this.Requestor); + var service = client.V2.Core.Accounts; + Stripe.V2.StripeList accounts = service + .List(); + }); + this.AssertRequest(HttpMethod.Get, "/v2/core/accounts"); + } + [Fact] public void TestTemporarySessionExpiredError() {