33from __future__ import annotations
44
55from typing import Dict , List , Union , Iterable , Optional
6- from typing_extensions import Literal , Required , Annotated , TypeAlias , TypedDict
6+ from typing_extensions import Literal , Required , Annotated , TypedDict
77
8- from ..._types import SequenceNotStr
98from ..._utils import PropertyInfo
109from .webhook_param import WebhookParam
1110from .parallel_beta_param import ParallelBetaParam
1211
13- __all__ = [
14- "FindallCreateParams" ,
15- "FindallRunInput" ,
16- "FindallRunInputMatchCondition" ,
17- "FindallRunInputExcludeList" ,
18- "FindAllRunPayload" ,
19- "FindAllRunPayloadFindallSpec" ,
20- "FindAllRunPayloadFindallSpecColumn" ,
21- "FindAllRunPayloadUpdatesWebhook" ,
22- "FindAllRunPayloadWebhook" ,
23- ]
12+ __all__ = ["FindallCreateParams" , "MatchCondition" , "ExcludeList" ]
2413
2514
26- class FindallRunInput (TypedDict , total = False ):
15+ class FindallCreateParams (TypedDict , total = False ):
2716 entity_type : Required [str ]
2817 """Type of the entity for the FindAll run."""
2918
3019 generator : Required [Literal ["base" , "core" , "pro" , "preview" ]]
3120 """Generator for the FindAll run."""
3221
33- match_conditions : Required [Iterable [FindallRunInputMatchCondition ]]
22+ match_conditions : Required [Iterable [MatchCondition ]]
3423 """List of match conditions for the FindAll run."""
3524
3625 match_limit : Required [int ]
@@ -39,7 +28,7 @@ class FindallRunInput(TypedDict, total=False):
3928 objective : Required [str ]
4029 """Natural language objective of the FindAll run."""
4130
42- exclude_list : Optional [Iterable [FindallRunInputExcludeList ]]
31+ exclude_list : Optional [Iterable [ExcludeList ]]
4332 """List of entity names/IDs to exclude from results."""
4433
4534 metadata : Optional [Dict [str , Union [str , float , bool ]]]
@@ -52,7 +41,7 @@ class FindallRunInput(TypedDict, total=False):
5241 """Optional header to specify the beta version(s) to enable."""
5342
5443
55- class FindallRunInputMatchCondition (TypedDict , total = False ):
44+ class MatchCondition (TypedDict , total = False ):
5645 description : Required [str ]
5746 """Detailed description of the match condition.
5847
@@ -64,100 +53,9 @@ class FindallRunInputMatchCondition(TypedDict, total=False):
6453 """Name of the match condition."""
6554
6655
67- class FindallRunInputExcludeList (TypedDict , total = False ):
56+ class ExcludeList (TypedDict , total = False ):
6857 name : Required [str ]
6958 """Name of the entity to exclude from results."""
7059
7160 url : Required [str ]
7261 """URL of the entity to exclude from results."""
73-
74-
75- class FindAllRunPayload (TypedDict , total = False ):
76- findall_spec : Required [FindAllRunPayloadFindallSpec ]
77- """Represents a view in the database with a title."""
78-
79- processor : Required [Literal ["lite" , "base" , "pro" , "preview" ]]
80-
81- candidates : SequenceNotStr [str ]
82-
83- metadata : Dict [str , Union [str , float , bool ]]
84-
85- result_limit : int
86-
87- updates_webhook : Optional [FindAllRunPayloadUpdatesWebhook ]
88- """FindAll Webhooks for Clay."""
89-
90- webhook : Optional [FindAllRunPayloadWebhook ]
91- """Webhooks for FindAll."""
92-
93- betas : Annotated [List [ParallelBetaParam ], PropertyInfo (alias = "parallel-beta" )]
94- """Optional header to specify the beta version(s) to enable."""
95-
96-
97- class FindAllRunPayloadFindallSpecColumn (TypedDict , total = False ):
98- description : Required [str ]
99- """The description of the column"""
100-
101- name : Required [str ]
102- """The name of the column"""
103-
104- order_direction : Optional [Literal ["ASC" , "DESC" ]]
105- """Direction for ordering results."""
106-
107- type : Literal ["enrichment" , "constraint" , "order_by" ]
108- """Types of columns in a view."""
109-
110-
111- class FindAllRunPayloadFindallSpec (TypedDict , total = False ):
112- columns : Required [Iterable [FindAllRunPayloadFindallSpecColumn ]]
113- """The columns of the view"""
114-
115- name : Required [str ]
116- """The name of the view"""
117-
118- query : Required [str ]
119- """The query of the findall"""
120-
121- title : Required [str ]
122- """The title of the findall query"""
123-
124-
125- class FindAllRunPayloadUpdatesWebhook (TypedDict , total = False ):
126- url : Required [str ]
127- """URL for the webhook."""
128-
129- event_types : List [Literal ["findall.result" ]]
130- """The type of event that triggered the webhook."""
131-
132- secret : Optional [str ]
133- """Secret for HMAC signature of the webhook.
134-
135- If not provided, webhook signature is generated from the secret created when the
136- domain is registered.
137- """
138-
139-
140- class FindAllRunPayloadWebhook (TypedDict , total = False ):
141- url : Required [str ]
142- """URL for the webhook."""
143-
144- event_types : List [
145- Literal [
146- "findall.entity.created" ,
147- "findall.entity.discarded" ,
148- "findall.entity.completed" ,
149- "findall.run.completed" ,
150- "findall.run.canceled" ,
151- ]
152- ]
153- """The type of event that triggered the webhook."""
154-
155- secret : Optional [str ]
156- """Secret for HMAC signature of the webhook.
157-
158- If not provided, webhook signature is generated from the secret created when the
159- domain is registered.
160- """
161-
162-
163- FindallCreateParams : TypeAlias = Union [FindallRunInput , FindAllRunPayload ]
0 commit comments