Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Init options with forced parameter values #1699

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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