From e8b894d01b4ab421333d70b7ac482409cc516ace Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Thu, 18 Jul 2019 10:33:47 -0700 Subject: [PATCH] Init options with default parameter values (#1699) --- src/Stripe.net/Services/BankAccounts/BankAccountService.cs | 6 +++--- src/Stripe.net/Services/Cards/CardService.cs | 6 +++--- src/Stripe.net/Services/Sources/SourceService.cs | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Stripe.net/Services/BankAccounts/BankAccountService.cs b/src/Stripe.net/Services/BankAccounts/BankAccountService.cs index b12611f2f7..1206f64405 100644 --- a/src/Stripe.net/Services/BankAccounts/BankAccountService.cs +++ b/src/Stripe.net/Services/BankAccounts/BankAccountService.cs @@ -60,17 +60,17 @@ public virtual BankAccount Get(string customerId, string bankAccountId, BankAcco public virtual StripeList List(string customerId, BankAccountListOptions options = null, RequestOptions requestOptions = null) { - return this.ListNestedEntities(customerId, options, requestOptions); + return this.ListNestedEntities(customerId, options ?? new BankAccountListOptions(), requestOptions); } public virtual Task> ListAsync(string customerId, BankAccountListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.ListNestedEntitiesAsync(customerId, options, requestOptions, cancellationToken); + return this.ListNestedEntitiesAsync(customerId, options ?? new BankAccountListOptions(), requestOptions, cancellationToken); } public virtual IEnumerable ListAutoPaging(string customerId, BankAccountListOptions options = null, RequestOptions requestOptions = null) { - return this.ListNestedEntitiesAutoPaging(customerId, options, requestOptions); + return this.ListNestedEntitiesAutoPaging(customerId, options ?? new BankAccountListOptions(), requestOptions); } public virtual BankAccount Update(string customerId, string bankAccountId, BankAccountUpdateOptions options, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Cards/CardService.cs b/src/Stripe.net/Services/Cards/CardService.cs index 83b46dcf3e..6a59afe18c 100644 --- a/src/Stripe.net/Services/Cards/CardService.cs +++ b/src/Stripe.net/Services/Cards/CardService.cs @@ -62,17 +62,17 @@ public virtual Card Get(string customerId, string cardId, CardGetOptions options public virtual StripeList List(string customerId, CardListOptions options = null, RequestOptions requestOptions = null) { - return this.ListNestedEntities(customerId, options, requestOptions); + return this.ListNestedEntities(customerId, options ?? new CardListOptions(), requestOptions); } public virtual Task> ListAsync(string customerId, CardListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.ListNestedEntitiesAsync(customerId, options, requestOptions, cancellationToken); + return this.ListNestedEntitiesAsync(customerId, options ?? new CardListOptions(), requestOptions, cancellationToken); } public virtual IEnumerable ListAutoPaging(string customerId, CardListOptions options = null, RequestOptions requestOptions = null) { - return this.ListNestedEntitiesAutoPaging(customerId, options, requestOptions); + return this.ListNestedEntitiesAutoPaging(customerId, options ?? new CardListOptions(), requestOptions); } public virtual Card Update(string customerId, string cardId, CardUpdateOptions options, RequestOptions requestOptions = null) diff --git a/src/Stripe.net/Services/Sources/SourceService.cs b/src/Stripe.net/Services/Sources/SourceService.cs index 15207fb8f9..2c4afe6a11 100644 --- a/src/Stripe.net/Services/Sources/SourceService.cs +++ b/src/Stripe.net/Services/Sources/SourceService.cs @@ -66,17 +66,17 @@ public virtual Source Get(string sourceId, SourceGetOptions options = null, Requ public virtual StripeList List(string customerId, SourceListOptions options = null, RequestOptions requestOptions = null) { - return this.Request>(HttpMethod.Get, $"/v1/customers/{customerId}/sources", options, requestOptions); + return this.Request>(HttpMethod.Get, $"/v1/customers/{customerId}/sources", options ?? new SourceListOptions(), requestOptions); } public virtual Task> ListAsync(string customerId, SourceListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken)) { - return this.RequestAsync>(HttpMethod.Get, $"/v1/customers/{customerId}/sources", options, requestOptions, cancellationToken); + return this.RequestAsync>(HttpMethod.Get, $"/v1/customers/{customerId}/sources", options ?? new SourceListOptions(), requestOptions, cancellationToken); } public virtual IEnumerable ListAutoPaging(string customerId, SourceListOptions options = null, RequestOptions requestOptions = null) { - return this.ListRequestAutoPaging($"/v1/customers/{customerId}/sources", options, requestOptions); + return this.ListRequestAutoPaging($"/v1/customers/{customerId}/sources", options ?? new SourceListOptions(), requestOptions); } public virtual Source Update(string sourceId, SourceUpdateOptions options, RequestOptions requestOptions = null)