77from .routes import AsyncRoutes , Routes
88from .models import AbstractAsyncSeam , AbstractSeam
99from .client import AsyncSeamHttpClient , SeamHttpClient
10+ from .modules .action_attempts import normalize_wait_for_action_attempt
1011from .paginator import AsyncSeamPaginator , SeamPaginator
1112
1213
@@ -63,7 +64,7 @@ def __init__(
6364 :type endpoint: Optional[str]
6465 :param wait_for_action_attempt: Controls whether to wait for an
6566 action attempt to complete. Can be a boolean or a dictionary with
66- 'timeout' and 'poll_interval ' keys
67+ 'timeout' and 'polling_interval ' keys
6768 :type wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]
6869 :param retries: Configuration for retry behavior on failed requests
6970 :type retries: Optional[httpx_retries.Retry]
@@ -81,14 +82,17 @@ def __init__(
8182 access token format is invalid
8283 """
8384
84- self .wait_for_action_attempt = wait_for_action_attempt
8585 auth_headers , endpoint = parse_options (
8686 api_key = api_key ,
8787 personal_access_token = personal_access_token ,
8888 workspace_id = workspace_id ,
8989 endpoint = endpoint ,
9090 )
91- self .defaults = {"wait_for_action_attempt" : wait_for_action_attempt }
91+ self .defaults = {
92+ "wait_for_action_attempt" : normalize_wait_for_action_attempt (
93+ wait_for_action_attempt
94+ )
95+ }
9296
9397 self .client = SeamHttpClient (
9498 base_url = endpoint ,
@@ -103,6 +107,19 @@ def __init__(
103107 # namespaces passes a self the signature does not admit.
104108 Routes .__init__ (self , client = self .client , defaults = self .defaults ) # type: ignore[arg-type]
105109
110+ @property
111+ def wait_for_action_attempt (self ) -> Union [bool , Dict [str , float ]]:
112+ """Default wait behavior for action attempts, shared with every route."""
113+ return self .defaults ["wait_for_action_attempt" ]
114+
115+ @wait_for_action_attempt .setter
116+ def wait_for_action_attempt (
117+ self , value : Optional [Union [bool , Dict [str , float ]]]
118+ ) -> None :
119+ self .defaults ["wait_for_action_attempt" ] = normalize_wait_for_action_attempt (
120+ value
121+ )
122+
106123 def create_paginator (
107124 self , request : Callable , params : Optional [Dict [str , Any ]] = None , /
108125 ) -> SeamPaginator :
@@ -173,7 +190,7 @@ def from_api_key(
173190 :type endpoint: Optional[str]
174191 :param wait_for_action_attempt: Controls whether to wait for an
175192 action attempt to complete. Can be a boolean or a dictionary with
176- 'timeout' and 'poll_interval ' keys
193+ 'timeout' and 'polling_interval ' keys
177194 :type wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]
178195 :return: A new instance of the Seam class authenticated with the
179196 provided API key
@@ -219,7 +236,7 @@ def from_personal_access_token(
219236 :type endpoint: Optional[str]
220237 :param wait_for_action_attempt: Controls whether to wait for an
221238 action attempt to complete. Can be a boolean or a dictionary with
222- 'timeout' and 'poll_interval ' keys
239+ 'timeout' and 'polling_interval ' keys
223240 :type wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]
224241 :return: A new instance of the Seam class authenticated with the
225242 provided personal access token
@@ -294,7 +311,7 @@ def __init__(
294311 :type endpoint: Optional[str]
295312 :param wait_for_action_attempt: Controls whether to wait for an
296313 action attempt to complete. Can be a boolean or a dictionary with
297- 'timeout' and 'poll_interval ' keys
314+ 'timeout' and 'polling_interval ' keys
298315 :type wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]
299316 :param retries: Configuration for retry behavior on failed requests
300317 :type retries: Optional[httpx_retries.Retry]
@@ -312,14 +329,17 @@ def __init__(
312329 access token format is invalid
313330 """
314331
315- self .wait_for_action_attempt = wait_for_action_attempt
316332 auth_headers , endpoint = parse_options (
317333 api_key = api_key ,
318334 personal_access_token = personal_access_token ,
319335 workspace_id = workspace_id ,
320336 endpoint = endpoint ,
321337 )
322- self .defaults = {"wait_for_action_attempt" : wait_for_action_attempt }
338+ self .defaults = {
339+ "wait_for_action_attempt" : normalize_wait_for_action_attempt (
340+ wait_for_action_attempt
341+ )
342+ }
323343
324344 self .client = AsyncSeamHttpClient (
325345 base_url = endpoint ,
@@ -335,6 +355,19 @@ def __init__(
335355 # admit.
336356 AsyncRoutes .__init__ (self , client = self .client , defaults = self .defaults ) # type: ignore[arg-type]
337357
358+ @property
359+ def wait_for_action_attempt (self ) -> Union [bool , Dict [str , float ]]:
360+ """Default wait behavior for action attempts, shared with every route."""
361+ return self .defaults ["wait_for_action_attempt" ]
362+
363+ @wait_for_action_attempt .setter
364+ def wait_for_action_attempt (
365+ self , value : Optional [Union [bool , Dict [str , float ]]]
366+ ) -> None :
367+ self .defaults ["wait_for_action_attempt" ] = normalize_wait_for_action_attempt (
368+ value
369+ )
370+
338371 def create_paginator (
339372 self , request : Callable , params : Optional [Dict [str , Any ]] = None , /
340373 ) -> AsyncSeamPaginator :
@@ -402,7 +435,7 @@ def from_api_key(
402435 :type endpoint: Optional[str]
403436 :param wait_for_action_attempt: Controls whether to wait for an
404437 action attempt to complete. Can be a boolean or a dictionary with
405- 'timeout' and 'poll_interval ' keys
438+ 'timeout' and 'polling_interval ' keys
406439 :type wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]
407440 :return: A new instance of the AsyncSeam class authenticated with the
408441 provided API key
@@ -445,7 +478,7 @@ def from_personal_access_token(
445478 :type endpoint: Optional[str]
446479 :param wait_for_action_attempt: Controls whether to wait for an
447480 action attempt to complete. Can be a boolean or a dictionary with
448- 'timeout' and 'poll_interval ' keys
481+ 'timeout' and 'polling_interval ' keys
449482 :type wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]]
450483 :return: A new instance of the AsyncSeam class authenticated with the
451484 provided personal access token
0 commit comments