Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove StripeList.TotalCount #1429

Merged
merged 1 commit into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions src/Stripe.net/Entities/StripeList.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
namespace Stripe
{
using System;
using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json;
Expand All @@ -9,21 +8,28 @@ namespace Stripe
[JsonObject]
public class StripeList<T> : StripeEntity, IHasObject, IEnumerable<T>
{
/// <summary>
/// A string describing the object type returned.
/// </summary>
[JsonProperty("object")]
public string Object { get; set; }

/// <summary>
/// A list containing the actual response elements, paginated by any request parameters.
/// </summary>
[JsonProperty("data", ItemConverterType = typeof(StripeObjectConverter))]
public List<T> Data { get; set; }

/// <summary>
/// This field is only valid in the context of paging.
/// Whether or not there are more elements available after this set. If <code>false</code>,
/// this set comprises the end of the list.
/// </summary>
[JsonProperty("has_more")]
public bool HasMore { get; set; }

[JsonProperty("total_count")]
public long TotalCount { get; set; }

/// <summary>
/// The URL for accessing this list.
/// </summary>
[JsonProperty("url")]
public string Url { get; set; }

Expand Down
12 changes: 9 additions & 3 deletions src/Stripe.net/Services/ListOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ namespace Stripe
public class ListOptions : BaseOptions
{
/// <summary>
/// A limit on the number of objects to be returned. Limit can range between 1 and 100 items.
/// A limit on the number of objects to be returned, between 1 and 100.
/// </summary>
[JsonProperty("limit")]
public long? Limit { get; set; }

/// <summary>
/// A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.
/// A cursor for use in pagination. <code>starting_after</code> is an object ID that defines
/// your place in the list. For instance, if you make a list request and receive 100
/// objects, ending with <code>obj_foo</code>, your subsequent call can include
/// <code>starting_after=obj_foo</code> in order to fetch the next page of the list.
/// </summary>
[JsonProperty("starting_after")]
public string StartingAfter { get; set; }

/// <summary>
/// A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.
/// A cursor for use in pagination. <code>ending_before</code> is an object ID that defines
/// your place in the list. For instance, if you make a list request and receive 100
/// objects, starting with <code>obj_bar</code>, your subsequent call can include
/// <code>ending_before=obj_bar</code> in order to fetch the previous page of the list.
/// </summary>
[JsonProperty("ending_before")]
public string EndingBefore { get; set; }
Expand Down
1 change: 0 additions & 1 deletion src/Stripe.net/Services/ListOptionsWithCreated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ namespace Stripe
{
using System;
using Newtonsoft.Json;
using Stripe.Infrastructure;

public class ListOptionsWithCreated : ListOptions
{
Expand Down