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

[typedclient] Add responses #618

Merged
merged 7 commits into from
Mar 10, 2023
Merged

[typedclient] Add responses #618

merged 7 commits into from
Mar 10, 2023

Conversation

Anaethelion
Copy link
Contributor

This pull request adds the responses to the typedclient, each endpoint has its own Response type.
It comes with several changes to the API, including the handling of Elasticsearch exceptions as Go errors.

  • Do method on endpoints now return a typed response, one per endpoint.
  • Perform method added on endpoints, returns http.Response as did Do.
  • Elasticsearch exceptions are now handled as types.ElasticsearchError with .As and .Is methods.
  • .Raw now takes a reader as input.
  • User defined values such as _source in Hits are now json.RawMessage to highlight they later deserializable nature.

@Anaethelion Anaethelion reopened this Mar 10, 2023
@Anaethelion Anaethelion merged commit d20eb08 into main Mar 10, 2023
@Anaethelion Anaethelion deleted the typed_client_add_responses branch March 10, 2023 15:28
github-actions bot pushed a commit that referenced this pull request Mar 10, 2023
* Add typedapi responses

* Update integration test with responses & errors

* Add highlights for typedapi changes

* Add missing license headers

* Fix missing pointers

* Fix internal test for info on typedclient

* Apply linter recommendations
Anaethelion added a commit that referenced this pull request Mar 10, 2023
* [typedclient] Add responses (#618)

* Add typedapi responses

* Update integration test with responses & errors

* Add highlights for typedapi changes

* Add missing license headers

* Fix missing pointers

* Fix internal test for info on typedclient

* Apply linter recommendations

* Update specification links for 8.7 branch

---------

Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
Anaethelion added a commit that referenced this pull request Mar 23, 2023
…) (#628)

Co-authored-by: Laurent Saint-Félix <laurent.saintfelix@elastic.co>
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.

None yet

1 participant