@@ -134,12 +134,38 @@ def post_autocomplete_places(
134134 ) -> places_service .AutocompletePlacesResponse :
135135 """Post-rpc interceptor for autocomplete_places
136136
137- Override in a subclass to manipulate the response
137+ DEPRECATED. Please use the `post_autocomplete_places_with_metadata`
138+ interceptor instead.
139+
140+ Override in a subclass to read or manipulate the response
138141 after it is returned by the Places server but before
139- it is returned to user code.
142+ it is returned to user code. This `post_autocomplete_places` interceptor runs
143+ before the `post_autocomplete_places_with_metadata` interceptor.
140144 """
141145 return response
142146
147+ def post_autocomplete_places_with_metadata (
148+ self ,
149+ response : places_service .AutocompletePlacesResponse ,
150+ metadata : Sequence [Tuple [str , Union [str , bytes ]]],
151+ ) -> Tuple [
152+ places_service .AutocompletePlacesResponse ,
153+ Sequence [Tuple [str , Union [str , bytes ]]],
154+ ]:
155+ """Post-rpc interceptor for autocomplete_places
156+
157+ Override in a subclass to read or manipulate the response or metadata after it
158+ is returned by the Places server but before it is returned to user code.
159+
160+ We recommend only using this `post_autocomplete_places_with_metadata`
161+ interceptor in new development instead of the `post_autocomplete_places` interceptor.
162+ When both interceptors are used, this `post_autocomplete_places_with_metadata` interceptor runs after the
163+ `post_autocomplete_places` interceptor. The (possibly modified) response returned by
164+ `post_autocomplete_places` will be passed to
165+ `post_autocomplete_places_with_metadata`.
166+ """
167+ return response , metadata
168+
143169 def pre_get_photo_media (
144170 self ,
145171 request : places_service .GetPhotoMediaRequest ,
@@ -159,12 +185,35 @@ def post_get_photo_media(
159185 ) -> places_service .PhotoMedia :
160186 """Post-rpc interceptor for get_photo_media
161187
162- Override in a subclass to manipulate the response
188+ DEPRECATED. Please use the `post_get_photo_media_with_metadata`
189+ interceptor instead.
190+
191+ Override in a subclass to read or manipulate the response
163192 after it is returned by the Places server but before
164- it is returned to user code.
193+ it is returned to user code. This `post_get_photo_media` interceptor runs
194+ before the `post_get_photo_media_with_metadata` interceptor.
165195 """
166196 return response
167197
198+ def post_get_photo_media_with_metadata (
199+ self ,
200+ response : places_service .PhotoMedia ,
201+ metadata : Sequence [Tuple [str , Union [str , bytes ]]],
202+ ) -> Tuple [places_service .PhotoMedia , Sequence [Tuple [str , Union [str , bytes ]]]]:
203+ """Post-rpc interceptor for get_photo_media
204+
205+ Override in a subclass to read or manipulate the response or metadata after it
206+ is returned by the Places server but before it is returned to user code.
207+
208+ We recommend only using this `post_get_photo_media_with_metadata`
209+ interceptor in new development instead of the `post_get_photo_media` interceptor.
210+ When both interceptors are used, this `post_get_photo_media_with_metadata` interceptor runs after the
211+ `post_get_photo_media` interceptor. The (possibly modified) response returned by
212+ `post_get_photo_media` will be passed to
213+ `post_get_photo_media_with_metadata`.
214+ """
215+ return response , metadata
216+
168217 def pre_get_place (
169218 self ,
170219 request : places_service .GetPlaceRequest ,
@@ -180,12 +229,33 @@ def pre_get_place(
180229 def post_get_place (self , response : place .Place ) -> place .Place :
181230 """Post-rpc interceptor for get_place
182231
183- Override in a subclass to manipulate the response
232+ DEPRECATED. Please use the `post_get_place_with_metadata`
233+ interceptor instead.
234+
235+ Override in a subclass to read or manipulate the response
184236 after it is returned by the Places server but before
185- it is returned to user code.
237+ it is returned to user code. This `post_get_place` interceptor runs
238+ before the `post_get_place_with_metadata` interceptor.
186239 """
187240 return response
188241
242+ def post_get_place_with_metadata (
243+ self , response : place .Place , metadata : Sequence [Tuple [str , Union [str , bytes ]]]
244+ ) -> Tuple [place .Place , Sequence [Tuple [str , Union [str , bytes ]]]]:
245+ """Post-rpc interceptor for get_place
246+
247+ Override in a subclass to read or manipulate the response or metadata after it
248+ is returned by the Places server but before it is returned to user code.
249+
250+ We recommend only using this `post_get_place_with_metadata`
251+ interceptor in new development instead of the `post_get_place` interceptor.
252+ When both interceptors are used, this `post_get_place_with_metadata` interceptor runs after the
253+ `post_get_place` interceptor. The (possibly modified) response returned by
254+ `post_get_place` will be passed to
255+ `post_get_place_with_metadata`.
256+ """
257+ return response , metadata
258+
189259 def pre_search_nearby (
190260 self ,
191261 request : places_service .SearchNearbyRequest ,
@@ -205,12 +275,37 @@ def post_search_nearby(
205275 ) -> places_service .SearchNearbyResponse :
206276 """Post-rpc interceptor for search_nearby
207277
208- Override in a subclass to manipulate the response
278+ DEPRECATED. Please use the `post_search_nearby_with_metadata`
279+ interceptor instead.
280+
281+ Override in a subclass to read or manipulate the response
209282 after it is returned by the Places server but before
210- it is returned to user code.
283+ it is returned to user code. This `post_search_nearby` interceptor runs
284+ before the `post_search_nearby_with_metadata` interceptor.
211285 """
212286 return response
213287
288+ def post_search_nearby_with_metadata (
289+ self ,
290+ response : places_service .SearchNearbyResponse ,
291+ metadata : Sequence [Tuple [str , Union [str , bytes ]]],
292+ ) -> Tuple [
293+ places_service .SearchNearbyResponse , Sequence [Tuple [str , Union [str , bytes ]]]
294+ ]:
295+ """Post-rpc interceptor for search_nearby
296+
297+ Override in a subclass to read or manipulate the response or metadata after it
298+ is returned by the Places server but before it is returned to user code.
299+
300+ We recommend only using this `post_search_nearby_with_metadata`
301+ interceptor in new development instead of the `post_search_nearby` interceptor.
302+ When both interceptors are used, this `post_search_nearby_with_metadata` interceptor runs after the
303+ `post_search_nearby` interceptor. The (possibly modified) response returned by
304+ `post_search_nearby` will be passed to
305+ `post_search_nearby_with_metadata`.
306+ """
307+ return response , metadata
308+
214309 def pre_search_text (
215310 self ,
216311 request : places_service .SearchTextRequest ,
@@ -230,12 +325,37 @@ def post_search_text(
230325 ) -> places_service .SearchTextResponse :
231326 """Post-rpc interceptor for search_text
232327
233- Override in a subclass to manipulate the response
328+ DEPRECATED. Please use the `post_search_text_with_metadata`
329+ interceptor instead.
330+
331+ Override in a subclass to read or manipulate the response
234332 after it is returned by the Places server but before
235- it is returned to user code.
333+ it is returned to user code. This `post_search_text` interceptor runs
334+ before the `post_search_text_with_metadata` interceptor.
236335 """
237336 return response
238337
338+ def post_search_text_with_metadata (
339+ self ,
340+ response : places_service .SearchTextResponse ,
341+ metadata : Sequence [Tuple [str , Union [str , bytes ]]],
342+ ) -> Tuple [
343+ places_service .SearchTextResponse , Sequence [Tuple [str , Union [str , bytes ]]]
344+ ]:
345+ """Post-rpc interceptor for search_text
346+
347+ Override in a subclass to read or manipulate the response or metadata after it
348+ is returned by the Places server but before it is returned to user code.
349+
350+ We recommend only using this `post_search_text_with_metadata`
351+ interceptor in new development instead of the `post_search_text` interceptor.
352+ When both interceptors are used, this `post_search_text_with_metadata` interceptor runs after the
353+ `post_search_text` interceptor. The (possibly modified) response returned by
354+ `post_search_text` will be passed to
355+ `post_search_text_with_metadata`.
356+ """
357+ return response , metadata
358+
239359
240360@dataclasses .dataclass
241361class PlacesRestStub :
@@ -458,6 +578,10 @@ def __call__(
458578 json_format .Parse (response .content , pb_resp , ignore_unknown_fields = True )
459579
460580 resp = self ._interceptor .post_autocomplete_places (resp )
581+ response_metadata = [(k , str (v )) for k , v in response .headers .items ()]
582+ resp , _ = self ._interceptor .post_autocomplete_places_with_metadata (
583+ resp , response_metadata
584+ )
461585 if CLIENT_LOGGING_SUPPORTED and _LOGGER .isEnabledFor (
462586 logging .DEBUG
463587 ): # pragma: NO COVER
@@ -603,6 +727,10 @@ def __call__(
603727 json_format .Parse (response .content , pb_resp , ignore_unknown_fields = True )
604728
605729 resp = self ._interceptor .post_get_photo_media (resp )
730+ response_metadata = [(k , str (v )) for k , v in response .headers .items ()]
731+ resp , _ = self ._interceptor .post_get_photo_media_with_metadata (
732+ resp , response_metadata
733+ )
606734 if CLIENT_LOGGING_SUPPORTED and _LOGGER .isEnabledFor (
607735 logging .DEBUG
608736 ): # pragma: NO COVER
@@ -746,6 +874,10 @@ def __call__(
746874 json_format .Parse (response .content , pb_resp , ignore_unknown_fields = True )
747875
748876 resp = self ._interceptor .post_get_place (resp )
877+ response_metadata = [(k , str (v )) for k , v in response .headers .items ()]
878+ resp , _ = self ._interceptor .post_get_place_with_metadata (
879+ resp , response_metadata
880+ )
749881 if CLIENT_LOGGING_SUPPORTED and _LOGGER .isEnabledFor (
750882 logging .DEBUG
751883 ): # pragma: NO COVER
@@ -894,6 +1026,10 @@ def __call__(
8941026 json_format .Parse (response .content , pb_resp , ignore_unknown_fields = True )
8951027
8961028 resp = self ._interceptor .post_search_nearby (resp )
1029+ response_metadata = [(k , str (v )) for k , v in response .headers .items ()]
1030+ resp , _ = self ._interceptor .post_search_nearby_with_metadata (
1031+ resp , response_metadata
1032+ )
8971033 if CLIENT_LOGGING_SUPPORTED and _LOGGER .isEnabledFor (
8981034 logging .DEBUG
8991035 ): # pragma: NO COVER
@@ -1042,6 +1178,10 @@ def __call__(
10421178 json_format .Parse (response .content , pb_resp , ignore_unknown_fields = True )
10431179
10441180 resp = self ._interceptor .post_search_text (resp )
1181+ response_metadata = [(k , str (v )) for k , v in response .headers .items ()]
1182+ resp , _ = self ._interceptor .post_search_text_with_metadata (
1183+ resp , response_metadata
1184+ )
10451185 if CLIENT_LOGGING_SUPPORTED and _LOGGER .isEnabledFor (
10461186 logging .DEBUG
10471187 ): # pragma: NO COVER
0 commit comments