/// Draft invoices are fully editable. Once an invoice is finalized,
diff --git a/src/Stripe.net/Services/Invoices/InvoiceService.partial.cs b/src/Stripe.net/Services/Invoices/InvoiceService.partial.cs
index dd46c7903a..c6237576e2 100644
--- a/src/Stripe.net/Services/Invoices/InvoiceService.partial.cs
+++ b/src/Stripe.net/Services/Invoices/InvoiceService.partial.cs
@@ -53,50 +53,6 @@ public virtual IAsyncEnumerable ListLineItemsAutoPagingAsync(st
return this.ListRequestAutoPagingAsync($"/v1/invoices/{WebUtility.UrlEncode(id)}/lines", options, requestOptions, cancellationToken);
}
- ///
- /// When retrieving an upcoming invoice, you’ll get a lines property
- /// containing the total count of line items and the first handful of those items. There is
- /// also a URL where you can retrieve the full (paginated) list of line items.
.
- ///
- [Obsolete("Use InvoiceUpcomingLinesService.List instead.")]
- public virtual StripeList ListUpcomingLineItems(InvoiceUpcomingLinesListOptions options = null, RequestOptions requestOptions = null)
- {
- return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v1/invoices/upcoming/lines", options, requestOptions);
- }
-
- ///
- /// When retrieving an upcoming invoice, you’ll get a lines property
- /// containing the total count of line items and the first handful of those items. There is
- /// also a URL where you can retrieve the full (paginated) list of line items.
.
- ///
- [Obsolete("Use InvoiceUpcomingLinesService.ListAsync instead.")]
- public virtual Task> ListUpcomingLineItemsAsync(InvoiceUpcomingLinesListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
- {
- return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v1/invoices/upcoming/lines", options, requestOptions, cancellationToken);
- }
-
- ///
- /// When retrieving an upcoming invoice, you’ll get a lines property
- /// containing the total count of line items and the first handful of those items. There is
- /// also a URL where you can retrieve the full (paginated) list of line items.
.
- ///
- [Obsolete("Use InvoiceUpcomingLinesService.ListAutoPaging instead.")]
- public virtual IEnumerable ListUpcomingLineItemsAutoPaging(InvoiceUpcomingLinesListOptions options = null, RequestOptions requestOptions = null)
- {
- return this.ListRequestAutoPaging($"/v1/invoices/upcoming/lines", options, requestOptions);
- }
-
- ///
- /// When retrieving an upcoming invoice, you’ll get a lines property
- /// containing the total count of line items and the first handful of those items. There is
- /// also a URL where you can retrieve the full (paginated) list of line items.
.
- ///
- [Obsolete("Use InvoiceUpcomingLinesService.ListAutoPagingAsync instead.")]
- public virtual IAsyncEnumerable ListUpcomingLineItemsAutoPagingAsync(InvoiceUpcomingLinesListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
- {
- return this.ListRequestAutoPagingAsync($"/v1/invoices/upcoming/lines", options, requestOptions, cancellationToken);
- }
-
///
/// Updates an invoice’s line item. Some fields, such as tax_amounts, only live on
/// the invoice line item, so they can only be updated through this endpoint. Other fields,
diff --git a/src/Stripe.net/Services/InvoiceUpcomingLines/InvoiceUpcomingLinesListOptions.cs b/src/Stripe.net/Services/Invoices/InvoiceUpcomingLinesOptions.cs
similarity index 94%
rename from src/Stripe.net/Services/InvoiceUpcomingLines/InvoiceUpcomingLinesListOptions.cs
rename to src/Stripe.net/Services/Invoices/InvoiceUpcomingLinesOptions.cs
index 4f4a89fc8a..e50e5f1735 100644
--- a/src/Stripe.net/Services/InvoiceUpcomingLines/InvoiceUpcomingLinesListOptions.cs
+++ b/src/Stripe.net/Services/Invoices/InvoiceUpcomingLinesOptions.cs
@@ -6,13 +6,13 @@ namespace Stripe
using Newtonsoft.Json;
using Stripe.Infrastructure;
- public class InvoiceUpcomingLinesListOptions : ListOptions
+ public class InvoiceUpcomingLinesOptions : ListOptions
{
///
/// Settings for automatic tax lookup for this invoice preview.
///
[JsonProperty("automatic_tax")]
- public InvoiceUpcomingLinesAutomaticTaxOptions AutomaticTax { get; set; }
+ public InvoiceAutomaticTaxOptions AutomaticTax { get; set; }
///
/// The ID of the coupon to apply to this phase of the subscription schedule. This field has
@@ -43,7 +43,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
/// subscription, or schedule must be set.
///
[JsonProperty("customer_details")]
- public InvoiceUpcomingLinesCustomerDetailsOptions CustomerDetails { get; set; }
+ public InvoiceCustomerDetailsOptions CustomerDetails { get; set; }
///
/// The coupons to redeem into discounts for the invoice preview. If not specified, inherits
@@ -52,20 +52,20 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
/// avoid inheriting any discounts.
///
[JsonProperty("discounts")]
- public List Discounts { get; set; }
+ public List Discounts { get; set; }
///
/// List of invoice items to add or update in the upcoming invoice preview (up to 250).
///
[JsonProperty("invoice_items")]
- public List InvoiceItems { get; set; }
+ public List InvoiceItems { get; set; }
///
/// The connected account that issues the invoice. The invoice is presented with the
/// branding and support information of the specified account.
///
[JsonProperty("issuer")]
- public InvoiceUpcomingLinesIssuerOptions Issuer { get; set; }
+ public InvoiceIssuerOptions Issuer { get; set; }
///
/// The account (if any) for which the funds of the invoice payment are intended. If set,
@@ -96,7 +96,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
/// subscription or subscription_ prefixed fields.
///
[JsonProperty("schedule_details")]
- public InvoiceUpcomingLinesScheduleDetailsOptions ScheduleDetails { get; set; }
+ public InvoiceScheduleDetailsOptions ScheduleDetails { get; set; }
///
/// The identifier of the subscription for which you'd like to retrieve the upcoming
@@ -163,7 +163,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
/// with schedule or schedule_details fields.
///
[JsonProperty("subscription_details")]
- public InvoiceUpcomingLinesSubscriptionDetailsOptions SubscriptionDetails { get; set; }
+ public InvoiceSubscriptionDetailsOptions SubscriptionDetails { get; set; }
///
/// A list of up to 20 subscription items, each with an attached price. This field has been
@@ -171,7 +171,7 @@ public class InvoiceUpcomingLinesListOptions : ListOptions
/// subscription_details.items instead.
///
[JsonProperty("subscription_items")]
- public List SubscriptionItems { get; set; }
+ public List SubscriptionItems { get; set; }
///
/// Determines how to handle
/// Lists all event destinations.
///
- public virtual StripeList List(EventDestinationListOptions options = null, RequestOptions requestOptions = null)
+ public virtual V2.StripeList List(EventDestinationListOptions options = null, RequestOptions requestOptions = null)
{
- return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/event_destinations", options, requestOptions);
+ return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/event_destinations", options, requestOptions);
}
///
/// Lists all event destinations.
///
- public virtual Task> ListAsync(EventDestinationListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
+ public virtual Task> ListAsync(EventDestinationListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
- return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/event_destinations", options, requestOptions, cancellationToken);
+ return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/event_destinations", options, requestOptions, cancellationToken);
}
///
diff --git a/src/Stripe.net/Services/V2/Core/Events/EventListOptions.cs b/src/Stripe.net/Services/V2/Core/Events/EventListOptions.cs
index fb44221797..6ab511a60b 100644
--- a/src/Stripe.net/Services/V2/Core/Events/EventListOptions.cs
+++ b/src/Stripe.net/Services/V2/Core/Events/EventListOptions.cs
@@ -1,10 +1,43 @@
// File generated from our OpenAPI spec
namespace Stripe.V2.Core
{
+ using System;
using Newtonsoft.Json;
public class EventListOptions : V2.ListOptions
{
+ ///
+ /// Filter for events created after the specified timestamp.
+ ///
+ [JsonProperty("created_gt")]
+ public DateTime? CreatedGt { get; set; }
+
+ ///
+ /// Filter for events created at or after the specified timestamp.
+ ///
+ [JsonProperty("created_gte")]
+ public DateTime? CreatedGte { get; set; }
+
+ ///
+ /// Filter for events created before the specified timestamp.
+ ///
+ [JsonProperty("created_lt")]
+ public DateTime? CreatedLt { get; set; }
+
+ ///
+ /// Filter for events created at or before the specified timestamp.
+ ///
+ [JsonProperty("created_lte")]
+ public DateTime? CreatedLte { get; set; }
+
+ ///
+ /// Filter events based on whether they were successfully delivered to all subscribed event
+ /// destinations. If false, events which are still pending or have failed all delivery
+ /// attempts to a event destination will be returned.
+ ///
+ [JsonProperty("delivery_success")]
+ public bool? DeliverySuccess { get; set; }
+
///
/// Primary object ID used to retrieve related events.
///
diff --git a/src/Stripe.net/Services/V2/Core/Events/EventService.cs b/src/Stripe.net/Services/V2/Core/Events/EventService.cs
index ac5d439f25..e39553225f 100644
--- a/src/Stripe.net/Services/V2/Core/Events/EventService.cs
+++ b/src/Stripe.net/Services/V2/Core/Events/EventService.cs
@@ -39,17 +39,17 @@ public virtual V2.Event Get(string id, EventGetOptions options = null, RequestOp
///
/// List events, going back up to 30 days.
///
- public virtual StripeList List(EventListOptions options = null, RequestOptions requestOptions = null)
+ public virtual V2.StripeList List(EventListOptions options = null, RequestOptions requestOptions = null)
{
- return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/events", options, requestOptions);
+ return this.Request>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/events", options, requestOptions);
}
///
/// List events, going back up to 30 days.
///
- public virtual Task> ListAsync(EventListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
+ public virtual Task> ListAsync(EventListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
{
- return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/events", options, requestOptions, cancellationToken);
+ return this.RequestAsync>(BaseAddress.Api, HttpMethod.Get, $"/v2/core/events", options, requestOptions, cancellationToken);
}
///
diff --git a/src/StripeTests/Services/GeneratedExamplesTest.cs b/src/StripeTests/Services/GeneratedExamplesTest.cs
index 1e4eff99a1..37349d2df3 100644
--- a/src/StripeTests/Services/GeneratedExamplesTest.cs
+++ b/src/StripeTests/Services/GeneratedExamplesTest.cs
@@ -1852,21 +1852,6 @@ public void TestInvoicesSendPost()
"/v1/invoices/in_xxxxxxxxxxxxx/send");
}
- [Fact]
- public void TestInvoicesUpcomingGet()
- {
- var options = new UpcomingInvoiceOptions
- {
- Customer = "cus_9utnxg47pWjV1e",
- };
- var service = new InvoiceService(this.StripeClient);
- service.Upcoming(options);
- this.AssertRequest(
- HttpMethod.Get,
- "/v1/invoices/upcoming",
- "customer=cus_9utnxg47pWjV1e");
- }
-
[Fact]
public void TestInvoicesVoidPost()
{
diff --git a/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs b/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs
index cc939ae16d..2943bc5fc7 100644
--- a/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs
+++ b/src/StripeTests/Services/Invoices/InvoiceServiceTest.cs
@@ -19,7 +19,6 @@ public class InvoiceServiceTest : BaseStripeTest
private readonly InvoiceListOptions listOptions;
private readonly InvoiceLineItemListOptions lineItemListOptions;
private readonly UpcomingInvoiceOptions upcomingOptions;
- private readonly InvoiceUpcomingLinesListOptions upcomingListLineItemsOptions;
private readonly InvoiceFinalizeOptions finalizeOptions;
private readonly InvoiceMarkUncollectibleOptions markUncollectibleOptions;
private readonly InvoiceSendOptions sendOptions;
@@ -67,13 +66,6 @@ public InvoiceServiceTest(
Subscription = "sub_123",
};
- this.upcomingListLineItemsOptions = new InvoiceUpcomingLinesListOptions()
- {
- Limit = 1,
- Customer = "cus_123",
- Subscription = "sub_123",
- };
-
this.finalizeOptions = new InvoiceFinalizeOptions
{
};
@@ -239,44 +231,6 @@ public async Task ListLineItemsAutoPagingAsync()
Assert.Equal("line_item", lineItem.Object);
}
- [Fact]
- public void ListUpcomingLineItems()
- {
- var lineItems = this.service.UpcomingLines.List(this.upcomingListLineItemsOptions);
- this.AssertRequest(HttpMethod.Get, "/v1/invoices/upcoming/lines");
- Assert.NotNull(lineItems);
- Assert.Equal("list", lineItems.Object);
- Assert.Single(lineItems.Data);
- Assert.Equal("line_item", lineItems.Data[0].Object);
- }
-
- [Fact]
- public async Task ListUpcomingLineItemsAsync()
- {
- var lineItems = await this.service.UpcomingLines.ListAsync(this.upcomingListLineItemsOptions);
- this.AssertRequest(HttpMethod.Get, "/v1/invoices/upcoming/lines");
- Assert.NotNull(lineItems);
- Assert.Equal("list", lineItems.Object);
- Assert.Single(lineItems.Data);
- Assert.Equal("line_item", lineItems.Data[0].Object);
- }
-
- [Fact]
- public void ListUpcomingLineItemsAutoPaging()
- {
- var lineItem = this.service.UpcomingLines.ListAutoPaging(this.upcomingListLineItemsOptions).First();
- Assert.NotNull(lineItem);
- Assert.Equal("line_item", lineItem.Object);
- }
-
- [Fact]
- public async Task ListUpcomingLineItemsAutoPagingAsync()
- {
- var lineItem = await this.service.UpcomingLines.ListAutoPagingAsync(this.upcomingListLineItemsOptions).FirstAsync();
- Assert.NotNull(lineItem);
- Assert.Equal("line_item", lineItem.Object);
- }
-
[Fact]
public void MarkUncollectible()
{
diff --git a/src/StripeTests/Services/Invoices/UpcomingInvoiceListLineItemsOptionsTest.cs b/src/StripeTests/Services/Invoices/UpcomingInvoiceListLineItemsOptionsTest.cs
deleted file mode 100644
index c56111360c..0000000000
--- a/src/StripeTests/Services/Invoices/UpcomingInvoiceListLineItemsOptionsTest.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-namespace StripeTests
-{
- using System;
- using Stripe;
- using Stripe.Infrastructure.FormEncoding;
- using Xunit;
-
- public class UpcomingInvoiceListLineItemsOptionsTest : BaseStripeTest
- {
- [Fact]
- public void SerializeSubscriptionBillingCycleAnchor()
- {
- var testCases = new[]
- {
- new
- {
- options = new InvoiceUpcomingLinesListOptions()
- {
- SubscriptionBillingCycleAnchor = DateTime.Parse("Fri, 13 Feb 2009 23:31:30Z"),
- },
- want = "subscription_billing_cycle_anchor=1234567890",
- },
- new
- {
- options = new InvoiceUpcomingLinesListOptions
- {
- SubscriptionBillingCycleAnchor = SubscriptionBillingCycleAnchor.Now,
- },
- want = "subscription_billing_cycle_anchor=now",
- },
- new
- {
- options = new InvoiceUpcomingLinesListOptions
- {
- SubscriptionBillingCycleAnchor = SubscriptionBillingCycleAnchor.Unchanged,
- },
- want = "subscription_billing_cycle_anchor=unchanged",
- },
- new
- {
- options = new InvoiceUpcomingLinesListOptions
- {
- SubscriptionTrialEnd = DateTime.Parse("Fri, 13 Feb 2009 23:31:30Z"),
- },
- want = "subscription_trial_end=1234567890",
- },
- new
- {
- options = new InvoiceUpcomingLinesListOptions
- {
- SubscriptionTrialEnd = SubscriptionTrialEnd.Now,
- },
- want = "subscription_trial_end=now",
- },
- };
-
- foreach (var testCase in testCases)
- {
- Assert.Equal(testCase.want, ContentEncoder.CreateQueryString(testCase.options));
- }
- }
- }
-}