1515from __future__ import annotations
1616
1717from datetime import timedelta
18- from typing import Any , Optional
18+ from typing import Any
1919
2020from google .genai import types
2121from google .genai ._api_client import BaseApiClient
@@ -56,7 +56,7 @@ class _SerializableHttpOptions(BaseModel):
5656)
5757
5858
59- def _validate_http_options (http_options : Optional [ HttpOptions ] ) -> None :
59+ def _validate_http_options (http_options : HttpOptions | None ) -> None :
6060 """Raise if http_options contains non-serializable fields."""
6161 if http_options is None :
6262 return
@@ -150,7 +150,7 @@ class TemporalApiClient(BaseApiClient):
150150 All actual HTTP calls are dispatched via ``workflow.execute_activity``.
151151 """
152152
153- def __init__ (
153+ def __init__ ( # pyright: ignore[reportMissingSuperCall]
154154 self ,
155155 * ,
156156 vertexai : bool = False ,
@@ -189,7 +189,7 @@ def __del__(self) -> None:
189189
190190 @staticmethod
191191 def _process_http_options (
192- http_options : Optional [ HttpOptionsOrDict ] ,
192+ http_options : HttpOptionsOrDict | None ,
193193 config : ActivityConfig ,
194194 ) -> _SerializableHttpOptions | None :
195195 """Validate and extract serializable per-request HTTP options.
@@ -243,7 +243,7 @@ async def async_request(
243243 http_method : str ,
244244 path : str ,
245245 request_dict : dict [str , object ],
246- http_options : Optional [ HttpOptionsOrDict ] = None ,
246+ http_options : HttpOptionsOrDict | None = None ,
247247 ) -> SdkHttpResponse :
248248 config : ActivityConfig = {** self ._activity_config }
249249 if "summary" not in config :
@@ -271,7 +271,7 @@ def request(
271271 http_method : str ,
272272 path : str ,
273273 request_dict : dict [str , object ],
274- http_options : Optional [ HttpOptionsOrDict ] = None ,
274+ http_options : HttpOptionsOrDict | None = None ,
275275 ) -> SdkHttpResponse :
276276 raise RuntimeError (
277277 "Synchronous requests are not supported in Temporal workflows. "
@@ -283,7 +283,7 @@ def request_streamed(
283283 http_method : str ,
284284 path : str ,
285285 request_dict : dict [str , object ],
286- http_options : Optional [ HttpOptionsOrDict ] = None ,
286+ http_options : HttpOptionsOrDict | None = None ,
287287 ) -> Any :
288288 raise RuntimeError (
289289 "Synchronous streaming is not supported in Temporal workflows. "
@@ -295,7 +295,7 @@ async def async_request_streamed(
295295 http_method : str ,
296296 path : str ,
297297 request_dict : dict [str , object ],
298- http_options : Optional [ HttpOptionsOrDict ] = None ,
298+ http_options : HttpOptionsOrDict | None = None ,
299299 ) -> Any :
300300 config : ActivityConfig = {** self ._activity_config }
301301 if "summary" not in config :
0 commit comments