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

Handle DateTimes directly in the encoder #1283

Merged
merged 2 commits into from
Sep 13, 2018

Conversation

ob-stripe
Copy link
Contributor

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

Handle DateTimes directly in the encoder, and update all DateTimes fields in options classes so that the conversion to long/string is no longer done internally (except for those that also have special values like "now").

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.

I'm assuming that trial_end is left. What would be the right approach to handle it?

@ob-stripe
Copy link
Contributor Author

I'm assuming that trial_end is left. What would be the right approach to handle it?

Off the top of my head, we could define a special class DateTimeOrNow that could take care of its own encoding via its ToString method, or add a new case for the class in RequestStringBuilder. I'm not sure it's worth it if it's just used in one or two places though.

@ob-stripe ob-stripe merged commit ea63dac into remi-stripe-dotnet-major-version Sep 13, 2018
@ob-stripe ob-stripe deleted the ob-encode-datetime branch September 13, 2018 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants