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

Change return types of API calls #69

Open
Ntr0 opened this issue Feb 4, 2020 · 0 comments
Open

Change return types of API calls #69

Ntr0 opened this issue Feb 4, 2020 · 0 comments

Comments

@Ntr0
Copy link

Ntr0 commented Feb 4, 2020

Currently the models include fields that are not actually part of the api models, especially the Headers.
Since Headers sometimes contain viable information as the location header for tracking a request's status, all api calls should return model, response and error. So if a header is needed, it can be extracted from the response. Example:

datacenter, response, err := client.CreateDatacenter(myDc)
location := response.Header().Get("location")

This would be a breaking change, so please include this for the next version

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

No branches or pull requests

1 participant