-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: Add REST Interceptors to support reading metadata #2299
Conversation
46d8633
to
19dbcc9
Compare
e4ff750
to
587f99c
Compare
587f99c
to
fbaff28
Compare
gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/rest.py.j2
Show resolved
Hide resolved
gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2
Outdated
Show resolved
Hide resolved
gapic/templates/%namespace/%name_%version/%sub/services/%service/_shared_macros.j2
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider my wording tweaks before merging.
after it is returned by the {{ service.name }} server but before | ||
it is returned to user code. | ||
it is returned to user code. This `post_{{ method.name|snake_case }}` iterceptor runs | ||
before the `post_{{ method.name|snake_case }}_with_metadata` iterceptor. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest
DEPRECATED. Please use the `post_{{ method.name|snake_case }}_with_metadata`
interceptor instead.
Override in a subclass to read or manipulate the response
after it is returned by the {{ service.name }} server but before
it is returned to user code. This `post_{{ method.name|snake_case }}` interceptor runs
before the `post_{{ method.name|snake_case }}_with_metadata` interceptor.
(reworded slightly and fixed spelling of "interceptor")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Override in a subclass to read or manipulate the response or metadata after it | ||
is returned by the {{ service.name }} server but before it is returned to user code. | ||
This `post_{{ method.name|snake_case }}_with_metadata` interceptor runs after the | ||
`post_{{ method.name|snake_case }}` iterceptor. If the response is modified in | ||
`post_{{ method.name|snake_case }}`, the modified response will be used in | ||
`post_{{ method.name|snake_case }}_with_metadata`. This `post_{{ method.name|snake_case }}_with_metadata` | ||
interceptor is recommended for new development instead of `post_{{ method.name|snake_case }}`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Override in a subclass to read or manipulate the response or metadata after it | |
is returned by the {{ service.name }} server but before it is returned to user code. | |
This `post_{{ method.name|snake_case }}_with_metadata` interceptor runs after the | |
`post_{{ method.name|snake_case }}` iterceptor. If the response is modified in | |
`post_{{ method.name|snake_case }}`, the modified response will be used in | |
`post_{{ method.name|snake_case }}_with_metadata`. This `post_{{ method.name|snake_case }}_with_metadata` | |
interceptor is recommended for new development instead of `post_{{ method.name|snake_case }}`. | |
Override in a subclass to read or manipulate the response or metadata after it | |
is returned by the {{ service.name }} server but before it is returned to user code. | |
We recommend only using this `post_{{ method.name|snake_case }}_with_metadata` | |
interceptor in new development instead of the `post_{{ method.name|snake_case }}` interceptor. | |
When both interceptors are used, this `post_{{ method.name|snake_case }}_with_metadata` interceptor runs after the | |
`post_{{ method.name|snake_case }}` interceptor. The (possibly modified) response returned by | |
`post_{{ method.name|snake_case }}` will be passed to | |
`post_{{ method.name|snake_case }}_with_metadata`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 11b803f
Fixes #2263 🦕