1111from ..core .pydantic_utilities import parse_obj_as
1212from ..core .request_options import RequestOptions
1313from ..core .serialization import convert_and_respect_annotation_metadata
14+ from ..errors .bad_request_error import BadRequestError
1415from ..errors .too_many_requests_error import TooManyRequestsError
1516from ..types .component import Component
1617from ..types .configure_prop_response import ConfigurePropResponse
2021from ..types .reload_props_response import ReloadPropsResponse
2122from ..types .run_action_opts_stash_id import RunActionOptsStashId
2223from ..types .run_action_response import RunActionResponse
24+ from .types .list_actions_request_registry import ListActionsRequestRegistry
2325
2426# this is used as the default value for optional parameters
2527OMIT = typing .cast (typing .Any , ...)
@@ -37,6 +39,7 @@ def list(
3739 limit : typing .Optional [int ] = None ,
3840 q : typing .Optional [str ] = None ,
3941 app : typing .Optional [str ] = None ,
42+ registry : typing .Optional [ListActionsRequestRegistry ] = None ,
4043 request_options : typing .Optional [RequestOptions ] = None ,
4144 ) -> SyncPager [Component ]:
4245 """
@@ -59,13 +62,16 @@ def list(
5962 app : typing.Optional[str]
6063 The ID or name slug of the app to filter the actions
6164
65+ registry : typing.Optional[ListActionsRequestRegistry]
66+ The registry to retrieve actions from. Defaults to 'all' ('public', 'private', or 'all')
67+
6268 request_options : typing.Optional[RequestOptions]
6369 Request-specific configuration.
6470
6571 Returns
6672 -------
6773 SyncPager[Component]
68- actions listed
74+ behaves like registry=all
6975 """
7076 _response = self ._client_wrapper .httpx_client .request (
7177 f"v1/connect/{ jsonable_encoder (self ._client_wrapper ._project_id )} /actions" ,
@@ -76,6 +82,7 @@ def list(
7682 "limit" : limit ,
7783 "q" : q ,
7884 "app" : app ,
85+ "registry" : registry ,
7986 },
8087 request_options = request_options ,
8188 )
@@ -100,11 +107,23 @@ def list(
100107 limit = limit ,
101108 q = q ,
102109 app = app ,
110+ registry = registry ,
103111 request_options = request_options ,
104112 )
105113 return SyncPager (
106114 has_next = _has_next , items = _items , get_next = _get_next , response = BaseHttpResponse (response = _response )
107115 )
116+ if _response .status_code == 400 :
117+ raise BadRequestError (
118+ headers = dict (_response .headers ),
119+ body = typing .cast (
120+ typing .Optional [typing .Any ],
121+ parse_obj_as (
122+ type_ = typing .Optional [typing .Any ], # type: ignore
123+ object_ = _response .json (),
124+ ),
125+ ),
126+ )
108127 if _response .status_code == 429 :
109128 raise TooManyRequestsError (
110129 headers = dict (_response .headers ),
@@ -474,6 +493,7 @@ async def list(
474493 limit : typing .Optional [int ] = None ,
475494 q : typing .Optional [str ] = None ,
476495 app : typing .Optional [str ] = None ,
496+ registry : typing .Optional [ListActionsRequestRegistry ] = None ,
477497 request_options : typing .Optional [RequestOptions ] = None ,
478498 ) -> AsyncPager [Component ]:
479499 """
@@ -496,13 +516,16 @@ async def list(
496516 app : typing.Optional[str]
497517 The ID or name slug of the app to filter the actions
498518
519+ registry : typing.Optional[ListActionsRequestRegistry]
520+ The registry to retrieve actions from. Defaults to 'all' ('public', 'private', or 'all')
521+
499522 request_options : typing.Optional[RequestOptions]
500523 Request-specific configuration.
501524
502525 Returns
503526 -------
504527 AsyncPager[Component]
505- actions listed
528+ behaves like registry=all
506529 """
507530 _response = await self ._client_wrapper .httpx_client .request (
508531 f"v1/connect/{ jsonable_encoder (self ._client_wrapper ._project_id )} /actions" ,
@@ -513,6 +536,7 @@ async def list(
513536 "limit" : limit ,
514537 "q" : q ,
515538 "app" : app ,
539+ "registry" : registry ,
516540 },
517541 request_options = request_options ,
518542 )
@@ -539,12 +563,24 @@ async def _get_next():
539563 limit = limit ,
540564 q = q ,
541565 app = app ,
566+ registry = registry ,
542567 request_options = request_options ,
543568 )
544569
545570 return AsyncPager (
546571 has_next = _has_next , items = _items , get_next = _get_next , response = BaseHttpResponse (response = _response )
547572 )
573+ if _response .status_code == 400 :
574+ raise BadRequestError (
575+ headers = dict (_response .headers ),
576+ body = typing .cast (
577+ typing .Optional [typing .Any ],
578+ parse_obj_as (
579+ type_ = typing .Optional [typing .Any ], # type: ignore
580+ object_ = _response .json (),
581+ ),
582+ ),
583+ )
548584 if _response .status_code == 429 :
549585 raise TooManyRequestsError (
550586 headers = dict (_response .headers ),
0 commit comments