Skip to content

Commit

Permalink
Init options with default parameter values (#1699)
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe authored Jul 18, 2019
1 parent 07e57d5 commit e8b894d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/Stripe.net/Services/BankAccounts/BankAccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ public virtual BankAccount Get(string customerId, string bankAccountId, BankAcco

public virtual StripeList<BankAccount> 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<StripeList<BankAccount>> 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<BankAccount> 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)
Expand Down
6 changes: 3 additions & 3 deletions src/Stripe.net/Services/Cards/CardService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public virtual Card Get(string customerId, string cardId, CardGetOptions options

public virtual StripeList<Card> 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<StripeList<Card>> 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<Card> 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)
Expand Down
6 changes: 3 additions & 3 deletions src/Stripe.net/Services/Sources/SourceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ public virtual Source Get(string sourceId, SourceGetOptions options = null, Requ

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

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

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

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

0 comments on commit e8b894d

Please sign in to comment.