99)
1010from ...page_params_utils import build_page_batch_params
1111from ...job_status_utils import is_default_terminal_job_status
12+ from ...web_operation_metadata import WEB_CRAWL_OPERATION_METADATA
1213from ...web_route_constants import WEB_CRAWL_JOB_ROUTE_PREFIX
1314from ...web_payload_utils import build_web_crawl_start_payload
1415from ...web_payload_utils import build_web_crawl_get_params
3536
3637
3738class WebCrawlManager :
39+ _OPERATION_METADATA = WEB_CRAWL_OPERATION_METADATA
3840 _ROUTE_PREFIX = WEB_CRAWL_JOB_ROUTE_PREFIX
3941
4042 def __init__ (self , client ):
@@ -50,7 +52,7 @@ async def start(self, params: StartWebCrawlJobParams) -> StartWebCrawlJobRespons
5052 return parse_response_model (
5153 response .data ,
5254 model = StartWebCrawlJobResponse ,
53- operation_name = "web crawl start" ,
55+ operation_name = self . _OPERATION_METADATA . start_operation_name ,
5456 )
5557
5658 async def get_status (self , job_id : str ) -> WebCrawlJobStatusResponse :
@@ -60,7 +62,7 @@ async def get_status(self, job_id: str) -> WebCrawlJobStatusResponse:
6062 return parse_response_model (
6163 response .data ,
6264 model = WebCrawlJobStatusResponse ,
63- operation_name = "web crawl status" ,
65+ operation_name = self . _OPERATION_METADATA . status_operation_name ,
6466 )
6567
6668 async def get (
@@ -74,7 +76,7 @@ async def get(
7476 return parse_response_model (
7577 response .data ,
7678 model = WebCrawlJobResponse ,
77- operation_name = "web crawl job" ,
79+ operation_name = self . _OPERATION_METADATA . job_operation_name ,
7880 )
7981
8082 async def start_and_wait (
@@ -88,8 +90,8 @@ async def start_and_wait(
8890 job_start_resp = await self .start (params )
8991 job_id , operation_name = build_started_job_context (
9092 started_job_id = job_start_resp .job_id ,
91- start_error_message = "Failed to start web crawl job" ,
92- operation_name_prefix = "web crawl job " ,
93+ start_error_message = self . _OPERATION_METADATA . start_error_message ,
94+ operation_name_prefix = self . _OPERATION_METADATA . operation_name_prefix ,
9395 )
9496
9597 job_status = await poll_until_terminal_status_async (
0 commit comments