3131 DEFAULT_POLLING_RETRY_ATTEMPTS ,
3232 DEFAULT_POLL_INTERVAL_SECONDS ,
3333)
34- from ...response_utils import parse_response_model
34+ from ...web_request_utils import (
35+ get_web_job_async ,
36+ get_web_job_status_async ,
37+ start_web_job_async ,
38+ )
3539from ...start_job_utils import build_started_job_context
3640
3741
@@ -46,23 +50,19 @@ async def start(
4650 self , params : StartBatchFetchJobParams
4751 ) -> StartBatchFetchJobResponse :
4852 payload = build_batch_fetch_start_payload (params )
49-
50- response = await self ._client .transport .post (
51- self ._client ._build_url (self ._ROUTE_PREFIX ),
52- data = payload ,
53- )
54- return parse_response_model (
55- response .data ,
53+ return await start_web_job_async (
54+ client = self ._client ,
55+ route_prefix = self ._ROUTE_PREFIX ,
56+ payload = payload ,
5657 model = StartBatchFetchJobResponse ,
5758 operation_name = self ._OPERATION_METADATA .start_operation_name ,
5859 )
5960
6061 async def get_status (self , job_id : str ) -> BatchFetchJobStatusResponse :
61- response = await self ._client .transport .get (
62- self ._client ._build_url (f"{ self ._ROUTE_PREFIX } /{ job_id } /status" )
63- )
64- return parse_response_model (
65- response .data ,
62+ return await get_web_job_status_async (
63+ client = self ._client ,
64+ route_prefix = self ._ROUTE_PREFIX ,
65+ job_id = job_id ,
6666 model = BatchFetchJobStatusResponse ,
6767 operation_name = self ._OPERATION_METADATA .status_operation_name ,
6868 )
@@ -71,12 +71,11 @@ async def get(
7171 self , job_id : str , params : Optional [GetBatchFetchJobParams ] = None
7272 ) -> BatchFetchJobResponse :
7373 query_params = build_batch_fetch_get_params (params )
74- response = await self ._client .transport .get (
75- self ._client ._build_url (f"{ self ._ROUTE_PREFIX } /{ job_id } " ),
74+ return await get_web_job_async (
75+ client = self ._client ,
76+ route_prefix = self ._ROUTE_PREFIX ,
77+ job_id = job_id ,
7678 params = query_params ,
77- )
78- return parse_response_model (
79- response .data ,
8079 model = BatchFetchJobResponse ,
8180 operation_name = self ._OPERATION_METADATA .job_operation_name ,
8281 )
0 commit comments