diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION
index 10868909ef..f81ab4bba1 100644
--- a/OPENAPI_VERSION
+++ b/OPENAPI_VERSION
@@ -1 +1 @@
-4776797593c966ebe1494340934edf45a6764bf2
\ No newline at end of file
+4776797593c966ebe1494340934edf45a6764bf2
diff --git a/justfile b/justfile
index b891bed6de..5f72092048 100644
--- a/justfile
+++ b/justfile
@@ -8,12 +8,15 @@ _default:
# base test command that other, more specific commands use
[no-quiet]
[no-exit-message]
-_test no_build framework config:
- dotnet test {{no_build}} {{framework}} src/StripeTests/StripeTests.csproj -c {{config}}
+_test no_build framework config filter="":
+ dotnet test {{no_build}} {{framework}} src/StripeTests/StripeTests.csproj -c {{config}} {{ if filter == "" {""} else {"--filter " + filter} }}
# ⭐ run tests in debug mode
test: (_test "" "-f net8.0" "Debug")
+# run a test matching a filter
+test-one name: (_test "" "-f net8.0" "Debug" name)
+
# skip build and don't specify the dotnet framework
ci-test: (_test "--no-build" "" "Release")
diff --git a/src/Examples/V2/EventNotificationWebhookHandler.cs b/src/Examples/V2/EventNotificationWebhookHandler.cs
new file mode 100644
index 0000000000..68dc2afab7
--- /dev/null
+++ b/src/Examples/V2/EventNotificationWebhookHandler.cs
@@ -0,0 +1,77 @@
+namespace Examples.V2
+{
+#pragma warning disable SA1101 // Prefix local calls with this
+
+ using System;
+ using System.IO;
+ using System.Threading.Tasks;
+ using Microsoft.AspNetCore.Mvc;
+ using Stripe;
+ using Stripe.Events;
+ using Stripe.V2;
+
+ ///
+ /// Receive and process EventNotifications like the v1.billing.meter.error_report_triggered event.
+ ///
+ /// In this example, we:
+ /// - use ParseEventNotification to parse the received event notification webhook body
+ /// - call StripeClient.v2.core.events.retrieve to retrieve the full event object
+ /// - if it is a V1BillingMeterErrorReportTriggeredEvent event type, call fetchRelatedObject
+ /// to retrieve the Billing Meter object associated with the event.
+ ///
+ [Route("api/[controller]")]
+ [ApiController]
+ public class EventNotificationWebhookHandler : ControllerBase
+ {
+ private readonly StripeClient client;
+ private readonly string webhookSecret;
+
+ public EventNotificationWebhookHandler()
+ {
+ var apiKey = Environment.GetEnvironmentVariable("STRIPE_API_KEY");
+ client = new StripeClient(apiKey);
+
+ webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET");
+ }
+
+ [HttpPost]
+ public async Task Index()
+ {
+ var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync();
+ try
+ {
+ var eventNotification = client.ParseEventNotification(json, Request.Headers["Stripe-Signature"], webhookSecret);
+
+ // match on the type of the class to determine what event you have
+ if (eventNotification is V1BillingMeterErrorReportTriggeredEventNotification evt)
+ {
+ // the related object is correctly typed
+ var meter = evt.FetchRelatedObject();
+ Console.WriteLine($"Default aggregation: {meter.DefaultAggregation}");
+
+ // can also fetch the full event to get the event data
+ var eventObj = evt.FetchEvent();
+ var eventData = eventObj.Data;
+ Console.WriteLine($"Err summary: {eventData.DeveloperMessageSummary}");
+ }
+
+ // check other types the SDK knows about
+ // for event types that were released after this SDK was generated, check type
+ else if (eventNotification is UnknownEventNotification unknownEvt)
+ {
+ // fall back to checking type
+ if (unknownEvt.Type == "some.other.event")
+ {
+ // handle the event
+ }
+ }
+
+ return Ok();
+ }
+ catch (StripeException e)
+ {
+ return BadRequest(e.Message);
+ }
+ }
+ }
+}
diff --git a/src/Examples/V2/ThinEventWebhookHandler.cs b/src/Examples/V2/ThinEventWebhookHandler.cs
deleted file mode 100644
index dbec0d14dc..0000000000
--- a/src/Examples/V2/ThinEventWebhookHandler.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-namespace Examples.V2
-{
-#pragma warning disable SA1101 // Prefix local calls with this
-
- using System;
- using System.IO;
- using System.Threading.Tasks;
- using Microsoft.AspNetCore.Mvc;
- using Stripe;
- using Stripe.Events;
-
- ///
- /// Receive and process thin events like the v1.billing.meter.error_report_triggered event.
- ///
- /// In this example, we:
- /// - use parseThinEvent to parse the received thin event webhook body
- /// - call StripeClient.v2.core.events.retrieve to retrieve the full event object
- /// - if it is a V1BillingMeterErrorReportTriggeredEvent event type, call fetchRelatedObject
- /// to retrieve the Billing Meter object associated with the event.
- ///
- [Route("api/[controller]")]
- [ApiController]
- public class ThinEventWebhookHandler : ControllerBase
- {
- private readonly StripeClient client;
- private readonly string webhookSecret;
-
- public ThinEventWebhookHandler()
- {
- var apiKey = Environment.GetEnvironmentVariable("STRIPE_API_KEY");
- client = new StripeClient(apiKey);
-
- webhookSecret = Environment.GetEnvironmentVariable("WEBHOOK_SECRET");
- }
-
- [HttpPost]
- public async Task Index()
- {
- var json = await new StreamReader(HttpContext.Request.Body).ReadToEndAsync();
- try
- {
- var thinEvent = client.ParseThinEvent(json, Request.Headers["Stripe-Signature"], webhookSecret);
-
- // Fetch the event data to understand the failure
- var baseEvent = await client.V2.Core.Events.GetAsync(thinEvent.Id);
- if (baseEvent is V1BillingMeterErrorReportTriggeredEvent fullEvent)
- {
- var meter = await fullEvent.FetchRelatedObjectAsync();
- var meterId = meter.Id;
-
- // Record the failures and alert your team
- // Add your logic here
- }
-
- return Ok();
- }
- catch (StripeException e)
- {
- return BadRequest(e.Message);
- }
- }
- }
-}
diff --git a/src/Stripe.net/Entities/V2/Events/Event.partial.cs b/src/Stripe.net/Entities/V2/Events/Event.partial.cs
index 39aa703e4d..0cd8b95b74 100644
--- a/src/Stripe.net/Entities/V2/Events/Event.partial.cs
+++ b/src/Stripe.net/Entities/V2/Events/Event.partial.cs
@@ -13,7 +13,7 @@ namespace Stripe.V2
using Stripe.Infrastructure;
///
- /// Manually-maintained convenience methods added to ThinEvent.
+ /// Manually-maintained convenience methods added to V2 Events.
///
[JsonConverter(typeof(V2EventConverter))]
#if NET6_0_OR_GREATER
@@ -69,7 +69,7 @@ protected virtual Task FetchRelatedObjectAsync(EventRelatedObject relatedO
RequestOptions opts = null;
if (this.Context != null)
{
- opts = new RequestOptions { StripeAccount = this.Context };
+ opts = new RequestOptions { StripeContext = this.Context };
}
return this.Requestor.RequestAsync(
diff --git a/src/Stripe.net/Events/V1AccountUpdatedEventNotification.cs b/src/Stripe.net/Events/V1AccountUpdatedEventNotification.cs
new file mode 100644
index 0000000000..0b1206947e
--- /dev/null
+++ b/src/Stripe.net/Events/V1AccountUpdatedEventNotification.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 whenever an account status or property has changed.
+ ///
+ public class V1AccountUpdatedEventNotification : V2.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.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 Account FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1AccountUpdatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ApplicationFeeCreatedEventNotification.cs b/src/Stripe.net/Events/V1ApplicationFeeCreatedEventNotification.cs
new file mode 100644
index 0000000000..9f87782541
--- /dev/null
+++ b/src/Stripe.net/Events/V1ApplicationFeeCreatedEventNotification.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 whenever an application fee is created on a charge.
+ ///
+ public class V1ApplicationFeeCreatedEventNotification : V2.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.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 ApplicationFee FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ApplicationFeeCreatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ApplicationFeeRefundedEventNotification.cs b/src/Stripe.net/Events/V1ApplicationFeeRefundedEventNotification.cs
new file mode 100644
index 0000000000..66d0fff4ff
--- /dev/null
+++ b/src/Stripe.net/Events/V1ApplicationFeeRefundedEventNotification.cs
@@ -0,0 +1,55 @@
+// 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 whenever an application fee is refunded, whether from refunding a charge or from
+ /// refunding the application fee
+ /// directly. This includes partial refunds.
+ ///
+ public class V1ApplicationFeeRefundedEventNotification : V2.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.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 ApplicationFee FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ApplicationFeeRefundedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1BillingMeterErrorReportTriggeredEventNotification.cs b/src/Stripe.net/Events/V1BillingMeterErrorReportTriggeredEventNotification.cs
new file mode 100644
index 0000000000..1c320e7d04
--- /dev/null
+++ b/src/Stripe.net/Events/V1BillingMeterErrorReportTriggeredEventNotification.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 Meter has invalid async usage events.
+ ///
+ public class V1BillingMeterErrorReportTriggeredEventNotification : V2.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.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 Billing.Meter FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1BillingMeterErrorReportTriggeredEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1BillingMeterNoMeterFoundEventNotification.cs b/src/Stripe.net/Events/V1BillingMeterNoMeterFoundEventNotification.cs
new file mode 100644
index 0000000000..314fbd6bfe
--- /dev/null
+++ b/src/Stripe.net/Events/V1BillingMeterNoMeterFoundEventNotification.cs
@@ -0,0 +1,22 @@
+// File generated from our OpenAPI spec
+namespace Stripe.Events
+{
+ using System.Threading.Tasks;
+ using Stripe.V2;
+
+ ///
+ /// Occurs when a Meter's id is missing or invalid in async usage events.
+ ///
+ public class V1BillingMeterNoMeterFoundEventNotification : V2.EventNotification
+ {
+ public V1BillingMeterNoMeterFoundEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1BillingPortalConfigurationCreatedEventNotification.cs b/src/Stripe.net/Events/V1BillingPortalConfigurationCreatedEventNotification.cs
new file mode 100644
index 0000000000..e80f221045
--- /dev/null
+++ b/src/Stripe.net/Events/V1BillingPortalConfigurationCreatedEventNotification.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 whenever a portal configuration is created.
+ ///
+ public class V1BillingPortalConfigurationCreatedEventNotification : V2.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.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 BillingPortal.Configuration FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1BillingPortalConfigurationCreatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1BillingPortalConfigurationUpdatedEventNotification.cs b/src/Stripe.net/Events/V1BillingPortalConfigurationUpdatedEventNotification.cs
new file mode 100644
index 0000000000..364bfafb28
--- /dev/null
+++ b/src/Stripe.net/Events/V1BillingPortalConfigurationUpdatedEventNotification.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 whenever a portal configuration is updated.
+ ///
+ public class V1BillingPortalConfigurationUpdatedEventNotification : V2.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.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 BillingPortal.Configuration FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1BillingPortalConfigurationUpdatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CapabilityUpdatedEventNotification.cs b/src/Stripe.net/Events/V1CapabilityUpdatedEventNotification.cs
new file mode 100644
index 0000000000..1f31eede86
--- /dev/null
+++ b/src/Stripe.net/Events/V1CapabilityUpdatedEventNotification.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 whenever a capability has new requirements or a new status.
+ ///
+ public class V1CapabilityUpdatedEventNotification : V2.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.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 Capability FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CapabilityUpdatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeCapturedEventNotification.cs b/src/Stripe.net/Events/V1ChargeCapturedEventNotification.cs
new file mode 100644
index 0000000000..33eff03793
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeCapturedEventNotification.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 whenever a previously uncaptured charge is captured.
+ ///
+ public class V1ChargeCapturedEventNotification : V2.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.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 Charge FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeCapturedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeDisputeClosedEventNotification.cs b/src/Stripe.net/Events/V1ChargeDisputeClosedEventNotification.cs
new file mode 100644
index 0000000000..131be70e75
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeDisputeClosedEventNotification.cs
@@ -0,0 +1,54 @@
+// 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 dispute is closed and the dispute status changes to lost,
+ /// warning_closed, or won.
+ ///
+ public class V1ChargeDisputeClosedEventNotification : V2.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.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 Dispute FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeDisputeClosedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeDisputeCreatedEventNotification.cs b/src/Stripe.net/Events/V1ChargeDisputeCreatedEventNotification.cs
new file mode 100644
index 0000000000..8418858352
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeDisputeCreatedEventNotification.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 whenever a customer disputes a charge with their bank.
+ ///
+ public class V1ChargeDisputeCreatedEventNotification : V2.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.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 Dispute FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeDisputeCreatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeDisputeFundsReinstatedEventNotification.cs b/src/Stripe.net/Events/V1ChargeDisputeFundsReinstatedEventNotification.cs
new file mode 100644
index 0000000000..d335108060
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeDisputeFundsReinstatedEventNotification.cs
@@ -0,0 +1,56 @@
+// 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 funds are reinstated to your account after a dispute is closed. This
+ /// includes partially
+ /// refunded payments.
+ ///
+ public class V1ChargeDisputeFundsReinstatedEventNotification : V2.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.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 Dispute FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeDisputeFundsReinstatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeDisputeFundsWithdrawnEventNotification.cs b/src/Stripe.net/Events/V1ChargeDisputeFundsWithdrawnEventNotification.cs
new file mode 100644
index 0000000000..d09f25d6d0
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeDisputeFundsWithdrawnEventNotification.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 funds are removed from your account due to a dispute.
+ ///
+ public class V1ChargeDisputeFundsWithdrawnEventNotification : V2.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.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 Dispute FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeDisputeFundsWithdrawnEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeDisputeUpdatedEventNotification.cs b/src/Stripe.net/Events/V1ChargeDisputeUpdatedEventNotification.cs
new file mode 100644
index 0000000000..6278d04709
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeDisputeUpdatedEventNotification.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 dispute is updated (usually with evidence).
+ ///
+ public class V1ChargeDisputeUpdatedEventNotification : V2.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.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 Dispute FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeDisputeUpdatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeExpiredEventNotification.cs b/src/Stripe.net/Events/V1ChargeExpiredEventNotification.cs
new file mode 100644
index 0000000000..d537cfe9c8
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeExpiredEventNotification.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 whenever an uncaptured charge expires.
+ ///
+ public class V1ChargeExpiredEventNotification : V2.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.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 Charge FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeExpiredEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeFailedEventNotification.cs b/src/Stripe.net/Events/V1ChargeFailedEventNotification.cs
new file mode 100644
index 0000000000..5f439e6d5d
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeFailedEventNotification.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 whenever a failed charge attempt occurs.
+ ///
+ public class V1ChargeFailedEventNotification : V2.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.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 Charge FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeFailedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargePendingEventNotification.cs b/src/Stripe.net/Events/V1ChargePendingEventNotification.cs
new file mode 100644
index 0000000000..8bc8f14b36
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargePendingEventNotification.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 whenever a pending charge is created.
+ ///
+ public class V1ChargePendingEventNotification : V2.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.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 Charge FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargePendingEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeRefundUpdatedEventNotification.cs b/src/Stripe.net/Events/V1ChargeRefundUpdatedEventNotification.cs
new file mode 100644
index 0000000000..91231b3a76
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeRefundUpdatedEventNotification.cs
@@ -0,0 +1,54 @@
+// 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 whenever a refund is updated on selected payment methods. For updates on all
+ /// refunds, listen to refund.updated instead.
+ ///
+ public class V1ChargeRefundUpdatedEventNotification : V2.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.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 Refund FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeRefundUpdatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeRefundedEventNotification.cs b/src/Stripe.net/Events/V1ChargeRefundedEventNotification.cs
new file mode 100644
index 0000000000..9756feec8b
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeRefundedEventNotification.cs
@@ -0,0 +1,54 @@
+// 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 whenever a charge is refunded, including partial refunds. Listen to
+ /// refund.created for information about the refund.
+ ///
+ public class V1ChargeRefundedEventNotification : V2.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.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 Charge FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeRefundedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeSucceededEventNotification.cs b/src/Stripe.net/Events/V1ChargeSucceededEventNotification.cs
new file mode 100644
index 0000000000..184f4a6829
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeSucceededEventNotification.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 whenever a charge is successful.
+ ///
+ public class V1ChargeSucceededEventNotification : V2.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.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 Charge FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeSucceededEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ChargeUpdatedEventNotification.cs b/src/Stripe.net/Events/V1ChargeUpdatedEventNotification.cs
new file mode 100644
index 0000000000..31402c5adf
--- /dev/null
+++ b/src/Stripe.net/Events/V1ChargeUpdatedEventNotification.cs
@@ -0,0 +1,54 @@
+// 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 whenever a charge description or metadata is updated, or upon an asynchronous
+ /// capture.
+ ///
+ public class V1ChargeUpdatedEventNotification : V2.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.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 Charge FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ChargeUpdatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CheckoutSessionAsyncPaymentFailedEventNotification.cs b/src/Stripe.net/Events/V1CheckoutSessionAsyncPaymentFailedEventNotification.cs
new file mode 100644
index 0000000000..b7699e1785
--- /dev/null
+++ b/src/Stripe.net/Events/V1CheckoutSessionAsyncPaymentFailedEventNotification.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 payment intent using a delayed payment method fails.
+ ///
+ public class V1CheckoutSessionAsyncPaymentFailedEventNotification : V2.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.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 Checkout.Session FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CheckoutSessionAsyncPaymentFailedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CheckoutSessionAsyncPaymentSucceededEventNotification.cs b/src/Stripe.net/Events/V1CheckoutSessionAsyncPaymentSucceededEventNotification.cs
new file mode 100644
index 0000000000..f2304568e3
--- /dev/null
+++ b/src/Stripe.net/Events/V1CheckoutSessionAsyncPaymentSucceededEventNotification.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 payment intent using a delayed payment method finally succeeds.
+ ///
+ public class V1CheckoutSessionAsyncPaymentSucceededEventNotification : V2.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.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 Checkout.Session FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CheckoutSessionAsyncPaymentSucceededEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CheckoutSessionCompletedEventNotification.cs b/src/Stripe.net/Events/V1CheckoutSessionCompletedEventNotification.cs
new file mode 100644
index 0000000000..ccc3373b24
--- /dev/null
+++ b/src/Stripe.net/Events/V1CheckoutSessionCompletedEventNotification.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 Checkout Session has been successfully completed.
+ ///
+ public class V1CheckoutSessionCompletedEventNotification : V2.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.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 Checkout.Session FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CheckoutSessionCompletedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CheckoutSessionExpiredEventNotification.cs b/src/Stripe.net/Events/V1CheckoutSessionExpiredEventNotification.cs
new file mode 100644
index 0000000000..543a89a68d
--- /dev/null
+++ b/src/Stripe.net/Events/V1CheckoutSessionExpiredEventNotification.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 Checkout Session is expired.
+ ///
+ public class V1CheckoutSessionExpiredEventNotification : V2.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.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 Checkout.Session FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CheckoutSessionExpiredEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ClimateOrderCanceledEventNotification.cs b/src/Stripe.net/Events/V1ClimateOrderCanceledEventNotification.cs
new file mode 100644
index 0000000000..2b4d91055f
--- /dev/null
+++ b/src/Stripe.net/Events/V1ClimateOrderCanceledEventNotification.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 Climate order is canceled.
+ ///
+ public class V1ClimateOrderCanceledEventNotification : V2.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.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 Climate.Order FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ClimateOrderCanceledEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ClimateOrderCreatedEventNotification.cs b/src/Stripe.net/Events/V1ClimateOrderCreatedEventNotification.cs
new file mode 100644
index 0000000000..2db79f451c
--- /dev/null
+++ b/src/Stripe.net/Events/V1ClimateOrderCreatedEventNotification.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 Climate order is created.
+ ///
+ public class V1ClimateOrderCreatedEventNotification : V2.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.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 Climate.Order FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ClimateOrderCreatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ClimateOrderDelayedEventNotification.cs b/src/Stripe.net/Events/V1ClimateOrderDelayedEventNotification.cs
new file mode 100644
index 0000000000..0ffcc7f3b5
--- /dev/null
+++ b/src/Stripe.net/Events/V1ClimateOrderDelayedEventNotification.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 Climate order is delayed.
+ ///
+ public class V1ClimateOrderDelayedEventNotification : V2.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.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 Climate.Order FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ClimateOrderDelayedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ClimateOrderDeliveredEventNotification.cs b/src/Stripe.net/Events/V1ClimateOrderDeliveredEventNotification.cs
new file mode 100644
index 0000000000..ed4145e03a
--- /dev/null
+++ b/src/Stripe.net/Events/V1ClimateOrderDeliveredEventNotification.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 Climate order is delivered.
+ ///
+ public class V1ClimateOrderDeliveredEventNotification : V2.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.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 Climate.Order FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ClimateOrderDeliveredEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ClimateOrderProductSubstitutedEventNotification.cs b/src/Stripe.net/Events/V1ClimateOrderProductSubstitutedEventNotification.cs
new file mode 100644
index 0000000000..5316a39bf0
--- /dev/null
+++ b/src/Stripe.net/Events/V1ClimateOrderProductSubstitutedEventNotification.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 Climate order's product is substituted for another.
+ ///
+ public class V1ClimateOrderProductSubstitutedEventNotification : V2.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.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 Climate.Order FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ClimateOrderProductSubstitutedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ClimateProductCreatedEventNotification.cs b/src/Stripe.net/Events/V1ClimateProductCreatedEventNotification.cs
new file mode 100644
index 0000000000..d4ee46dc14
--- /dev/null
+++ b/src/Stripe.net/Events/V1ClimateProductCreatedEventNotification.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 Climate product is created.
+ ///
+ public class V1ClimateProductCreatedEventNotification : V2.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.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 Climate.Product FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ClimateProductCreatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1ClimateProductPricingUpdatedEventNotification.cs b/src/Stripe.net/Events/V1ClimateProductPricingUpdatedEventNotification.cs
new file mode 100644
index 0000000000..5eb656bfcf
--- /dev/null
+++ b/src/Stripe.net/Events/V1ClimateProductPricingUpdatedEventNotification.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 Climate product is updated.
+ ///
+ public class V1ClimateProductPricingUpdatedEventNotification : V2.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.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 Climate.Product FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1ClimateProductPricingUpdatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CouponCreatedEventNotification.cs b/src/Stripe.net/Events/V1CouponCreatedEventNotification.cs
new file mode 100644
index 0000000000..39a6dc4985
--- /dev/null
+++ b/src/Stripe.net/Events/V1CouponCreatedEventNotification.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 whenever a coupon is created.
+ ///
+ public class V1CouponCreatedEventNotification : V2.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.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 Coupon FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CouponCreatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CouponDeletedEventNotification.cs b/src/Stripe.net/Events/V1CouponDeletedEventNotification.cs
new file mode 100644
index 0000000000..c2b80a27c3
--- /dev/null
+++ b/src/Stripe.net/Events/V1CouponDeletedEventNotification.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 whenever a coupon is deleted.
+ ///
+ public class V1CouponDeletedEventNotification : V2.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.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 Coupon FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CouponDeletedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CouponUpdatedEventNotification.cs b/src/Stripe.net/Events/V1CouponUpdatedEventNotification.cs
new file mode 100644
index 0000000000..3a039b77d7
--- /dev/null
+++ b/src/Stripe.net/Events/V1CouponUpdatedEventNotification.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 whenever a coupon is updated.
+ ///
+ public class V1CouponUpdatedEventNotification : V2.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.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 Coupon FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CouponUpdatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CreditNoteCreatedEventNotification.cs b/src/Stripe.net/Events/V1CreditNoteCreatedEventNotification.cs
new file mode 100644
index 0000000000..e75f8175e6
--- /dev/null
+++ b/src/Stripe.net/Events/V1CreditNoteCreatedEventNotification.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 whenever a credit note is created.
+ ///
+ public class V1CreditNoteCreatedEventNotification : V2.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.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 CreditNote FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CreditNoteCreatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CreditNoteUpdatedEventNotification.cs b/src/Stripe.net/Events/V1CreditNoteUpdatedEventNotification.cs
new file mode 100644
index 0000000000..7b9a8c2615
--- /dev/null
+++ b/src/Stripe.net/Events/V1CreditNoteUpdatedEventNotification.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 whenever a credit note is updated.
+ ///
+ public class V1CreditNoteUpdatedEventNotification : V2.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.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 CreditNote FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CreditNoteUpdatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CreditNoteVoidedEventNotification.cs b/src/Stripe.net/Events/V1CreditNoteVoidedEventNotification.cs
new file mode 100644
index 0000000000..8539fe5c27
--- /dev/null
+++ b/src/Stripe.net/Events/V1CreditNoteVoidedEventNotification.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 whenever a credit note is voided.
+ ///
+ public class V1CreditNoteVoidedEventNotification : V2.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.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 CreditNote FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CreditNoteVoidedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CustomerCreatedEventNotification.cs b/src/Stripe.net/Events/V1CustomerCreatedEventNotification.cs
new file mode 100644
index 0000000000..862d023a1e
--- /dev/null
+++ b/src/Stripe.net/Events/V1CustomerCreatedEventNotification.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 whenever a new customer is created.
+ ///
+ public class V1CustomerCreatedEventNotification : V2.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.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 Customer FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CustomerCreatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CustomerDeletedEventNotification.cs b/src/Stripe.net/Events/V1CustomerDeletedEventNotification.cs
new file mode 100644
index 0000000000..879e6bd4d0
--- /dev/null
+++ b/src/Stripe.net/Events/V1CustomerDeletedEventNotification.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 whenever a customer is deleted.
+ ///
+ public class V1CustomerDeletedEventNotification : V2.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.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 Customer FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CustomerDeletedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CustomerDiscountCreatedEventNotification.cs b/src/Stripe.net/Events/V1CustomerDiscountCreatedEventNotification.cs
new file mode 100644
index 0000000000..228f5b1204
--- /dev/null
+++ b/src/Stripe.net/Events/V1CustomerDiscountCreatedEventNotification.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 whenever a coupon is attached to a customer.
+ ///
+ public class V1CustomerDiscountCreatedEventNotification : V2.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.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 Discount FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CustomerDiscountCreatedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CustomerDiscountDeletedEventNotification.cs b/src/Stripe.net/Events/V1CustomerDiscountDeletedEventNotification.cs
new file mode 100644
index 0000000000..9161191d22
--- /dev/null
+++ b/src/Stripe.net/Events/V1CustomerDiscountDeletedEventNotification.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 whenever a coupon is removed from a customer.
+ ///
+ public class V1CustomerDiscountDeletedEventNotification : V2.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.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 Discount FetchRelatedObject()
+ {
+ return this.FetchRelatedObject(this.RelatedObject);
+ }
+
+ public V1CustomerDiscountDeletedEvent FetchEvent()
+ {
+ return this.FetchEvent();
+ }
+
+ public Task FetchEventAsync()
+ {
+ return this.FetchEventAsync();
+ }
+ }
+}
diff --git a/src/Stripe.net/Events/V1CustomerDiscountUpdatedEventNotification.cs b/src/Stripe.net/Events/V1CustomerDiscountUpdatedEventNotification.cs
new file mode 100644
index 0000000000..b217f1caf6
--- /dev/null
+++ b/src/Stripe.net/Events/V1CustomerDiscountUpdatedEventNotification.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
+
+ ///