|
| 1 | +namespace Stripe |
| 2 | +{ |
| 3 | + using System.Collections.Generic; |
| 4 | + using System.Threading; |
| 5 | + using System.Threading.Tasks; |
| 6 | + using Stripe.Infrastructure; |
| 7 | + |
| 8 | + public class PersonService : ServiceNested<Person>, |
| 9 | + INestedCreatable<Person, PersonCreateOptions>, |
| 10 | + INestedListable<Person, PersonListOptions>, |
| 11 | + INestedRetrievable<Person>, |
| 12 | + INestedUpdatable<Person, PersonUpdateOptions> |
| 13 | + { |
| 14 | + public PersonService() |
| 15 | + : base(null) |
| 16 | + { |
| 17 | + } |
| 18 | + |
| 19 | + public PersonService(string apiKey) |
| 20 | + : base(apiKey) |
| 21 | + { |
| 22 | + } |
| 23 | + |
| 24 | + public override string BasePath => "/accounts/{PARENT_ID}/persons"; |
| 25 | + |
| 26 | + public bool ExpandBalanceTransaction { get; set; } |
| 27 | + |
| 28 | + public bool ExpandTransfer { get; set; } |
| 29 | + |
| 30 | + public virtual Person Create(string accountId, PersonCreateOptions options = null, RequestOptions requestOptions = null) |
| 31 | + { |
| 32 | + return this.CreateNestedEntity(accountId, options, requestOptions); |
| 33 | + } |
| 34 | + |
| 35 | + public virtual Task<Person> CreateAsync(string accountId, PersonCreateOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 36 | + { |
| 37 | + return this.CreateNestedEntityAsync(accountId, options, requestOptions, cancellationToken); |
| 38 | + } |
| 39 | + |
| 40 | + public virtual Person Delete(string accountId, string personId, RequestOptions requestOptions = null) |
| 41 | + { |
| 42 | + return this.DeleteNestedEntity(accountId, personId, null, requestOptions); |
| 43 | + } |
| 44 | + |
| 45 | + public virtual Task<Person> DeleteAsync(string accountId, string personId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 46 | + { |
| 47 | + return this.DeleteNestedEntityAsync(accountId, personId, null, requestOptions, cancellationToken); |
| 48 | + } |
| 49 | + |
| 50 | + public virtual Person Get(string accountId, string personId, RequestOptions requestOptions = null) |
| 51 | + { |
| 52 | + return this.GetNestedEntity(accountId, personId, null, requestOptions); |
| 53 | + } |
| 54 | + |
| 55 | + public virtual Task<Person> GetAsync(string accountId, string personId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 56 | + { |
| 57 | + return this.GetNestedEntityAsync(accountId, personId, null, requestOptions, cancellationToken); |
| 58 | + } |
| 59 | + |
| 60 | + public virtual StripeList<Person> List(string accountId, PersonListOptions options = null, RequestOptions requestOptions = null) |
| 61 | + { |
| 62 | + return this.ListNestedEntities(accountId, options, requestOptions); |
| 63 | + } |
| 64 | + |
| 65 | + public virtual Task<StripeList<Person>> ListAsync(string accountId, PersonListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 66 | + { |
| 67 | + return this.ListNestedEntitiesAsync(accountId, options, requestOptions, cancellationToken); |
| 68 | + } |
| 69 | + |
| 70 | + public virtual Person Update(string accountId, string personId, PersonUpdateOptions options, RequestOptions requestOptions = null) |
| 71 | + { |
| 72 | + return this.UpdateNestedEntity(accountId, personId, options, requestOptions); |
| 73 | + } |
| 74 | + |
| 75 | + public virtual Task<Person> UpdateAsync(string accountId, string personId, PersonUpdateOptions options, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) |
| 76 | + { |
| 77 | + return this.UpdateNestedEntityAsync(accountId, personId, options, requestOptions, cancellationToken); |
| 78 | + } |
| 79 | + } |
| 80 | +} |
0 commit comments