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

refactor!: Rename Api to OwnerApi. Remove ResponseData<T>. Add VehicleApi trait. #8

Merged
merged 2 commits into from
Oct 21, 2023

Conversation

gak
Copy link
Owner

@gak gak commented Oct 21, 2023

Significant refactor to progress towards different API access that Tesla
has introduced. See issues #6 and #7.

Removed ResponseData because it wasn't very ergonomic, forcing the user
to deref or call data(). Also it had specific fields for JSON output
which was only used for the CLI, so I introduced a field
print_responses in OwnerApi that the CLI can use.

…eApi trait.

Significant refactor to progress towards different API access that Tesla
has introduced. See issues #6 and #7.

Removed `ResponseData` because it wasn't very ergonomic, forcing the user
to deref or call data(). Also it had specific fields for JSON output
which was only used for the CLI, so I introduced a field
`print_responses` in OwnerApi that the CLI can use.
@gak
Copy link
Owner Author

gak commented Oct 21, 2023

I'm trying to make these changes as gradual as possible.

  • Public facing needs to just rename Api to OwnerApi.
  • Don't need to dereference responses.
  • .data() is not needed on responses.
  • The VehicleApi trait needs to be imported.

@ulrichard FYI

@gak gak merged commit 39627f3 into main Oct 21, 2023
@gak gak deleted the 7-refactor-api branch October 21, 2023 22:34
@gak gak mentioned this pull request Oct 22, 2023
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant