Skip to content

Commit db3b1a7

Browse files
committed
Init options with default parameter values (#1699)
1 parent 456d8fd commit db3b1a7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Stripe.net/Services/BankAccounts/BankAccountService.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ public virtual BankAccount Get(string customerId, string bankAccountId, BankAcco
6060

6161
public virtual StripeList<BankAccount> List(string customerId, BankAccountListOptions options = null, RequestOptions requestOptions = null)
6262
{
63-
return this.ListNestedEntities(customerId, options, requestOptions);
63+
return this.ListNestedEntities(customerId, options ?? new BankAccountListOptions(), requestOptions);
6464
}
6565

6666
public virtual Task<StripeList<BankAccount>> ListAsync(string customerId, BankAccountListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
6767
{
68-
return this.ListNestedEntitiesAsync(customerId, options, requestOptions, cancellationToken);
68+
return this.ListNestedEntitiesAsync(customerId, options ?? new BankAccountListOptions(), requestOptions, cancellationToken);
6969
}
7070

7171
public virtual IEnumerable<BankAccount> ListAutoPaging(string customerId, BankAccountListOptions options = null, RequestOptions requestOptions = null)
7272
{
73-
return this.ListNestedEntitiesAutoPaging(customerId, options, requestOptions);
73+
return this.ListNestedEntitiesAutoPaging(customerId, options ?? new BankAccountListOptions(), requestOptions);
7474
}
7575

7676
public virtual BankAccount Update(string customerId, string bankAccountId, BankAccountUpdateOptions options, RequestOptions requestOptions = null)

src/Stripe.net/Services/Cards/CardService.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,17 @@ public virtual Card Get(string customerId, string cardId, CardGetOptions options
6262

6363
public virtual StripeList<Card> List(string customerId, CardListOptions options = null, RequestOptions requestOptions = null)
6464
{
65-
return this.ListNestedEntities(customerId, options, requestOptions);
65+
return this.ListNestedEntities(customerId, options ?? new CardListOptions(), requestOptions);
6666
}
6767

6868
public virtual Task<StripeList<Card>> ListAsync(string customerId, CardListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
6969
{
70-
return this.ListNestedEntitiesAsync(customerId, options, requestOptions, cancellationToken);
70+
return this.ListNestedEntitiesAsync(customerId, options ?? new CardListOptions(), requestOptions, cancellationToken);
7171
}
7272

7373
public virtual IEnumerable<Card> ListAutoPaging(string customerId, CardListOptions options = null, RequestOptions requestOptions = null)
7474
{
75-
return this.ListNestedEntitiesAutoPaging(customerId, options, requestOptions);
75+
return this.ListNestedEntitiesAutoPaging(customerId, options ?? new CardListOptions(), requestOptions);
7676
}
7777

7878
public virtual Card Update(string customerId, string cardId, CardUpdateOptions options, RequestOptions requestOptions = null)

src/Stripe.net/Services/Sources/SourceService.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@ public virtual Source Get(string sourceId, SourceGetOptions options = null, Requ
6666

6767
public virtual StripeList<Source> List(string customerId, SourceListOptions options = null, RequestOptions requestOptions = null)
6868
{
69-
return this.Request<StripeList<Source>>(HttpMethod.Get, $"/v1/customers/{customerId}/sources", options, requestOptions);
69+
return this.Request<StripeList<Source>>(HttpMethod.Get, $"/v1/customers/{customerId}/sources", options ?? new SourceListOptions(), requestOptions);
7070
}
7171

7272
public virtual Task<StripeList<Source>> ListAsync(string customerId, SourceListOptions options = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default(CancellationToken))
7373
{
74-
return this.RequestAsync<StripeList<Source>>(HttpMethod.Get, $"/v1/customers/{customerId}/sources", options, requestOptions, cancellationToken);
74+
return this.RequestAsync<StripeList<Source>>(HttpMethod.Get, $"/v1/customers/{customerId}/sources", options ?? new SourceListOptions(), requestOptions, cancellationToken);
7575
}
7676

7777
public virtual IEnumerable<Source> ListAutoPaging(string customerId, SourceListOptions options = null, RequestOptions requestOptions = null)
7878
{
79-
return this.ListRequestAutoPaging<Source>($"/v1/customers/{customerId}/sources", options, requestOptions);
79+
return this.ListRequestAutoPaging<Source>($"/v1/customers/{customerId}/sources", options ?? new SourceListOptions(), requestOptions);
8080
}
8181

8282
public virtual Source Update(string sourceId, SourceUpdateOptions options, RequestOptions requestOptions = null)

0 commit comments

Comments
 (0)