airbyte-agent-hubspot 0.15.20__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airbyte_agent_hubspot/__init__.py +86 -0
- airbyte_agent_hubspot/_vendored/__init__.py +1 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/__init__.py +82 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/auth_strategies.py +1123 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/auth_template.py +135 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/cloud_utils/__init__.py +5 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/cloud_utils/client.py +213 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/connector_model_loader.py +957 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/constants.py +78 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/exceptions.py +23 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/executor/__init__.py +31 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/executor/hosted_executor.py +197 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/executor/local_executor.py +1504 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/executor/models.py +190 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/extensions.py +655 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/http/__init__.py +37 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/http/adapters/__init__.py +9 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/http/adapters/httpx_adapter.py +251 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/http/config.py +98 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/http/exceptions.py +119 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/http/protocols.py +114 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/http/response.py +102 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/http_client.py +679 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/logging/__init__.py +11 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/logging/logger.py +264 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/logging/types.py +92 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/__init__.py +11 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/models.py +19 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/redactor.py +81 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/observability/session.py +94 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/performance/__init__.py +6 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/performance/instrumentation.py +57 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/performance/metrics.py +93 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/__init__.py +75 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/base.py +161 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/components.py +238 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/connector.py +131 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/extensions.py +109 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/operations.py +146 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/schema/security.py +213 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/secrets.py +182 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/telemetry/__init__.py +10 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/telemetry/config.py +32 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/telemetry/events.py +58 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/telemetry/tracker.py +151 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/types.py +241 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/utils.py +60 -0
- airbyte_agent_hubspot/_vendored/connector_sdk/validation.py +822 -0
- airbyte_agent_hubspot/connector.py +1104 -0
- airbyte_agent_hubspot/connector_model.py +2660 -0
- airbyte_agent_hubspot/models.py +438 -0
- airbyte_agent_hubspot/types.py +217 -0
- airbyte_agent_hubspot-0.15.20.dist-info/METADATA +105 -0
- airbyte_agent_hubspot-0.15.20.dist-info/RECORD +55 -0
- airbyte_agent_hubspot-0.15.20.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Pydantic models for hubspot connector.
|
|
3
|
+
|
|
4
|
+
This module contains Pydantic models used for authentication configuration
|
|
5
|
+
and response envelope types.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
11
|
+
from typing import TypeVar, Generic, Union, Any
|
|
12
|
+
|
|
13
|
+
# Authentication configuration
|
|
14
|
+
|
|
15
|
+
class HubspotAuthConfig(BaseModel):
|
|
16
|
+
"""OAuth2 Authentication"""
|
|
17
|
+
|
|
18
|
+
model_config = ConfigDict(extra="forbid")
|
|
19
|
+
|
|
20
|
+
client_id: str
|
|
21
|
+
"""Your HubSpot OAuth2 Client ID"""
|
|
22
|
+
client_secret: str
|
|
23
|
+
"""Your HubSpot OAuth2 Client Secret"""
|
|
24
|
+
refresh_token: str
|
|
25
|
+
"""Your HubSpot OAuth2 Refresh Token"""
|
|
26
|
+
access_token: str
|
|
27
|
+
"""Your HubSpot OAuth2 Access Token (optional if refresh_token is provided)"""
|
|
28
|
+
|
|
29
|
+
# ===== RESPONSE TYPE DEFINITIONS (PYDANTIC) =====
|
|
30
|
+
|
|
31
|
+
class ContactProperties(BaseModel):
|
|
32
|
+
"""Contact properties"""
|
|
33
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
34
|
+
|
|
35
|
+
createdate: Union[str | None, Any] = Field(default=None)
|
|
36
|
+
email: Union[str | None, Any] = Field(default=None)
|
|
37
|
+
firstname: Union[str | None, Any] = Field(default=None)
|
|
38
|
+
hs_object_id: Union[str | None, Any] = Field(default=None)
|
|
39
|
+
lastmodifieddate: Union[str | None, Any] = Field(default=None)
|
|
40
|
+
lastname: Union[str | None, Any] = Field(default=None)
|
|
41
|
+
|
|
42
|
+
class Contact(BaseModel):
|
|
43
|
+
"""HubSpot contact object"""
|
|
44
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
45
|
+
|
|
46
|
+
id: Union[str, Any] = Field(default=None)
|
|
47
|
+
properties: Union[ContactProperties, Any] = Field(default=None)
|
|
48
|
+
created_at: Union[str, Any] = Field(default=None, alias="createdAt")
|
|
49
|
+
updated_at: Union[str, Any] = Field(default=None, alias="updatedAt")
|
|
50
|
+
archived: Union[bool, Any] = Field(default=None)
|
|
51
|
+
archived_at: Union[str | None, Any] = Field(default=None, alias="archivedAt")
|
|
52
|
+
properties_with_history: Union[dict[str, Any] | None, Any] = Field(default=None, alias="propertiesWithHistory")
|
|
53
|
+
associations: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
54
|
+
object_write_trace_id: Union[str | None, Any] = Field(default=None, alias="objectWriteTraceId")
|
|
55
|
+
url: Union[str | None, Any] = Field(default=None)
|
|
56
|
+
|
|
57
|
+
class PagingNext(BaseModel):
|
|
58
|
+
"""Nested schema for Paging.next"""
|
|
59
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
60
|
+
|
|
61
|
+
after: Union[str, Any] = Field(default=None, description="Cursor for next page")
|
|
62
|
+
"""Cursor for next page"""
|
|
63
|
+
link: Union[str, Any] = Field(default=None, description="URL for next page")
|
|
64
|
+
"""URL for next page"""
|
|
65
|
+
|
|
66
|
+
class Paging(BaseModel):
|
|
67
|
+
"""Pagination information"""
|
|
68
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
69
|
+
|
|
70
|
+
next: Union[PagingNext, Any] = Field(default=None)
|
|
71
|
+
|
|
72
|
+
class ContactsList(BaseModel):
|
|
73
|
+
"""Paginated list of contacts"""
|
|
74
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
75
|
+
|
|
76
|
+
results: Union[list[Contact], Any] = Field(default=None)
|
|
77
|
+
paging: Union[Paging, Any] = Field(default=None)
|
|
78
|
+
total: Union[int, Any] = Field(default=None)
|
|
79
|
+
|
|
80
|
+
class CompanyProperties(BaseModel):
|
|
81
|
+
"""Company properties"""
|
|
82
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
83
|
+
|
|
84
|
+
createdate: Union[str | None, Any] = Field(default=None)
|
|
85
|
+
domain: Union[str | None, Any] = Field(default=None)
|
|
86
|
+
hs_lastmodifieddate: Union[str | None, Any] = Field(default=None)
|
|
87
|
+
hs_object_id: Union[str | None, Any] = Field(default=None)
|
|
88
|
+
name: Union[str | None, Any] = Field(default=None)
|
|
89
|
+
|
|
90
|
+
class Company(BaseModel):
|
|
91
|
+
"""HubSpot company object"""
|
|
92
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
93
|
+
|
|
94
|
+
id: Union[str, Any] = Field(default=None)
|
|
95
|
+
properties: Union[CompanyProperties, Any] = Field(default=None)
|
|
96
|
+
created_at: Union[str, Any] = Field(default=None, alias="createdAt")
|
|
97
|
+
updated_at: Union[str, Any] = Field(default=None, alias="updatedAt")
|
|
98
|
+
archived: Union[bool, Any] = Field(default=None)
|
|
99
|
+
archived_at: Union[str | None, Any] = Field(default=None, alias="archivedAt")
|
|
100
|
+
properties_with_history: Union[dict[str, Any] | None, Any] = Field(default=None, alias="propertiesWithHistory")
|
|
101
|
+
associations: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
102
|
+
object_write_trace_id: Union[str | None, Any] = Field(default=None, alias="objectWriteTraceId")
|
|
103
|
+
url: Union[str | None, Any] = Field(default=None)
|
|
104
|
+
|
|
105
|
+
class CompaniesList(BaseModel):
|
|
106
|
+
"""Paginated list of companies"""
|
|
107
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
108
|
+
|
|
109
|
+
results: Union[list[Company], Any] = Field(default=None)
|
|
110
|
+
paging: Union[Paging, Any] = Field(default=None)
|
|
111
|
+
total: Union[int, Any] = Field(default=None)
|
|
112
|
+
|
|
113
|
+
class DealProperties(BaseModel):
|
|
114
|
+
"""Deal properties"""
|
|
115
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
116
|
+
|
|
117
|
+
amount: Union[str | None, Any] = Field(default=None)
|
|
118
|
+
closedate: Union[str | None, Any] = Field(default=None)
|
|
119
|
+
createdate: Union[str | None, Any] = Field(default=None)
|
|
120
|
+
dealname: Union[str | None, Any] = Field(default=None)
|
|
121
|
+
dealstage: Union[str | None, Any] = Field(default=None)
|
|
122
|
+
hs_lastmodifieddate: Union[str | None, Any] = Field(default=None)
|
|
123
|
+
hs_object_id: Union[str | None, Any] = Field(default=None)
|
|
124
|
+
pipeline: Union[str | None, Any] = Field(default=None)
|
|
125
|
+
|
|
126
|
+
class Deal(BaseModel):
|
|
127
|
+
"""HubSpot deal object"""
|
|
128
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
129
|
+
|
|
130
|
+
id: Union[str, Any] = Field(default=None)
|
|
131
|
+
properties: Union[DealProperties, Any] = Field(default=None)
|
|
132
|
+
created_at: Union[str, Any] = Field(default=None, alias="createdAt")
|
|
133
|
+
updated_at: Union[str, Any] = Field(default=None, alias="updatedAt")
|
|
134
|
+
archived: Union[bool, Any] = Field(default=None)
|
|
135
|
+
archived_at: Union[str | None, Any] = Field(default=None, alias="archivedAt")
|
|
136
|
+
properties_with_history: Union[dict[str, Any] | None, Any] = Field(default=None, alias="propertiesWithHistory")
|
|
137
|
+
associations: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
138
|
+
object_write_trace_id: Union[str | None, Any] = Field(default=None, alias="objectWriteTraceId")
|
|
139
|
+
url: Union[str | None, Any] = Field(default=None)
|
|
140
|
+
|
|
141
|
+
class DealsList(BaseModel):
|
|
142
|
+
"""Paginated list of deals"""
|
|
143
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
144
|
+
|
|
145
|
+
results: Union[list[Deal], Any] = Field(default=None)
|
|
146
|
+
paging: Union[Paging, Any] = Field(default=None)
|
|
147
|
+
total: Union[int, Any] = Field(default=None)
|
|
148
|
+
|
|
149
|
+
class TicketProperties(BaseModel):
|
|
150
|
+
"""Ticket properties"""
|
|
151
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
152
|
+
|
|
153
|
+
content: Union[str | None, Any] = Field(default=None)
|
|
154
|
+
createdate: Union[str | None, Any] = Field(default=None)
|
|
155
|
+
hs_lastmodifieddate: Union[str | None, Any] = Field(default=None)
|
|
156
|
+
hs_object_id: Union[str | None, Any] = Field(default=None)
|
|
157
|
+
hs_pipeline: Union[str | None, Any] = Field(default=None)
|
|
158
|
+
hs_pipeline_stage: Union[str | None, Any] = Field(default=None)
|
|
159
|
+
hs_ticket_category: Union[str | None, Any] = Field(default=None)
|
|
160
|
+
hs_ticket_priority: Union[str | None, Any] = Field(default=None)
|
|
161
|
+
subject: Union[str | None, Any] = Field(default=None)
|
|
162
|
+
|
|
163
|
+
class Ticket(BaseModel):
|
|
164
|
+
"""HubSpot ticket object"""
|
|
165
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
166
|
+
|
|
167
|
+
id: Union[str, Any] = Field(default=None)
|
|
168
|
+
properties: Union[TicketProperties, Any] = Field(default=None)
|
|
169
|
+
created_at: Union[str, Any] = Field(default=None, alias="createdAt")
|
|
170
|
+
updated_at: Union[str, Any] = Field(default=None, alias="updatedAt")
|
|
171
|
+
archived: Union[bool, Any] = Field(default=None)
|
|
172
|
+
archived_at: Union[str | None, Any] = Field(default=None, alias="archivedAt")
|
|
173
|
+
properties_with_history: Union[dict[str, Any] | None, Any] = Field(default=None, alias="propertiesWithHistory")
|
|
174
|
+
associations: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
175
|
+
object_write_trace_id: Union[str | None, Any] = Field(default=None, alias="objectWriteTraceId")
|
|
176
|
+
url: Union[str | None, Any] = Field(default=None)
|
|
177
|
+
|
|
178
|
+
class TicketsList(BaseModel):
|
|
179
|
+
"""Paginated list of tickets"""
|
|
180
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
181
|
+
|
|
182
|
+
results: Union[list[Ticket], Any] = Field(default=None)
|
|
183
|
+
paging: Union[Paging, Any] = Field(default=None)
|
|
184
|
+
total: Union[int, Any] = Field(default=None)
|
|
185
|
+
|
|
186
|
+
class SchemaPropertiesItemModificationmetadata(BaseModel):
|
|
187
|
+
"""Nested schema for SchemaPropertiesItem.modificationMetadata"""
|
|
188
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
189
|
+
|
|
190
|
+
archivable: Union[bool, Any] = Field(default=None)
|
|
191
|
+
read_only_definition: Union[bool, Any] = Field(default=None, alias="readOnlyDefinition")
|
|
192
|
+
read_only_value: Union[bool, Any] = Field(default=None, alias="readOnlyValue")
|
|
193
|
+
read_only_options: Union[bool, Any] = Field(default=None, alias="readOnlyOptions")
|
|
194
|
+
|
|
195
|
+
class SchemaPropertiesItem(BaseModel):
|
|
196
|
+
"""Nested schema for Schema.properties_item"""
|
|
197
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
198
|
+
|
|
199
|
+
name: Union[str, Any] = Field(default=None)
|
|
200
|
+
label: Union[str, Any] = Field(default=None)
|
|
201
|
+
type: Union[str, Any] = Field(default=None)
|
|
202
|
+
field_type: Union[str, Any] = Field(default=None, alias="fieldType")
|
|
203
|
+
description: Union[str, Any] = Field(default=None)
|
|
204
|
+
group_name: Union[str, Any] = Field(default=None, alias="groupName")
|
|
205
|
+
display_order: Union[int, Any] = Field(default=None, alias="displayOrder")
|
|
206
|
+
calculated: Union[bool, Any] = Field(default=None)
|
|
207
|
+
external_options: Union[bool, Any] = Field(default=None, alias="externalOptions")
|
|
208
|
+
archived: Union[bool, Any] = Field(default=None)
|
|
209
|
+
has_unique_value: Union[bool, Any] = Field(default=None, alias="hasUniqueValue")
|
|
210
|
+
hidden: Union[bool, Any] = Field(default=None)
|
|
211
|
+
form_field: Union[bool, Any] = Field(default=None, alias="formField")
|
|
212
|
+
data_sensitivity: Union[str, Any] = Field(default=None, alias="dataSensitivity")
|
|
213
|
+
hubspot_defined: Union[bool, Any] = Field(default=None, alias="hubspotDefined")
|
|
214
|
+
updated_at: Union[str, Any] = Field(default=None, alias="updatedAt")
|
|
215
|
+
created_at: Union[str, Any] = Field(default=None, alias="createdAt")
|
|
216
|
+
options: Union[list[Any], Any] = Field(default=None)
|
|
217
|
+
created_user_id: Union[str, Any] = Field(default=None, alias="createdUserId")
|
|
218
|
+
updated_user_id: Union[str, Any] = Field(default=None, alias="updatedUserId")
|
|
219
|
+
show_currency_symbol: Union[bool, Any] = Field(default=None, alias="showCurrencySymbol")
|
|
220
|
+
modification_metadata: Union[SchemaPropertiesItemModificationmetadata, Any] = Field(default=None, alias="modificationMetadata")
|
|
221
|
+
|
|
222
|
+
class SchemaAssociationsItem(BaseModel):
|
|
223
|
+
"""Nested schema for Schema.associations_item"""
|
|
224
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
225
|
+
|
|
226
|
+
from_object_type_id: Union[str, Any] = Field(default=None, alias="fromObjectTypeId")
|
|
227
|
+
to_object_type_id: Union[str, Any] = Field(default=None, alias="toObjectTypeId")
|
|
228
|
+
name: Union[str, Any] = Field(default=None)
|
|
229
|
+
cardinality: Union[str, Any] = Field(default=None)
|
|
230
|
+
id: Union[str, Any] = Field(default=None)
|
|
231
|
+
inverse_cardinality: Union[str, Any] = Field(default=None, alias="inverseCardinality")
|
|
232
|
+
has_user_enforced_max_to_object_ids: Union[bool, Any] = Field(default=None, alias="hasUserEnforcedMaxToObjectIds")
|
|
233
|
+
has_user_enforced_max_from_object_ids: Union[bool, Any] = Field(default=None, alias="hasUserEnforcedMaxFromObjectIds")
|
|
234
|
+
max_to_object_ids: Union[int, Any] = Field(default=None, alias="maxToObjectIds")
|
|
235
|
+
max_from_object_ids: Union[int, Any] = Field(default=None, alias="maxFromObjectIds")
|
|
236
|
+
created_at: Union[str | None, Any] = Field(default=None, alias="createdAt")
|
|
237
|
+
updated_at: Union[str | None, Any] = Field(default=None, alias="updatedAt")
|
|
238
|
+
|
|
239
|
+
class SchemaLabels(BaseModel):
|
|
240
|
+
"""Display labels"""
|
|
241
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
242
|
+
|
|
243
|
+
singular: Union[str, Any] = Field(default=None)
|
|
244
|
+
plural: Union[str, Any] = Field(default=None)
|
|
245
|
+
|
|
246
|
+
class Schema(BaseModel):
|
|
247
|
+
"""Custom object schema definition"""
|
|
248
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
249
|
+
|
|
250
|
+
id: Union[str, Any] = Field(default=None)
|
|
251
|
+
name: Union[str, Any] = Field(default=None)
|
|
252
|
+
labels: Union[SchemaLabels, Any] = Field(default=None)
|
|
253
|
+
object_type_id: Union[str, Any] = Field(default=None, alias="objectTypeId")
|
|
254
|
+
fully_qualified_name: Union[str, Any] = Field(default=None, alias="fullyQualifiedName")
|
|
255
|
+
required_properties: Union[list[str], Any] = Field(default=None, alias="requiredProperties")
|
|
256
|
+
searchable_properties: Union[list[str], Any] = Field(default=None, alias="searchableProperties")
|
|
257
|
+
primary_display_property: Union[str, Any] = Field(default=None, alias="primaryDisplayProperty")
|
|
258
|
+
secondary_display_properties: Union[list[str], Any] = Field(default=None, alias="secondaryDisplayProperties")
|
|
259
|
+
description: Union[str | None, Any] = Field(default=None)
|
|
260
|
+
allows_sensitive_properties: Union[bool, Any] = Field(default=None, alias="allowsSensitiveProperties")
|
|
261
|
+
archived: Union[bool, Any] = Field(default=None)
|
|
262
|
+
restorable: Union[bool, Any] = Field(default=None)
|
|
263
|
+
meta_type: Union[str, Any] = Field(default=None, alias="metaType")
|
|
264
|
+
created_by_user_id: Union[int, Any] = Field(default=None, alias="createdByUserId")
|
|
265
|
+
updated_by_user_id: Union[int, Any] = Field(default=None, alias="updatedByUserId")
|
|
266
|
+
properties: Union[list[SchemaPropertiesItem], Any] = Field(default=None)
|
|
267
|
+
associations: Union[list[SchemaAssociationsItem], Any] = Field(default=None)
|
|
268
|
+
created_at: Union[str, Any] = Field(default=None, alias="createdAt")
|
|
269
|
+
updated_at: Union[str, Any] = Field(default=None, alias="updatedAt")
|
|
270
|
+
|
|
271
|
+
class SchemasList(BaseModel):
|
|
272
|
+
"""List of custom object schemas"""
|
|
273
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
274
|
+
|
|
275
|
+
results: Union[list[Schema], Any] = Field(default=None)
|
|
276
|
+
|
|
277
|
+
class CRMObjectProperties(BaseModel):
|
|
278
|
+
"""Object properties"""
|
|
279
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
280
|
+
|
|
281
|
+
hs_createdate: Union[str | None, Any] = Field(default=None)
|
|
282
|
+
hs_lastmodifieddate: Union[str | None, Any] = Field(default=None)
|
|
283
|
+
hs_object_id: Union[str | None, Any] = Field(default=None)
|
|
284
|
+
|
|
285
|
+
class CRMObject(BaseModel):
|
|
286
|
+
"""Generic HubSpot CRM object (for custom objects)"""
|
|
287
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
288
|
+
|
|
289
|
+
id: Union[str, Any] = Field(default=None)
|
|
290
|
+
properties: Union[CRMObjectProperties, Any] = Field(default=None)
|
|
291
|
+
created_at: Union[str, Any] = Field(default=None, alias="createdAt")
|
|
292
|
+
updated_at: Union[str, Any] = Field(default=None, alias="updatedAt")
|
|
293
|
+
archived: Union[bool, Any] = Field(default=None)
|
|
294
|
+
archived_at: Union[str | None, Any] = Field(default=None, alias="archivedAt")
|
|
295
|
+
properties_with_history: Union[dict[str, Any] | None, Any] = Field(default=None, alias="propertiesWithHistory")
|
|
296
|
+
associations: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
297
|
+
object_write_trace_id: Union[str | None, Any] = Field(default=None, alias="objectWriteTraceId")
|
|
298
|
+
url: Union[str | None, Any] = Field(default=None)
|
|
299
|
+
|
|
300
|
+
class ObjectsList(BaseModel):
|
|
301
|
+
"""Paginated list of generic CRM objects"""
|
|
302
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
303
|
+
|
|
304
|
+
results: Union[list[CRMObject], Any] = Field(default=None)
|
|
305
|
+
paging: Union[Paging, Any] = Field(default=None)
|
|
306
|
+
|
|
307
|
+
# ===== METADATA TYPE DEFINITIONS (PYDANTIC) =====
|
|
308
|
+
# Meta types for operations that extract metadata (e.g., pagination info)
|
|
309
|
+
|
|
310
|
+
class ContactsListResultMeta(BaseModel):
|
|
311
|
+
"""Metadata for contacts.list operation"""
|
|
312
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
313
|
+
|
|
314
|
+
next_cursor: Union[str, Any] = Field(default=None)
|
|
315
|
+
next_link: Union[str, Any] = Field(default=None)
|
|
316
|
+
|
|
317
|
+
class ContactsSearchResultMeta(BaseModel):
|
|
318
|
+
"""Metadata for contacts.search operation"""
|
|
319
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
320
|
+
|
|
321
|
+
total: Union[int, Any] = Field(default=None)
|
|
322
|
+
next_cursor: Union[str, Any] = Field(default=None)
|
|
323
|
+
next_link: Union[str, Any] = Field(default=None)
|
|
324
|
+
|
|
325
|
+
class CompaniesListResultMeta(BaseModel):
|
|
326
|
+
"""Metadata for companies.list operation"""
|
|
327
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
328
|
+
|
|
329
|
+
next_cursor: Union[str, Any] = Field(default=None)
|
|
330
|
+
next_link: Union[str, Any] = Field(default=None)
|
|
331
|
+
|
|
332
|
+
class CompaniesSearchResultMeta(BaseModel):
|
|
333
|
+
"""Metadata for companies.search operation"""
|
|
334
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
335
|
+
|
|
336
|
+
total: Union[int, Any] = Field(default=None)
|
|
337
|
+
next_cursor: Union[str, Any] = Field(default=None)
|
|
338
|
+
next_link: Union[str, Any] = Field(default=None)
|
|
339
|
+
|
|
340
|
+
class DealsListResultMeta(BaseModel):
|
|
341
|
+
"""Metadata for deals.list operation"""
|
|
342
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
343
|
+
|
|
344
|
+
next_cursor: Union[str, Any] = Field(default=None)
|
|
345
|
+
next_link: Union[str, Any] = Field(default=None)
|
|
346
|
+
|
|
347
|
+
class DealsSearchResultMeta(BaseModel):
|
|
348
|
+
"""Metadata for deals.search operation"""
|
|
349
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
350
|
+
|
|
351
|
+
total: Union[int, Any] = Field(default=None)
|
|
352
|
+
next_cursor: Union[str, Any] = Field(default=None)
|
|
353
|
+
next_link: Union[str, Any] = Field(default=None)
|
|
354
|
+
|
|
355
|
+
class TicketsListResultMeta(BaseModel):
|
|
356
|
+
"""Metadata for tickets.list operation"""
|
|
357
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
358
|
+
|
|
359
|
+
next_cursor: Union[str, Any] = Field(default=None)
|
|
360
|
+
next_link: Union[str, Any] = Field(default=None)
|
|
361
|
+
|
|
362
|
+
class TicketsSearchResultMeta(BaseModel):
|
|
363
|
+
"""Metadata for tickets.search operation"""
|
|
364
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
365
|
+
|
|
366
|
+
total: Union[int, Any] = Field(default=None)
|
|
367
|
+
next_cursor: Union[str, Any] = Field(default=None)
|
|
368
|
+
next_link: Union[str, Any] = Field(default=None)
|
|
369
|
+
|
|
370
|
+
class ObjectsListResultMeta(BaseModel):
|
|
371
|
+
"""Metadata for objects.list operation"""
|
|
372
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
373
|
+
|
|
374
|
+
next_cursor: Union[str, Any] = Field(default=None)
|
|
375
|
+
next_link: Union[str, Any] = Field(default=None)
|
|
376
|
+
|
|
377
|
+
# ===== RESPONSE ENVELOPE MODELS =====
|
|
378
|
+
|
|
379
|
+
# Type variables for generic envelope models
|
|
380
|
+
T = TypeVar('T')
|
|
381
|
+
S = TypeVar('S')
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
class HubspotExecuteResult(BaseModel, Generic[T]):
|
|
385
|
+
"""Response envelope with data only.
|
|
386
|
+
|
|
387
|
+
Used for actions that return data without metadata.
|
|
388
|
+
"""
|
|
389
|
+
model_config = ConfigDict(extra="forbid")
|
|
390
|
+
|
|
391
|
+
data: T
|
|
392
|
+
"""Response data containing the result of the action."""
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
class HubspotExecuteResultWithMeta(HubspotExecuteResult[T], Generic[T, S]):
|
|
396
|
+
"""Response envelope with data and metadata.
|
|
397
|
+
|
|
398
|
+
Used for actions that return both data and metadata (e.g., pagination info).
|
|
399
|
+
"""
|
|
400
|
+
meta: S
|
|
401
|
+
"""Metadata about the response (e.g., pagination cursors, record counts)."""
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
# ===== OPERATION RESULT TYPE ALIASES =====
|
|
405
|
+
|
|
406
|
+
# Concrete type aliases for each operation result.
|
|
407
|
+
# These provide simpler, more readable type annotations than using the generic forms.
|
|
408
|
+
|
|
409
|
+
ContactsListResult = HubspotExecuteResultWithMeta[list[Contact], ContactsListResultMeta]
|
|
410
|
+
"""Result type for contacts.list operation with data and metadata."""
|
|
411
|
+
|
|
412
|
+
ContactsSearchResult = HubspotExecuteResultWithMeta[list[Contact], ContactsSearchResultMeta]
|
|
413
|
+
"""Result type for contacts.search operation with data and metadata."""
|
|
414
|
+
|
|
415
|
+
CompaniesListResult = HubspotExecuteResultWithMeta[list[Company], CompaniesListResultMeta]
|
|
416
|
+
"""Result type for companies.list operation with data and metadata."""
|
|
417
|
+
|
|
418
|
+
CompaniesSearchResult = HubspotExecuteResultWithMeta[list[Company], CompaniesSearchResultMeta]
|
|
419
|
+
"""Result type for companies.search operation with data and metadata."""
|
|
420
|
+
|
|
421
|
+
DealsListResult = HubspotExecuteResultWithMeta[list[Deal], DealsListResultMeta]
|
|
422
|
+
"""Result type for deals.list operation with data and metadata."""
|
|
423
|
+
|
|
424
|
+
DealsSearchResult = HubspotExecuteResultWithMeta[list[Deal], DealsSearchResultMeta]
|
|
425
|
+
"""Result type for deals.search operation with data and metadata."""
|
|
426
|
+
|
|
427
|
+
TicketsListResult = HubspotExecuteResultWithMeta[list[Ticket], TicketsListResultMeta]
|
|
428
|
+
"""Result type for tickets.list operation with data and metadata."""
|
|
429
|
+
|
|
430
|
+
TicketsSearchResult = HubspotExecuteResultWithMeta[list[Ticket], TicketsSearchResultMeta]
|
|
431
|
+
"""Result type for tickets.search operation with data and metadata."""
|
|
432
|
+
|
|
433
|
+
SchemasListResult = HubspotExecuteResult[list[Schema]]
|
|
434
|
+
"""Result type for schemas.list operation."""
|
|
435
|
+
|
|
436
|
+
ObjectsListResult = HubspotExecuteResultWithMeta[list[CRMObject], ObjectsListResultMeta]
|
|
437
|
+
"""Result type for objects.list operation with data and metadata."""
|
|
438
|
+
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Type definitions for hubspot connector.
|
|
3
|
+
"""
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
# Use typing_extensions.TypedDict for Pydantic compatibility on Python < 3.12
|
|
7
|
+
try:
|
|
8
|
+
from typing_extensions import TypedDict, NotRequired
|
|
9
|
+
except ImportError:
|
|
10
|
+
from typing import TypedDict, NotRequired # type: ignore[attr-defined]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# ===== NESTED PARAM TYPE DEFINITIONS =====
|
|
15
|
+
# Nested parameter schemas discovered during parameter extraction
|
|
16
|
+
|
|
17
|
+
class ContactsSearchParamsFiltergroupsItemFiltersItem(TypedDict):
|
|
18
|
+
"""Nested schema for ContactsSearchParamsFiltergroupsItem.filters_item"""
|
|
19
|
+
operator: NotRequired[str]
|
|
20
|
+
propertyName: NotRequired[str]
|
|
21
|
+
value: NotRequired[str]
|
|
22
|
+
values: NotRequired[list[str]]
|
|
23
|
+
|
|
24
|
+
class ContactsSearchParamsFiltergroupsItem(TypedDict):
|
|
25
|
+
"""Nested schema for ContactsSearchParams.filterGroups_item"""
|
|
26
|
+
filters: NotRequired[list[ContactsSearchParamsFiltergroupsItemFiltersItem]]
|
|
27
|
+
|
|
28
|
+
class ContactsSearchParamsSortsItem(TypedDict):
|
|
29
|
+
"""Nested schema for ContactsSearchParams.sorts_item"""
|
|
30
|
+
propertyName: NotRequired[str]
|
|
31
|
+
direction: NotRequired[str]
|
|
32
|
+
|
|
33
|
+
class CompaniesSearchParamsFiltergroupsItemFiltersItem(TypedDict):
|
|
34
|
+
"""Nested schema for CompaniesSearchParamsFiltergroupsItem.filters_item"""
|
|
35
|
+
operator: NotRequired[str]
|
|
36
|
+
propertyName: NotRequired[str]
|
|
37
|
+
value: NotRequired[str]
|
|
38
|
+
values: NotRequired[list[str]]
|
|
39
|
+
|
|
40
|
+
class CompaniesSearchParamsFiltergroupsItem(TypedDict):
|
|
41
|
+
"""Nested schema for CompaniesSearchParams.filterGroups_item"""
|
|
42
|
+
filters: NotRequired[list[CompaniesSearchParamsFiltergroupsItemFiltersItem]]
|
|
43
|
+
|
|
44
|
+
class CompaniesSearchParamsSortsItem(TypedDict):
|
|
45
|
+
"""Nested schema for CompaniesSearchParams.sorts_item"""
|
|
46
|
+
propertyName: NotRequired[str]
|
|
47
|
+
direction: NotRequired[str]
|
|
48
|
+
|
|
49
|
+
class DealsSearchParamsFiltergroupsItemFiltersItem(TypedDict):
|
|
50
|
+
"""Nested schema for DealsSearchParamsFiltergroupsItem.filters_item"""
|
|
51
|
+
operator: NotRequired[str]
|
|
52
|
+
propertyName: NotRequired[str]
|
|
53
|
+
value: NotRequired[str]
|
|
54
|
+
values: NotRequired[list[str]]
|
|
55
|
+
|
|
56
|
+
class DealsSearchParamsFiltergroupsItem(TypedDict):
|
|
57
|
+
"""Nested schema for DealsSearchParams.filterGroups_item"""
|
|
58
|
+
filters: NotRequired[list[DealsSearchParamsFiltergroupsItemFiltersItem]]
|
|
59
|
+
|
|
60
|
+
class DealsSearchParamsSortsItem(TypedDict):
|
|
61
|
+
"""Nested schema for DealsSearchParams.sorts_item"""
|
|
62
|
+
propertyName: NotRequired[str]
|
|
63
|
+
direction: NotRequired[str]
|
|
64
|
+
|
|
65
|
+
class TicketsSearchParamsFiltergroupsItemFiltersItem(TypedDict):
|
|
66
|
+
"""Nested schema for TicketsSearchParamsFiltergroupsItem.filters_item"""
|
|
67
|
+
operator: NotRequired[str]
|
|
68
|
+
propertyName: NotRequired[str]
|
|
69
|
+
value: NotRequired[str]
|
|
70
|
+
values: NotRequired[list[str]]
|
|
71
|
+
|
|
72
|
+
class TicketsSearchParamsFiltergroupsItem(TypedDict):
|
|
73
|
+
"""Nested schema for TicketsSearchParams.filterGroups_item"""
|
|
74
|
+
filters: NotRequired[list[TicketsSearchParamsFiltergroupsItemFiltersItem]]
|
|
75
|
+
|
|
76
|
+
class TicketsSearchParamsSortsItem(TypedDict):
|
|
77
|
+
"""Nested schema for TicketsSearchParams.sorts_item"""
|
|
78
|
+
propertyName: NotRequired[str]
|
|
79
|
+
direction: NotRequired[str]
|
|
80
|
+
|
|
81
|
+
# ===== OPERATION PARAMS TYPE DEFINITIONS =====
|
|
82
|
+
|
|
83
|
+
class ContactsListParams(TypedDict):
|
|
84
|
+
"""Parameters for contacts.list operation"""
|
|
85
|
+
limit: NotRequired[int]
|
|
86
|
+
after: NotRequired[str]
|
|
87
|
+
associations: NotRequired[str]
|
|
88
|
+
properties: NotRequired[str]
|
|
89
|
+
properties_with_history: NotRequired[str]
|
|
90
|
+
archived: NotRequired[bool]
|
|
91
|
+
|
|
92
|
+
class ContactsGetParams(TypedDict):
|
|
93
|
+
"""Parameters for contacts.get operation"""
|
|
94
|
+
contact_id: str
|
|
95
|
+
properties: NotRequired[str]
|
|
96
|
+
properties_with_history: NotRequired[str]
|
|
97
|
+
associations: NotRequired[str]
|
|
98
|
+
id_property: NotRequired[str]
|
|
99
|
+
archived: NotRequired[bool]
|
|
100
|
+
|
|
101
|
+
class ContactsSearchParams(TypedDict):
|
|
102
|
+
"""Parameters for contacts.search operation"""
|
|
103
|
+
filter_groups: NotRequired[list[ContactsSearchParamsFiltergroupsItem]]
|
|
104
|
+
properties: NotRequired[list[str]]
|
|
105
|
+
limit: NotRequired[int]
|
|
106
|
+
after: NotRequired[str]
|
|
107
|
+
sorts: NotRequired[list[ContactsSearchParamsSortsItem]]
|
|
108
|
+
query: NotRequired[str]
|
|
109
|
+
|
|
110
|
+
class CompaniesListParams(TypedDict):
|
|
111
|
+
"""Parameters for companies.list operation"""
|
|
112
|
+
limit: NotRequired[int]
|
|
113
|
+
after: NotRequired[str]
|
|
114
|
+
associations: NotRequired[str]
|
|
115
|
+
properties: NotRequired[str]
|
|
116
|
+
properties_with_history: NotRequired[str]
|
|
117
|
+
archived: NotRequired[bool]
|
|
118
|
+
|
|
119
|
+
class CompaniesGetParams(TypedDict):
|
|
120
|
+
"""Parameters for companies.get operation"""
|
|
121
|
+
company_id: str
|
|
122
|
+
properties: NotRequired[str]
|
|
123
|
+
properties_with_history: NotRequired[str]
|
|
124
|
+
associations: NotRequired[str]
|
|
125
|
+
id_property: NotRequired[str]
|
|
126
|
+
archived: NotRequired[bool]
|
|
127
|
+
|
|
128
|
+
class CompaniesSearchParams(TypedDict):
|
|
129
|
+
"""Parameters for companies.search operation"""
|
|
130
|
+
filter_groups: NotRequired[list[CompaniesSearchParamsFiltergroupsItem]]
|
|
131
|
+
properties: NotRequired[list[str]]
|
|
132
|
+
limit: NotRequired[int]
|
|
133
|
+
after: NotRequired[str]
|
|
134
|
+
sorts: NotRequired[list[CompaniesSearchParamsSortsItem]]
|
|
135
|
+
query: NotRequired[str]
|
|
136
|
+
|
|
137
|
+
class DealsListParams(TypedDict):
|
|
138
|
+
"""Parameters for deals.list operation"""
|
|
139
|
+
limit: NotRequired[int]
|
|
140
|
+
after: NotRequired[str]
|
|
141
|
+
associations: NotRequired[str]
|
|
142
|
+
properties: NotRequired[str]
|
|
143
|
+
properties_with_history: NotRequired[str]
|
|
144
|
+
archived: NotRequired[bool]
|
|
145
|
+
|
|
146
|
+
class DealsGetParams(TypedDict):
|
|
147
|
+
"""Parameters for deals.get operation"""
|
|
148
|
+
deal_id: str
|
|
149
|
+
properties: NotRequired[str]
|
|
150
|
+
properties_with_history: NotRequired[str]
|
|
151
|
+
associations: NotRequired[str]
|
|
152
|
+
id_property: NotRequired[str]
|
|
153
|
+
archived: NotRequired[bool]
|
|
154
|
+
|
|
155
|
+
class DealsSearchParams(TypedDict):
|
|
156
|
+
"""Parameters for deals.search operation"""
|
|
157
|
+
filter_groups: NotRequired[list[DealsSearchParamsFiltergroupsItem]]
|
|
158
|
+
properties: NotRequired[list[str]]
|
|
159
|
+
limit: NotRequired[int]
|
|
160
|
+
after: NotRequired[str]
|
|
161
|
+
sorts: NotRequired[list[DealsSearchParamsSortsItem]]
|
|
162
|
+
query: NotRequired[str]
|
|
163
|
+
|
|
164
|
+
class TicketsListParams(TypedDict):
|
|
165
|
+
"""Parameters for tickets.list operation"""
|
|
166
|
+
limit: NotRequired[int]
|
|
167
|
+
after: NotRequired[str]
|
|
168
|
+
associations: NotRequired[str]
|
|
169
|
+
properties: NotRequired[str]
|
|
170
|
+
properties_with_history: NotRequired[str]
|
|
171
|
+
archived: NotRequired[bool]
|
|
172
|
+
|
|
173
|
+
class TicketsGetParams(TypedDict):
|
|
174
|
+
"""Parameters for tickets.get operation"""
|
|
175
|
+
ticket_id: str
|
|
176
|
+
properties: NotRequired[str]
|
|
177
|
+
properties_with_history: NotRequired[str]
|
|
178
|
+
associations: NotRequired[str]
|
|
179
|
+
id_property: NotRequired[str]
|
|
180
|
+
archived: NotRequired[bool]
|
|
181
|
+
|
|
182
|
+
class TicketsSearchParams(TypedDict):
|
|
183
|
+
"""Parameters for tickets.search operation"""
|
|
184
|
+
filter_groups: NotRequired[list[TicketsSearchParamsFiltergroupsItem]]
|
|
185
|
+
properties: NotRequired[list[str]]
|
|
186
|
+
limit: NotRequired[int]
|
|
187
|
+
after: NotRequired[str]
|
|
188
|
+
sorts: NotRequired[list[TicketsSearchParamsSortsItem]]
|
|
189
|
+
query: NotRequired[str]
|
|
190
|
+
|
|
191
|
+
class SchemasListParams(TypedDict):
|
|
192
|
+
"""Parameters for schemas.list operation"""
|
|
193
|
+
archived: NotRequired[bool]
|
|
194
|
+
|
|
195
|
+
class SchemasGetParams(TypedDict):
|
|
196
|
+
"""Parameters for schemas.get operation"""
|
|
197
|
+
object_type: str
|
|
198
|
+
|
|
199
|
+
class ObjectsListParams(TypedDict):
|
|
200
|
+
"""Parameters for objects.list operation"""
|
|
201
|
+
object_type: str
|
|
202
|
+
limit: NotRequired[int]
|
|
203
|
+
after: NotRequired[str]
|
|
204
|
+
properties: NotRequired[str]
|
|
205
|
+
archived: NotRequired[bool]
|
|
206
|
+
associations: NotRequired[str]
|
|
207
|
+
properties_with_history: NotRequired[str]
|
|
208
|
+
|
|
209
|
+
class ObjectsGetParams(TypedDict):
|
|
210
|
+
"""Parameters for objects.get operation"""
|
|
211
|
+
object_type: str
|
|
212
|
+
object_id: str
|
|
213
|
+
properties: NotRequired[str]
|
|
214
|
+
archived: NotRequired[bool]
|
|
215
|
+
associations: NotRequired[str]
|
|
216
|
+
id_property: NotRequired[str]
|
|
217
|
+
properties_with_history: NotRequired[str]
|