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

Use own struct, not Tesla's #25

Closed
chulkilee opened this issue Oct 2, 2018 · 1 comment
Closed

Use own struct, not Tesla's #25

chulkilee opened this issue Oct 2, 2018 · 1 comment

Comments

@chulkilee
Copy link
Owner

Currently ExForce returns plain Tesla struct, such as Tesla.Env. That works well for ad-hoc client, but since ExForce is standalone application, it may be better to use own struct.

@zblanco
Copy link

zblanco commented Oct 3, 2018

Using an internal struct instead of Tesla's would also be convenient to use the Composite and Batch endpoints. An %ExForce.Request{} could enable control over how we compose sets of requests. Since a composite request is a list of subrequests we could build an %ExForce.CompositeRequest{} with some helper functions.

Same concept for Batch requests. You build a valid %ExForce.BatchRequest{} struct out of a list of %ExForce.Request{} structs, and do some struct -> map conversion prior to hitting the endpoints.

Since Composite requests use a referenceId and Batch has it's own unique request parameters the builder pipeline could require those keys to build a valid Composite/Batch struct.

Then we'd just need some mapping functions that take a valid Request struct of any kind and make compatible for Tesla.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants