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

Add specialized ListOptions for each resource #1083

Merged
merged 1 commit into from
Jan 16, 2018
Merged

Add specialized ListOptions for each resource #1083

merged 1 commit into from
Jan 16, 2018

Conversation

ob-stripe
Copy link
Contributor

r? @remi-stripe
cc @stripe/api-libraries @anelder-stripe

Fixes #974.

This PR adds specialized ListOptions classes for every resource.

Copy link
Contributor

@remi-stripe remi-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ob-stripe added some comments for now but mostly LGTM

@@ -54,7 +54,7 @@ public transfer_reversals_fixture()
TransferReversal = service.Create(Transfer.Id, TransferReversalCreateOptions);
TransferReversalUpdated = service.Update(Transfer.Id, TransferReversal.Id, TransferReversalUpdateOptions);
TransferReversalRetrieved = service.Get(Transfer.Id, TransferReversal.Id);
TransferReversalList = service.List(Transfer.Id, new StripeListOptions());
TransferReversalList = service.List(Transfer.Id, TransferReversalListOptions);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why don't you need a new here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! I didn't see that TransferReversalListOptions was declared but never initialized. This is now fixed.

@@ -17,7 +17,7 @@ public class when_listing_country_specs
Because of = () =>
{
_countrySpecList = _countrySpecService.List(
new StripeListOptions() { Limit = 8 }
new CountrySpecListOptions() { Limit = 8 }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not StripeCountrySpecListOptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To maintain consistency with all the other classes (service and entities). I agree that we should fix this, but it's a job for a different PR and in the meantime I'd rather maintain consistency within each resource.


namespace Stripe
{
public class BankAccountListOptions : StripeListOptions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not StripeBankAccountListOptions? I guess it's because of the class name discrepancies but it makes it confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same answer as for CountrySpec: to maintain internal consistency with the other BankAccount classes (entity, service and other options classes). Also something that we should fix separately.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see but it seems better (to me) to keep consistency with the new naming of the ListOptions than the parent class itself. Especially as those are the only 2 that are different

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree, but since we're going to release a new major version anyway, I guess now's as good a time as any to fix all those classes :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good :)

@stripe-ci
Copy link

@ob-stripe ob-stripe merged commit ca5715a into master Jan 16, 2018
@ob-stripe ob-stripe deleted the ob-fix-974 branch January 16, 2018 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants