Skip to content

Commit

Permalink
Add options classes for Get/GetAsync methods (#1644)
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe committed Jun 6, 2019
1 parent 4ba7c53 commit 17a1c2b
Show file tree
Hide file tree
Showing 134 changed files with 627 additions and 343 deletions.
6 changes: 6 additions & 0 deletions src/Stripe.net/Services/Account/AccountGetOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class AccountGetOptions : BaseOptions
{
}
}
10 changes: 5 additions & 5 deletions src/Stripe.net/Services/Account/AccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class AccountService : Service<Account>,
ICreatable<Account, AccountCreateOptions>,
IDeletable<Account>,
IListable<Account, AccountListOptions>,
IRetrievable<Account>,
IRetrievable<Account, AccountGetOptions>,
IUpdatable<Account, AccountUpdateOptions>
{
public AccountService()
Expand Down Expand Up @@ -46,14 +46,14 @@ public virtual Account Delete(string accountId, RequestOptions requestOptions =
return this.DeleteEntityAsync(accountId, null, requestOptions, cancellationToken);
}

public virtual Account Get(string accountId, RequestOptions requestOptions = null)
public virtual Account Get(string accountId, AccountGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetEntity(accountId, null, requestOptions);
return this.GetEntity(accountId, options, requestOptions);
}

public virtual Task<Account> GetAsync(string accountId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<Account> GetAsync(string accountId, AccountGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetEntityAsync(accountId, null, requestOptions, cancellationToken);
return this.GetEntityAsync(accountId, options, requestOptions, cancellationToken);
}

public virtual Account GetSelf(RequestOptions requestOptions = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class ApplePayDomainGetOptions : BaseOptions
{
}
}
10 changes: 5 additions & 5 deletions src/Stripe.net/Services/ApplePayDomains/ApplePayDomainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class ApplePayDomainService : Service<ApplePayDomain>,
ICreatable<ApplePayDomain, ApplePayDomainCreateOptions>,
IDeletable<ApplePayDomain>,
IListable<ApplePayDomain, ApplePayDomainListOptions>,
IRetrievable<ApplePayDomain>
IRetrievable<ApplePayDomain, ApplePayDomainGetOptions>
{
public ApplePayDomainService()
: base(null)
Expand Down Expand Up @@ -42,14 +42,14 @@ public virtual ApplePayDomain Delete(string domainId, RequestOptions requestOpti
return this.DeleteEntityAsync(domainId, null, requestOptions, cancellationToken);
}

public virtual ApplePayDomain Get(string domainId, RequestOptions requestOptions = null)
public virtual ApplePayDomain Get(string domainId, ApplePayDomainGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetEntity(domainId, null, requestOptions);
return this.GetEntity(domainId, options, requestOptions);
}

public virtual Task<ApplePayDomain> GetAsync(string domainId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<ApplePayDomain> GetAsync(string domainId, ApplePayDomainGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetEntityAsync(domainId, null, requestOptions, cancellationToken);
return this.GetEntityAsync(domainId, options, requestOptions, cancellationToken);
}

public virtual StripeList<ApplePayDomain> List(ApplePayDomainListOptions options = null, RequestOptions requestOptions = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class ApplicationFeeRefundGetOptions : BaseOptions
{
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
namespace Stripe
{
using Newtonsoft.Json;

public class ApplicationFeeRefundListOptions : ListOptions
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Stripe
public class ApplicationFeeRefundService : ServiceNested<ApplicationFeeRefund>,
INestedCreatable<ApplicationFeeRefund, ApplicationFeeRefundCreateOptions>,
INestedListable<ApplicationFeeRefund, ApplicationFeeRefundListOptions>,
INestedRetrievable<ApplicationFeeRefund>,
INestedRetrievable<ApplicationFeeRefund, ApplicationFeeRefundGetOptions>,
INestedUpdatable<ApplicationFeeRefund, ApplicationFeeRefundUpdateOptions>
{
public ApplicationFeeRefundService()
Expand Down Expand Up @@ -36,14 +36,14 @@ public virtual ApplicationFeeRefund Create(string applicationFeeId, ApplicationF
return this.CreateNestedEntityAsync(applicationFeeId, options, requestOptions, cancellationToken);
}

public virtual ApplicationFeeRefund Get(string applicationFeeId, string refundId, RequestOptions requestOptions = null)
public virtual ApplicationFeeRefund Get(string applicationFeeId, string refundId, ApplicationFeeRefundGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetNestedEntity(applicationFeeId, refundId, null, requestOptions);
return this.GetNestedEntity(applicationFeeId, refundId, options, requestOptions);
}

public virtual Task<ApplicationFeeRefund> GetAsync(string applicationFeeId, string refundId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<ApplicationFeeRefund> GetAsync(string applicationFeeId, string refundId, ApplicationFeeRefundGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetNestedEntityAsync(applicationFeeId, refundId, null, requestOptions, cancellationToken);
return this.GetNestedEntityAsync(applicationFeeId, refundId, options, requestOptions, cancellationToken);
}

public virtual StripeList<ApplicationFeeRefund> List(string applicationFeeId, ApplicationFeeRefundListOptions options = null, RequestOptions requestOptions = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class ApplicationFeeGetOptions : BaseOptions
{
}
}
10 changes: 5 additions & 5 deletions src/Stripe.net/Services/ApplicationFees/ApplicationFeeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe

public class ApplicationFeeService : Service<ApplicationFee>,
IListable<ApplicationFee, ApplicationFeeListOptions>,
IRetrievable<ApplicationFee>
IRetrievable<ApplicationFee, ApplicationFeeGetOptions>
{
public ApplicationFeeService()
: base(null)
Expand All @@ -30,14 +30,14 @@ public ApplicationFeeService(IStripeClient client)

public bool ExpandOriginatingTransaction { get; set; }

public virtual ApplicationFee Get(string applicationFeeId, RequestOptions requestOptions = null)
public virtual ApplicationFee Get(string applicationFeeId, ApplicationFeeGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetEntity(applicationFeeId, null, requestOptions);
return this.GetEntity(applicationFeeId, options, requestOptions);
}

public virtual Task<ApplicationFee> GetAsync(string applicationFeeId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<ApplicationFee> GetAsync(string applicationFeeId, ApplicationFeeGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetEntityAsync(applicationFeeId, null, requestOptions, cancellationToken);
return this.GetEntityAsync(applicationFeeId, options, requestOptions, cancellationToken);
}

public virtual StripeList<ApplicationFee> List(ApplicationFeeListOptions options = null, RequestOptions requestOptions = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class BalanceTransactionGetOptions : BaseOptions
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe

public class BalanceTransactionService : Service<BalanceTransaction>,
IListable<BalanceTransaction, BalanceTransactionListOptions>,
IRetrievable<BalanceTransaction>
IRetrievable<BalanceTransaction, BalanceTransactionGetOptions>
{
public BalanceTransactionService()
: base(null)
Expand All @@ -22,14 +22,14 @@ public BalanceTransactionService(IStripeClient client)

public bool ExpandSource { get; set; }

public virtual BalanceTransaction Get(string balanceTransactionId, RequestOptions requestOptions = null)
public virtual BalanceTransaction Get(string balanceTransactionId, BalanceTransactionGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetEntity(balanceTransactionId, null, requestOptions);
return this.GetEntity(balanceTransactionId, options, requestOptions);
}

public virtual Task<BalanceTransaction> GetAsync(string balanceTransactionId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<BalanceTransaction> GetAsync(string balanceTransactionId, BalanceTransactionGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetEntityAsync(balanceTransactionId, null, requestOptions, cancellationToken);
return this.GetEntityAsync(balanceTransactionId, options, requestOptions, cancellationToken);
}

public virtual StripeList<BalanceTransaction> List(BalanceTransactionListOptions options = null, RequestOptions requestOptions = null)
Expand Down
6 changes: 6 additions & 0 deletions src/Stripe.net/Services/BankAccounts/BankAccountGetOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class BankAccountGetOptions : BaseOptions
{
}
}
10 changes: 5 additions & 5 deletions src/Stripe.net/Services/BankAccounts/BankAccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class BankAccountService : ServiceNested<BankAccount>,
INestedCreatable<BankAccount, BankAccountCreateOptions>,
INestedDeletable<BankAccount>,
INestedListable<BankAccount, BankAccountListOptions>,
INestedRetrievable<BankAccount>,
INestedRetrievable<BankAccount, BankAccountGetOptions>,
INestedUpdatable<BankAccount, BankAccountUpdateOptions>
{
public BankAccountService()
Expand Down Expand Up @@ -46,14 +46,14 @@ public virtual BankAccount Delete(string customerId, string bankAccountId, Reque
return this.DeleteNestedEntityAsync(customerId, bankAccountId, null, requestOptions, cancellationToken);
}

public virtual BankAccount Get(string customerId, string bankAccountId, RequestOptions requestOptions = null)
public virtual BankAccount Get(string customerId, string bankAccountId, BankAccountGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetNestedEntity(customerId, bankAccountId, null, requestOptions);
return this.GetNestedEntity(customerId, bankAccountId, options, requestOptions);
}

public virtual Task<BankAccount> GetAsync(string customerId, string bankAccountId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<BankAccount> GetAsync(string customerId, string bankAccountId, BankAccountGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetNestedEntityAsync(customerId, bankAccountId, null, requestOptions, cancellationToken);
return this.GetNestedEntityAsync(customerId, bankAccountId, options, requestOptions, cancellationToken);
}

public virtual StripeList<BankAccount> List(string customerId, BankAccountListOptions options = null, RequestOptions requestOptions = null)
Expand Down
6 changes: 6 additions & 0 deletions src/Stripe.net/Services/Capabilities/CapabilityGetOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class CapabilityGetOptions : BaseOptions
{
}
}
2 changes: 0 additions & 2 deletions src/Stripe.net/Services/Capabilities/CapabilityListOptions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
namespace Stripe
{
using Newtonsoft.Json;

public class CapabilityListOptions : ListOptions
{
}
Expand Down
10 changes: 5 additions & 5 deletions src/Stripe.net/Services/Capabilities/CapabilityService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe

public class CapabilityService : ServiceNested<Capability>,
INestedListable<Capability, CapabilityListOptions>,
INestedRetrievable<Capability>,
INestedRetrievable<Capability, CapabilityGetOptions>,
INestedUpdatable<Capability, CapabilityUpdateOptions>
{
public CapabilityService()
Expand All @@ -23,14 +23,14 @@ public CapabilityService(IStripeClient client)

public bool ExpandAccount { get; set; }

public virtual Capability Get(string accountId, string capabilityId, RequestOptions requestOptions = null)
public virtual Capability Get(string accountId, string capabilityId, CapabilityGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetNestedEntity(accountId, capabilityId, null, requestOptions);
return this.GetNestedEntity(accountId, capabilityId, options, requestOptions);
}

public virtual Task<Capability> GetAsync(string accountId, string capabilityId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<Capability> GetAsync(string accountId, string capabilityId, CapabilityGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetNestedEntityAsync(accountId, capabilityId, null, requestOptions, cancellationToken);
return this.GetNestedEntityAsync(accountId, capabilityId, options, requestOptions, cancellationToken);
}

public virtual StripeList<Capability> List(string accountId, CapabilityListOptions options = null, RequestOptions requestOptions = null)
Expand Down
6 changes: 6 additions & 0 deletions src/Stripe.net/Services/Cards/CardGetOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class CardGetOptions : BaseOptions
{
}
}
10 changes: 5 additions & 5 deletions src/Stripe.net/Services/Cards/CardService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class CardService : ServiceNested<Card>,
INestedCreatable<Card, CardCreateOptions>,
INestedDeletable<Card>,
INestedListable<Card, CardListOptions>,
INestedRetrievable<Card>,
INestedRetrievable<Card, CardGetOptions>,
INestedUpdatable<Card, CardUpdateOptions>
{
public CardService()
Expand Down Expand Up @@ -47,14 +47,14 @@ public virtual Card Delete(string customerId, string cardId, RequestOptions requ
return this.DeleteNestedEntityAsync(customerId, cardId, null, requestOptions, cancellationToken);
}

public virtual Card Get(string customerId, string cardId, RequestOptions requestOptions = null)
public virtual Card Get(string customerId, string cardId, CardGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetNestedEntity(customerId, cardId, null, requestOptions);
return this.GetNestedEntity(customerId, cardId, options, requestOptions);
}

public virtual Task<Card> GetAsync(string customerId, string cardId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<Card> GetAsync(string customerId, string cardId, CardGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetNestedEntityAsync(customerId, cardId, null, requestOptions, cancellationToken);
return this.GetNestedEntityAsync(customerId, cardId, options, requestOptions, cancellationToken);
}

public virtual StripeList<Card> List(string customerId, CardListOptions options = null, RequestOptions requestOptions = null)
Expand Down
6 changes: 6 additions & 0 deletions src/Stripe.net/Services/Charges/ChargeGetOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class ChargeGetOptions : BaseOptions
{
}
}
10 changes: 5 additions & 5 deletions src/Stripe.net/Services/Charges/ChargeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Stripe
public class ChargeService : Service<Charge>,
ICreatable<Charge, ChargeCreateOptions>,
IListable<Charge, ChargeListOptions>,
IRetrievable<Charge>,
IRetrievable<Charge, ChargeGetOptions>,
IUpdatable<Charge, ChargeUpdateOptions>
{
public ChargeService()
Expand Down Expand Up @@ -69,14 +69,14 @@ public virtual Charge Create(ChargeCreateOptions options, RequestOptions request
return this.CreateEntityAsync(options, requestOptions, cancellationToken);
}

public virtual Charge Get(string chargeId, RequestOptions requestOptions = null)
public virtual Charge Get(string chargeId, ChargeGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetEntity(chargeId, null, requestOptions);
return this.GetEntity(chargeId, options, requestOptions);
}

public virtual Task<Charge> GetAsync(string chargeId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<Charge> GetAsync(string chargeId, ChargeGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetEntityAsync(chargeId, null, requestOptions, cancellationToken);
return this.GetEntityAsync(chargeId, options, requestOptions, cancellationToken);
}

public virtual StripeList<Charge> List(ChargeListOptions options = null, RequestOptions requestOptions = null)
Expand Down
6 changes: 6 additions & 0 deletions src/Stripe.net/Services/Checkout/SessionGetOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe.Checkout
{
public class SessionGetOptions : BaseOptions
{
}
}
8 changes: 4 additions & 4 deletions src/Stripe.net/Services/Checkout/SessionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public virtual Session Create(SessionCreateOptions options, RequestOptions reque
return this.CreateEntityAsync(options, requestOptions, cancellationToken);
}

public virtual Session Get(string sessionId, RequestOptions requestOptions = null)
public virtual Session Get(string sessionId, SessionGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetEntity(sessionId, null, requestOptions);
return this.GetEntity(sessionId, options, requestOptions);
}

public virtual Task<Session> GetAsync(string sessionId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<Session> GetAsync(string sessionId, SessionGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetEntityAsync(sessionId, null, requestOptions, cancellationToken);
return this.GetEntityAsync(sessionId, options, requestOptions, cancellationToken);
}
}
}
6 changes: 6 additions & 0 deletions src/Stripe.net/Services/CountrySpecs/CountrySpecGetOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Stripe
{
public class CountrySpecGetOptions : BaseOptions
{
}
}
10 changes: 5 additions & 5 deletions src/Stripe.net/Services/CountrySpecs/CountrySpecService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Stripe

public class CountrySpecService : Service<CountrySpec>,
IListable<CountrySpec, CountrySpecListOptions>,
IRetrievable<CountrySpec>
IRetrievable<CountrySpec, CountrySpecGetOptions>
{
public CountrySpecService()
: base(null)
Expand All @@ -20,14 +20,14 @@ public CountrySpecService(IStripeClient client)

public override string BasePath => "/v1/country_specs";

public virtual CountrySpec Get(string country, RequestOptions requestOptions = null)
public virtual CountrySpec Get(string country, CountrySpecGetOptions options = null, RequestOptions requestOptions = null)
{
return this.GetEntity(country, null, requestOptions);
return this.GetEntity(country, options, requestOptions);
}

public virtual Task<CountrySpec> GetAsync(string country, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual Task<CountrySpec> GetAsync(string country, CountrySpecGetOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
{
return this.GetEntityAsync(country, null, requestOptions, cancellationToken);
return this.GetEntityAsync(country, options, requestOptions, cancellationToken);
}

public virtual StripeList<CountrySpec> List(CountrySpecListOptions options = null, RequestOptions requestOptions = null)
Expand Down
Loading

0 comments on commit 17a1c2b

Please sign in to comment.