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

impl(rest): leverage EmptyResponseType to remove ambiguities in Post and Delete template functions #14390

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

scotthart
Copy link
Member

@scotthart scotthart commented Jun 27, 2024

fixes #14382

Upcoming BigQuery Post calls introduce cases where Response and Request types are the same. This PR resolves an ambiguity that introduces in the current template function definitions.


This change is Reviewable

@scotthart scotthart requested a review from a team as a code owner June 27, 2024 20:56
Copy link

codecov bot commented Jun 27, 2024

Codecov Report

Attention: Patch coverage is 98.24561% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.06%. Comparing base (a991917) to head (87e42cb).
Report is 6 commits behind head on main.

Files Patch % Lines
...s/golden/v1/internal/golden_rest_only_rest_stub.cc 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14390   +/-   ##
=======================================
  Coverage   93.06%   93.06%           
=======================================
  Files        2191     2191           
  Lines      193212   193260   +48     
=======================================
+ Hits       179821   179866   +45     
- Misses      13391    13394    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

template <typename Request>
template <
typename Response, typename Request,
std::enable_if_t<std::is_same<Response, EmptyResponseType>::value, int> = 0>
Status Delete(
rest_internal::RestClient& client, rest_internal::RestContext& rest_context,
Request const&, bool, std::string path,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment that predates this PR: the unused request parameter looked strange to me, but I see that

  • the contents of request are used to make path
  • it lets us consolidate generator code

@scotthart scotthart merged commit 6505814 into googleapis:main Jun 28, 2024
66 checks passed
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.

Disambiguate rest_internal::Post calls when the Response and Request types are the same.
2 participants