airbyte-agent-orb 0.1.6__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_orb/__init__.py +139 -0
- airbyte_agent_orb/_vendored/__init__.py +1 -0
- airbyte_agent_orb/_vendored/connector_sdk/__init__.py +82 -0
- airbyte_agent_orb/_vendored/connector_sdk/auth_strategies.py +1171 -0
- airbyte_agent_orb/_vendored/connector_sdk/auth_template.py +135 -0
- airbyte_agent_orb/_vendored/connector_sdk/cloud_utils/__init__.py +5 -0
- airbyte_agent_orb/_vendored/connector_sdk/cloud_utils/client.py +338 -0
- airbyte_agent_orb/_vendored/connector_sdk/connector_model_loader.py +1121 -0
- airbyte_agent_orb/_vendored/connector_sdk/constants.py +78 -0
- airbyte_agent_orb/_vendored/connector_sdk/exceptions.py +23 -0
- airbyte_agent_orb/_vendored/connector_sdk/executor/__init__.py +31 -0
- airbyte_agent_orb/_vendored/connector_sdk/executor/hosted_executor.py +230 -0
- airbyte_agent_orb/_vendored/connector_sdk/executor/local_executor.py +1848 -0
- airbyte_agent_orb/_vendored/connector_sdk/executor/models.py +202 -0
- airbyte_agent_orb/_vendored/connector_sdk/extensions.py +693 -0
- airbyte_agent_orb/_vendored/connector_sdk/http/__init__.py +37 -0
- airbyte_agent_orb/_vendored/connector_sdk/http/adapters/__init__.py +9 -0
- airbyte_agent_orb/_vendored/connector_sdk/http/adapters/httpx_adapter.py +260 -0
- airbyte_agent_orb/_vendored/connector_sdk/http/config.py +98 -0
- airbyte_agent_orb/_vendored/connector_sdk/http/exceptions.py +119 -0
- airbyte_agent_orb/_vendored/connector_sdk/http/protocols.py +114 -0
- airbyte_agent_orb/_vendored/connector_sdk/http/response.py +104 -0
- airbyte_agent_orb/_vendored/connector_sdk/http_client.py +693 -0
- airbyte_agent_orb/_vendored/connector_sdk/introspection.py +481 -0
- airbyte_agent_orb/_vendored/connector_sdk/logging/__init__.py +11 -0
- airbyte_agent_orb/_vendored/connector_sdk/logging/logger.py +273 -0
- airbyte_agent_orb/_vendored/connector_sdk/logging/types.py +93 -0
- airbyte_agent_orb/_vendored/connector_sdk/observability/__init__.py +11 -0
- airbyte_agent_orb/_vendored/connector_sdk/observability/config.py +179 -0
- airbyte_agent_orb/_vendored/connector_sdk/observability/models.py +19 -0
- airbyte_agent_orb/_vendored/connector_sdk/observability/redactor.py +81 -0
- airbyte_agent_orb/_vendored/connector_sdk/observability/session.py +103 -0
- airbyte_agent_orb/_vendored/connector_sdk/performance/__init__.py +6 -0
- airbyte_agent_orb/_vendored/connector_sdk/performance/instrumentation.py +57 -0
- airbyte_agent_orb/_vendored/connector_sdk/performance/metrics.py +93 -0
- airbyte_agent_orb/_vendored/connector_sdk/schema/__init__.py +75 -0
- airbyte_agent_orb/_vendored/connector_sdk/schema/base.py +212 -0
- airbyte_agent_orb/_vendored/connector_sdk/schema/components.py +244 -0
- airbyte_agent_orb/_vendored/connector_sdk/schema/connector.py +120 -0
- airbyte_agent_orb/_vendored/connector_sdk/schema/extensions.py +301 -0
- airbyte_agent_orb/_vendored/connector_sdk/schema/operations.py +156 -0
- airbyte_agent_orb/_vendored/connector_sdk/schema/security.py +241 -0
- airbyte_agent_orb/_vendored/connector_sdk/secrets.py +182 -0
- airbyte_agent_orb/_vendored/connector_sdk/telemetry/__init__.py +10 -0
- airbyte_agent_orb/_vendored/connector_sdk/telemetry/config.py +32 -0
- airbyte_agent_orb/_vendored/connector_sdk/telemetry/events.py +59 -0
- airbyte_agent_orb/_vendored/connector_sdk/telemetry/tracker.py +155 -0
- airbyte_agent_orb/_vendored/connector_sdk/types.py +274 -0
- airbyte_agent_orb/_vendored/connector_sdk/utils.py +127 -0
- airbyte_agent_orb/_vendored/connector_sdk/validation.py +997 -0
- airbyte_agent_orb/_vendored/connector_sdk/validation_replication.py +970 -0
- airbyte_agent_orb/connector.py +1179 -0
- airbyte_agent_orb/connector_model.py +2163 -0
- airbyte_agent_orb/models.py +532 -0
- airbyte_agent_orb/types.py +1090 -0
- airbyte_agent_orb-0.1.6.dist-info/METADATA +153 -0
- airbyte_agent_orb-0.1.6.dist-info/RECORD +58 -0
- airbyte_agent_orb-0.1.6.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Pydantic models for orb 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 OrbAuthConfig(BaseModel):
|
|
16
|
+
"""API Key Authentication"""
|
|
17
|
+
|
|
18
|
+
model_config = ConfigDict(extra="forbid")
|
|
19
|
+
|
|
20
|
+
api_key: str
|
|
21
|
+
"""Your Orb API key"""
|
|
22
|
+
|
|
23
|
+
# ===== RESPONSE TYPE DEFINITIONS (PYDANTIC) =====
|
|
24
|
+
|
|
25
|
+
class Address(BaseModel):
|
|
26
|
+
"""Address object"""
|
|
27
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
28
|
+
|
|
29
|
+
city: Union[str | None, Any] = Field(default=None)
|
|
30
|
+
country: Union[str | None, Any] = Field(default=None)
|
|
31
|
+
line1: Union[str | None, Any] = Field(default=None)
|
|
32
|
+
line2: Union[str | None, Any] = Field(default=None)
|
|
33
|
+
postal_code: Union[str | None, Any] = Field(default=None)
|
|
34
|
+
state: Union[str | None, Any] = Field(default=None)
|
|
35
|
+
|
|
36
|
+
class CustomerTaxId(BaseModel):
|
|
37
|
+
"""Tax identification information"""
|
|
38
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
39
|
+
|
|
40
|
+
type: Union[str | None, Any] = Field(default=None, description="The type of tax ID")
|
|
41
|
+
"""The type of tax ID"""
|
|
42
|
+
value: Union[str | None, Any] = Field(default=None, description="The value of the tax ID")
|
|
43
|
+
"""The value of the tax ID"""
|
|
44
|
+
country: Union[str | None, Any] = Field(default=None, description="The country of the tax ID")
|
|
45
|
+
"""The country of the tax ID"""
|
|
46
|
+
|
|
47
|
+
class Customer(BaseModel):
|
|
48
|
+
"""Customer object"""
|
|
49
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
50
|
+
|
|
51
|
+
id: Union[str, Any] = Field(default=None)
|
|
52
|
+
external_customer_id: Union[str | None, Any] = Field(default=None)
|
|
53
|
+
name: Union[str | None, Any] = Field(default=None)
|
|
54
|
+
email: Union[str | None, Any] = Field(default=None)
|
|
55
|
+
created_at: Union[str | None, Any] = Field(default=None)
|
|
56
|
+
payment_provider: Union[str | None, Any] = Field(default=None)
|
|
57
|
+
payment_provider_id: Union[str | None, Any] = Field(default=None)
|
|
58
|
+
timezone: Union[str | None, Any] = Field(default=None)
|
|
59
|
+
shipping_address: Union[Any, Any] = Field(default=None)
|
|
60
|
+
billing_address: Union[Any, Any] = Field(default=None)
|
|
61
|
+
balance: Union[str | None, Any] = Field(default=None)
|
|
62
|
+
currency: Union[str | None, Any] = Field(default=None)
|
|
63
|
+
tax_id: Union[CustomerTaxId | None, Any] = Field(default=None)
|
|
64
|
+
auto_collection: Union[bool | None, Any] = Field(default=None)
|
|
65
|
+
metadata: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
66
|
+
|
|
67
|
+
class PaginationMetadata(BaseModel):
|
|
68
|
+
"""Pagination metadata"""
|
|
69
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
70
|
+
|
|
71
|
+
has_more: Union[bool | None, Any] = Field(default=None)
|
|
72
|
+
next_cursor: Union[str | None, Any] = Field(default=None)
|
|
73
|
+
|
|
74
|
+
class CustomersList(BaseModel):
|
|
75
|
+
"""Paginated list of customers"""
|
|
76
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
77
|
+
|
|
78
|
+
data: Union[list[Customer], Any] = Field(default=None)
|
|
79
|
+
pagination_metadata: Union[PaginationMetadata, Any] = Field(default=None)
|
|
80
|
+
|
|
81
|
+
class SubscriptionPlan(BaseModel):
|
|
82
|
+
"""The plan associated with the subscription"""
|
|
83
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
84
|
+
|
|
85
|
+
id: Union[str | None, Any] = Field(default=None, description="The plan ID")
|
|
86
|
+
"""The plan ID"""
|
|
87
|
+
name: Union[str | None, Any] = Field(default=None, description="The plan name")
|
|
88
|
+
"""The plan name"""
|
|
89
|
+
|
|
90
|
+
class SubscriptionCustomer(BaseModel):
|
|
91
|
+
"""The customer associated with the subscription"""
|
|
92
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
93
|
+
|
|
94
|
+
id: Union[str | None, Any] = Field(default=None, description="The customer ID")
|
|
95
|
+
"""The customer ID"""
|
|
96
|
+
external_customer_id: Union[str | None, Any] = Field(default=None, description="The external customer ID")
|
|
97
|
+
"""The external customer ID"""
|
|
98
|
+
|
|
99
|
+
class Subscription(BaseModel):
|
|
100
|
+
"""Subscription object"""
|
|
101
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
102
|
+
|
|
103
|
+
id: Union[str, Any] = Field(default=None)
|
|
104
|
+
created_at: Union[str | None, Any] = Field(default=None)
|
|
105
|
+
start_date: Union[str | None, Any] = Field(default=None)
|
|
106
|
+
end_date: Union[str | None, Any] = Field(default=None)
|
|
107
|
+
status: Union[str | None, Any] = Field(default=None)
|
|
108
|
+
customer: Union[SubscriptionCustomer | None, Any] = Field(default=None)
|
|
109
|
+
plan: Union[SubscriptionPlan | None, Any] = Field(default=None)
|
|
110
|
+
current_billing_period_start_date: Union[str | None, Any] = Field(default=None)
|
|
111
|
+
current_billing_period_end_date: Union[str | None, Any] = Field(default=None)
|
|
112
|
+
active_plan_phase_order: Union[int | None, Any] = Field(default=None)
|
|
113
|
+
fixed_fee_quantity_schedule: Union[list[dict[str, Any]] | None, Any] = Field(default=None)
|
|
114
|
+
price_intervals: Union[list[dict[str, Any]] | None, Any] = Field(default=None)
|
|
115
|
+
redeemed_coupon: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
116
|
+
default_invoice_memo: Union[str | None, Any] = Field(default=None)
|
|
117
|
+
auto_collection: Union[bool | None, Any] = Field(default=None)
|
|
118
|
+
net_terms: Union[int | None, Any] = Field(default=None)
|
|
119
|
+
invoicing_threshold: Union[str | None, Any] = Field(default=None)
|
|
120
|
+
metadata: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
121
|
+
|
|
122
|
+
class SubscriptionsList(BaseModel):
|
|
123
|
+
"""Paginated list of subscriptions"""
|
|
124
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
125
|
+
|
|
126
|
+
data: Union[list[Subscription], Any] = Field(default=None)
|
|
127
|
+
pagination_metadata: Union[PaginationMetadata, Any] = Field(default=None)
|
|
128
|
+
|
|
129
|
+
class PlanProduct(BaseModel):
|
|
130
|
+
"""The product associated with the plan"""
|
|
131
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
132
|
+
|
|
133
|
+
id: Union[str | None, Any] = Field(default=None, description="The product ID")
|
|
134
|
+
"""The product ID"""
|
|
135
|
+
name: Union[str | None, Any] = Field(default=None, description="The product name")
|
|
136
|
+
"""The product name"""
|
|
137
|
+
|
|
138
|
+
class PlanPricesItem(BaseModel):
|
|
139
|
+
"""Nested schema for Plan.prices_item"""
|
|
140
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
141
|
+
|
|
142
|
+
id: Union[str | None, Any] = Field(default=None, description="The unique identifier of the price")
|
|
143
|
+
"""The unique identifier of the price"""
|
|
144
|
+
name: Union[str | None, Any] = Field(default=None, description="The name of the price")
|
|
145
|
+
"""The name of the price"""
|
|
146
|
+
price_type: Union[str | None, Any] = Field(default=None, description="The type of price")
|
|
147
|
+
"""The type of price"""
|
|
148
|
+
model_type: Union[str | None, Any] = Field(default=None, description="The model type of the price")
|
|
149
|
+
"""The model type of the price"""
|
|
150
|
+
currency: Union[str | None, Any] = Field(default=None, description="The currency of the price")
|
|
151
|
+
"""The currency of the price"""
|
|
152
|
+
|
|
153
|
+
class Plan(BaseModel):
|
|
154
|
+
"""Plan object"""
|
|
155
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
156
|
+
|
|
157
|
+
id: Union[str, Any] = Field(default=None)
|
|
158
|
+
created_at: Union[str | None, Any] = Field(default=None)
|
|
159
|
+
name: Union[str | None, Any] = Field(default=None)
|
|
160
|
+
description: Union[str | None, Any] = Field(default=None)
|
|
161
|
+
status: Union[str | None, Any] = Field(default=None)
|
|
162
|
+
default_invoice_memo: Union[str | None, Any] = Field(default=None)
|
|
163
|
+
net_terms: Union[int | None, Any] = Field(default=None)
|
|
164
|
+
currency: Union[str | None, Any] = Field(default=None)
|
|
165
|
+
prices: Union[list[PlanPricesItem] | None, Any] = Field(default=None)
|
|
166
|
+
product: Union[PlanProduct | None, Any] = Field(default=None)
|
|
167
|
+
minimum: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
168
|
+
maximum: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
169
|
+
discount: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
170
|
+
trial_config: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
171
|
+
plan_phases: Union[list[dict[str, Any]] | None, Any] = Field(default=None)
|
|
172
|
+
external_plan_id: Union[str | None, Any] = Field(default=None)
|
|
173
|
+
invoicing_currency: Union[str | None, Any] = Field(default=None)
|
|
174
|
+
metadata: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
175
|
+
|
|
176
|
+
class PlansList(BaseModel):
|
|
177
|
+
"""Paginated list of plans"""
|
|
178
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
179
|
+
|
|
180
|
+
data: Union[list[Plan], Any] = Field(default=None)
|
|
181
|
+
pagination_metadata: Union[PaginationMetadata, Any] = Field(default=None)
|
|
182
|
+
|
|
183
|
+
class InvoiceLineItemsItem(BaseModel):
|
|
184
|
+
"""Nested schema for Invoice.line_items_item"""
|
|
185
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
186
|
+
|
|
187
|
+
id: Union[str | None, Any] = Field(default=None, description="The unique identifier of the line item")
|
|
188
|
+
"""The unique identifier of the line item"""
|
|
189
|
+
quantity: Union[float | None, Any] = Field(default=None, description="The quantity of the line item")
|
|
190
|
+
"""The quantity of the line item"""
|
|
191
|
+
amount: Union[str | None, Any] = Field(default=None, description="The amount of the line item")
|
|
192
|
+
"""The amount of the line item"""
|
|
193
|
+
name: Union[str | None, Any] = Field(default=None, description="The name of the line item")
|
|
194
|
+
"""The name of the line item"""
|
|
195
|
+
start_date: Union[str | None, Any] = Field(default=None, description="The start date of the line item")
|
|
196
|
+
"""The start date of the line item"""
|
|
197
|
+
end_date: Union[str | None, Any] = Field(default=None, description="The end date of the line item")
|
|
198
|
+
"""The end date of the line item"""
|
|
199
|
+
|
|
200
|
+
class InvoiceSubscription(BaseModel):
|
|
201
|
+
"""The subscription associated with the invoice"""
|
|
202
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
203
|
+
|
|
204
|
+
id: Union[str | None, Any] = Field(default=None, description="The subscription ID")
|
|
205
|
+
"""The subscription ID"""
|
|
206
|
+
|
|
207
|
+
class InvoiceCustomer(BaseModel):
|
|
208
|
+
"""The customer associated with the invoice"""
|
|
209
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
210
|
+
|
|
211
|
+
id: Union[str | None, Any] = Field(default=None, description="The customer ID")
|
|
212
|
+
"""The customer ID"""
|
|
213
|
+
external_customer_id: Union[str | None, Any] = Field(default=None, description="The external customer ID")
|
|
214
|
+
"""The external customer ID"""
|
|
215
|
+
|
|
216
|
+
class Invoice(BaseModel):
|
|
217
|
+
"""Invoice object"""
|
|
218
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
219
|
+
|
|
220
|
+
id: Union[str, Any] = Field(default=None)
|
|
221
|
+
created_at: Union[str | None, Any] = Field(default=None)
|
|
222
|
+
invoice_date: Union[str | None, Any] = Field(default=None)
|
|
223
|
+
due_date: Union[str | None, Any] = Field(default=None)
|
|
224
|
+
invoice_pdf: Union[str | None, Any] = Field(default=None)
|
|
225
|
+
subtotal: Union[str | None, Any] = Field(default=None)
|
|
226
|
+
total: Union[str | None, Any] = Field(default=None)
|
|
227
|
+
amount_due: Union[str | None, Any] = Field(default=None)
|
|
228
|
+
status: Union[str | None, Any] = Field(default=None)
|
|
229
|
+
memo: Union[str | None, Any] = Field(default=None)
|
|
230
|
+
issue_failed_at: Union[str | None, Any] = Field(default=None)
|
|
231
|
+
sync_failed_at: Union[str | None, Any] = Field(default=None)
|
|
232
|
+
payment_failed_at: Union[str | None, Any] = Field(default=None)
|
|
233
|
+
payment_started_at: Union[str | None, Any] = Field(default=None)
|
|
234
|
+
voided_at: Union[str | None, Any] = Field(default=None)
|
|
235
|
+
paid_at: Union[str | None, Any] = Field(default=None)
|
|
236
|
+
issued_at: Union[str | None, Any] = Field(default=None)
|
|
237
|
+
hosted_invoice_url: Union[str | None, Any] = Field(default=None)
|
|
238
|
+
line_items: Union[list[InvoiceLineItemsItem] | None, Any] = Field(default=None)
|
|
239
|
+
subscription: Union[InvoiceSubscription | None, Any] = Field(default=None)
|
|
240
|
+
customer: Union[InvoiceCustomer | None, Any] = Field(default=None)
|
|
241
|
+
currency: Union[str | None, Any] = Field(default=None)
|
|
242
|
+
discount: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
243
|
+
minimum: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
244
|
+
maximum: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
245
|
+
credit_notes: Union[list[dict[str, Any]] | None, Any] = Field(default=None)
|
|
246
|
+
will_auto_issue: Union[bool | None, Any] = Field(default=None)
|
|
247
|
+
eligible_to_issue_at: Union[str | None, Any] = Field(default=None)
|
|
248
|
+
customer_balance_transactions: Union[list[dict[str, Any]] | None, Any] = Field(default=None)
|
|
249
|
+
auto_collection: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
250
|
+
invoice_number: Union[str | None, Any] = Field(default=None)
|
|
251
|
+
billing_address: Union[Any, Any] = Field(default=None)
|
|
252
|
+
shipping_address: Union[Any, Any] = Field(default=None)
|
|
253
|
+
metadata: Union[dict[str, Any] | None, Any] = Field(default=None)
|
|
254
|
+
|
|
255
|
+
class InvoicesList(BaseModel):
|
|
256
|
+
"""Paginated list of invoices"""
|
|
257
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
258
|
+
|
|
259
|
+
data: Union[list[Invoice], Any] = Field(default=None)
|
|
260
|
+
pagination_metadata: Union[PaginationMetadata, Any] = Field(default=None)
|
|
261
|
+
|
|
262
|
+
# ===== METADATA TYPE DEFINITIONS (PYDANTIC) =====
|
|
263
|
+
# Meta types for operations that extract metadata (e.g., pagination info)
|
|
264
|
+
|
|
265
|
+
class CustomersListResultMeta(BaseModel):
|
|
266
|
+
"""Metadata for customers.Action.LIST operation"""
|
|
267
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
268
|
+
|
|
269
|
+
next_cursor: Union[str | None, Any] = Field(default=None)
|
|
270
|
+
|
|
271
|
+
class SubscriptionsListResultMeta(BaseModel):
|
|
272
|
+
"""Metadata for subscriptions.Action.LIST operation"""
|
|
273
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
274
|
+
|
|
275
|
+
next_cursor: Union[str | None, Any] = Field(default=None)
|
|
276
|
+
|
|
277
|
+
class PlansListResultMeta(BaseModel):
|
|
278
|
+
"""Metadata for plans.Action.LIST operation"""
|
|
279
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
280
|
+
|
|
281
|
+
next_cursor: Union[str | None, Any] = Field(default=None)
|
|
282
|
+
|
|
283
|
+
class InvoicesListResultMeta(BaseModel):
|
|
284
|
+
"""Metadata for invoices.Action.LIST operation"""
|
|
285
|
+
model_config = ConfigDict(extra="allow", populate_by_name=True)
|
|
286
|
+
|
|
287
|
+
next_cursor: Union[str | None, Any] = Field(default=None)
|
|
288
|
+
|
|
289
|
+
# ===== CHECK RESULT MODEL =====
|
|
290
|
+
|
|
291
|
+
class OrbCheckResult(BaseModel):
|
|
292
|
+
"""Result of a health check operation.
|
|
293
|
+
|
|
294
|
+
Returned by the check() method to indicate connectivity and credential status.
|
|
295
|
+
"""
|
|
296
|
+
model_config = ConfigDict(extra="forbid")
|
|
297
|
+
|
|
298
|
+
status: str
|
|
299
|
+
"""Health check status: 'healthy' or 'unhealthy'."""
|
|
300
|
+
error: str | None = None
|
|
301
|
+
"""Error message if status is 'unhealthy', None otherwise."""
|
|
302
|
+
checked_entity: str | None = None
|
|
303
|
+
"""Entity name used for the health check."""
|
|
304
|
+
checked_action: str | None = None
|
|
305
|
+
"""Action name used for the health check."""
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
# ===== RESPONSE ENVELOPE MODELS =====
|
|
309
|
+
|
|
310
|
+
# Type variables for generic envelope models
|
|
311
|
+
T = TypeVar('T')
|
|
312
|
+
S = TypeVar('S')
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
class OrbExecuteResult(BaseModel, Generic[T]):
|
|
316
|
+
"""Response envelope with data only.
|
|
317
|
+
|
|
318
|
+
Used for actions that return data without metadata.
|
|
319
|
+
"""
|
|
320
|
+
model_config = ConfigDict(extra="forbid")
|
|
321
|
+
|
|
322
|
+
data: T
|
|
323
|
+
"""Response data containing the result of the action."""
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
class OrbExecuteResultWithMeta(OrbExecuteResult[T], Generic[T, S]):
|
|
327
|
+
"""Response envelope with data and metadata.
|
|
328
|
+
|
|
329
|
+
Used for actions that return both data and metadata (e.g., pagination info).
|
|
330
|
+
"""
|
|
331
|
+
meta: S
|
|
332
|
+
"""Metadata about the response (e.g., pagination cursors, record counts)."""
|
|
333
|
+
|
|
334
|
+
# ===== SEARCH DATA MODELS =====
|
|
335
|
+
# Entity-specific Pydantic models for search result data
|
|
336
|
+
|
|
337
|
+
# Type variable for search data generic
|
|
338
|
+
D = TypeVar('D')
|
|
339
|
+
|
|
340
|
+
class CustomersSearchData(BaseModel):
|
|
341
|
+
"""Search result data for customers entity."""
|
|
342
|
+
model_config = ConfigDict(extra="allow")
|
|
343
|
+
|
|
344
|
+
id: str = None
|
|
345
|
+
"""The unique identifier of the customer"""
|
|
346
|
+
external_customer_id: str | None = None
|
|
347
|
+
"""The ID of the customer in an external system"""
|
|
348
|
+
name: str | None = None
|
|
349
|
+
"""The name of the customer"""
|
|
350
|
+
email: str | None = None
|
|
351
|
+
"""The email address of the customer"""
|
|
352
|
+
created_at: str | None = None
|
|
353
|
+
"""The date and time when the customer was created"""
|
|
354
|
+
payment_provider: str | None = None
|
|
355
|
+
"""The payment provider used by the customer"""
|
|
356
|
+
payment_provider_id: str | None = None
|
|
357
|
+
"""The ID of the customer in the payment provider's system"""
|
|
358
|
+
timezone: str | None = None
|
|
359
|
+
"""The timezone setting of the customer"""
|
|
360
|
+
shipping_address: dict[str, Any] | None = None
|
|
361
|
+
"""The shipping address of the customer"""
|
|
362
|
+
billing_address: dict[str, Any] | None = None
|
|
363
|
+
"""The billing address of the customer"""
|
|
364
|
+
balance: str | None = None
|
|
365
|
+
"""The current balance of the customer"""
|
|
366
|
+
currency: str | None = None
|
|
367
|
+
"""The currency of the customer"""
|
|
368
|
+
auto_collection: bool | None = None
|
|
369
|
+
"""Whether auto collection is enabled"""
|
|
370
|
+
metadata: dict[str, Any] | None = None
|
|
371
|
+
"""Additional metadata for the customer"""
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
class SubscriptionsSearchData(BaseModel):
|
|
375
|
+
"""Search result data for subscriptions entity."""
|
|
376
|
+
model_config = ConfigDict(extra="allow")
|
|
377
|
+
|
|
378
|
+
id: str = None
|
|
379
|
+
"""The unique identifier of the subscription"""
|
|
380
|
+
created_at: str | None = None
|
|
381
|
+
"""The date and time when the subscription was created"""
|
|
382
|
+
start_date: str | None = None
|
|
383
|
+
"""The date and time when the subscription starts"""
|
|
384
|
+
end_date: str | None = None
|
|
385
|
+
"""The date and time when the subscription ends"""
|
|
386
|
+
status: str | None = None
|
|
387
|
+
"""The current status of the subscription"""
|
|
388
|
+
customer: dict[str, Any] | None = None
|
|
389
|
+
"""The customer associated with the subscription"""
|
|
390
|
+
plan: dict[str, Any] | None = None
|
|
391
|
+
"""The plan associated with the subscription"""
|
|
392
|
+
current_billing_period_start_date: str | None = None
|
|
393
|
+
"""The start date of the current billing period"""
|
|
394
|
+
current_billing_period_end_date: str | None = None
|
|
395
|
+
"""The end date of the current billing period"""
|
|
396
|
+
auto_collection: bool | None = None
|
|
397
|
+
"""Whether auto collection is enabled"""
|
|
398
|
+
net_terms: int | None = None
|
|
399
|
+
"""The net terms for the subscription"""
|
|
400
|
+
metadata: dict[str, Any] | None = None
|
|
401
|
+
"""Additional metadata for the subscription"""
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
class PlansSearchData(BaseModel):
|
|
405
|
+
"""Search result data for plans entity."""
|
|
406
|
+
model_config = ConfigDict(extra="allow")
|
|
407
|
+
|
|
408
|
+
id: str = None
|
|
409
|
+
"""The unique identifier of the plan"""
|
|
410
|
+
created_at: str | None = None
|
|
411
|
+
"""The date and time when the plan was created"""
|
|
412
|
+
name: str | None = None
|
|
413
|
+
"""The name of the plan"""
|
|
414
|
+
description: str | None = None
|
|
415
|
+
"""A description of the plan"""
|
|
416
|
+
status: str | None = None
|
|
417
|
+
"""The status of the plan"""
|
|
418
|
+
currency: str | None = None
|
|
419
|
+
"""The currency of the plan"""
|
|
420
|
+
prices: list[Any] | None = None
|
|
421
|
+
"""The pricing options for the plan"""
|
|
422
|
+
product: dict[str, Any] | None = None
|
|
423
|
+
"""The product associated with the plan"""
|
|
424
|
+
external_plan_id: str | None = None
|
|
425
|
+
"""The external plan ID"""
|
|
426
|
+
metadata: dict[str, Any] | None = None
|
|
427
|
+
"""Additional metadata for the plan"""
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
class InvoicesSearchData(BaseModel):
|
|
431
|
+
"""Search result data for invoices entity."""
|
|
432
|
+
model_config = ConfigDict(extra="allow")
|
|
433
|
+
|
|
434
|
+
id: str = None
|
|
435
|
+
"""The unique identifier of the invoice"""
|
|
436
|
+
created_at: str | None = None
|
|
437
|
+
"""The date and time when the invoice was created"""
|
|
438
|
+
invoice_date: str | None = None
|
|
439
|
+
"""The date of the invoice"""
|
|
440
|
+
due_date: str | None = None
|
|
441
|
+
"""The due date for the invoice"""
|
|
442
|
+
invoice_pdf: str | None = None
|
|
443
|
+
"""The URL to download the PDF version of the invoice"""
|
|
444
|
+
subtotal: str | None = None
|
|
445
|
+
"""The subtotal amount of the invoice"""
|
|
446
|
+
total: str | None = None
|
|
447
|
+
"""The total amount of the invoice"""
|
|
448
|
+
amount_due: str | None = None
|
|
449
|
+
"""The amount due on the invoice"""
|
|
450
|
+
status: str | None = None
|
|
451
|
+
"""The current status of the invoice"""
|
|
452
|
+
memo: str | None = None
|
|
453
|
+
"""Any additional notes or comments on the invoice"""
|
|
454
|
+
paid_at: str | None = None
|
|
455
|
+
"""The date and time when the invoice was paid"""
|
|
456
|
+
issued_at: str | None = None
|
|
457
|
+
"""The date and time when the invoice was issued"""
|
|
458
|
+
hosted_invoice_url: str | None = None
|
|
459
|
+
"""The URL to view the hosted invoice"""
|
|
460
|
+
line_items: list[Any] | None = None
|
|
461
|
+
"""The line items on the invoice"""
|
|
462
|
+
subscription: dict[str, Any] | None = None
|
|
463
|
+
"""The subscription associated with the invoice"""
|
|
464
|
+
customer: dict[str, Any] | None = None
|
|
465
|
+
"""The customer associated with the invoice"""
|
|
466
|
+
currency: str | None = None
|
|
467
|
+
"""The currency of the invoice"""
|
|
468
|
+
invoice_number: str | None = None
|
|
469
|
+
"""The invoice number"""
|
|
470
|
+
metadata: dict[str, Any] | None = None
|
|
471
|
+
"""Additional metadata for the invoice"""
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
# ===== GENERIC SEARCH RESULT TYPES =====
|
|
475
|
+
|
|
476
|
+
class AirbyteSearchHit(BaseModel, Generic[D]):
|
|
477
|
+
"""A single search result with typed data."""
|
|
478
|
+
model_config = ConfigDict(extra="allow")
|
|
479
|
+
|
|
480
|
+
id: str | None = None
|
|
481
|
+
"""Unique identifier for the record."""
|
|
482
|
+
score: float | None = None
|
|
483
|
+
"""Relevance score for the match."""
|
|
484
|
+
data: D
|
|
485
|
+
"""The matched record data."""
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
class AirbyteSearchResult(BaseModel, Generic[D]):
|
|
489
|
+
"""Result from Airbyte cache search operations with typed hits."""
|
|
490
|
+
model_config = ConfigDict(extra="allow")
|
|
491
|
+
|
|
492
|
+
hits: list[AirbyteSearchHit[D]] = Field(default_factory=list)
|
|
493
|
+
"""List of matching records."""
|
|
494
|
+
next_cursor: str | None = None
|
|
495
|
+
"""Cursor for fetching the next page of results."""
|
|
496
|
+
took_ms: int | None = None
|
|
497
|
+
"""Time taken to execute the search in milliseconds."""
|
|
498
|
+
|
|
499
|
+
|
|
500
|
+
# ===== ENTITY-SPECIFIC SEARCH RESULT TYPE ALIASES =====
|
|
501
|
+
|
|
502
|
+
CustomersSearchResult = AirbyteSearchResult[CustomersSearchData]
|
|
503
|
+
"""Search result type for customers entity."""
|
|
504
|
+
|
|
505
|
+
SubscriptionsSearchResult = AirbyteSearchResult[SubscriptionsSearchData]
|
|
506
|
+
"""Search result type for subscriptions entity."""
|
|
507
|
+
|
|
508
|
+
PlansSearchResult = AirbyteSearchResult[PlansSearchData]
|
|
509
|
+
"""Search result type for plans entity."""
|
|
510
|
+
|
|
511
|
+
InvoicesSearchResult = AirbyteSearchResult[InvoicesSearchData]
|
|
512
|
+
"""Search result type for invoices entity."""
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
# ===== OPERATION RESULT TYPE ALIASES =====
|
|
517
|
+
|
|
518
|
+
# Concrete type aliases for each operation result.
|
|
519
|
+
# These provide simpler, more readable type annotations than using the generic forms.
|
|
520
|
+
|
|
521
|
+
CustomersListResult = OrbExecuteResultWithMeta[list[Customer], CustomersListResultMeta]
|
|
522
|
+
"""Result type for customers.list operation with data and metadata."""
|
|
523
|
+
|
|
524
|
+
SubscriptionsListResult = OrbExecuteResultWithMeta[list[Subscription], SubscriptionsListResultMeta]
|
|
525
|
+
"""Result type for subscriptions.list operation with data and metadata."""
|
|
526
|
+
|
|
527
|
+
PlansListResult = OrbExecuteResultWithMeta[list[Plan], PlansListResultMeta]
|
|
528
|
+
"""Result type for plans.list operation with data and metadata."""
|
|
529
|
+
|
|
530
|
+
InvoicesListResult = OrbExecuteResultWithMeta[list[Invoice], InvoicesListResultMeta]
|
|
531
|
+
"""Result type for invoices.list operation with data and metadata."""
|
|
532
|
+
|