airbyte-agent-orb 0.1.0__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.
Files changed (57) hide show
  1. airbyte_agent_orb/__init__.py +137 -0
  2. airbyte_agent_orb/_vendored/__init__.py +1 -0
  3. airbyte_agent_orb/_vendored/connector_sdk/__init__.py +82 -0
  4. airbyte_agent_orb/_vendored/connector_sdk/auth_strategies.py +1171 -0
  5. airbyte_agent_orb/_vendored/connector_sdk/auth_template.py +135 -0
  6. airbyte_agent_orb/_vendored/connector_sdk/cloud_utils/__init__.py +5 -0
  7. airbyte_agent_orb/_vendored/connector_sdk/cloud_utils/client.py +213 -0
  8. airbyte_agent_orb/_vendored/connector_sdk/connector_model_loader.py +1116 -0
  9. airbyte_agent_orb/_vendored/connector_sdk/constants.py +78 -0
  10. airbyte_agent_orb/_vendored/connector_sdk/exceptions.py +23 -0
  11. airbyte_agent_orb/_vendored/connector_sdk/executor/__init__.py +31 -0
  12. airbyte_agent_orb/_vendored/connector_sdk/executor/hosted_executor.py +196 -0
  13. airbyte_agent_orb/_vendored/connector_sdk/executor/local_executor.py +1773 -0
  14. airbyte_agent_orb/_vendored/connector_sdk/executor/models.py +190 -0
  15. airbyte_agent_orb/_vendored/connector_sdk/extensions.py +693 -0
  16. airbyte_agent_orb/_vendored/connector_sdk/http/__init__.py +37 -0
  17. airbyte_agent_orb/_vendored/connector_sdk/http/adapters/__init__.py +9 -0
  18. airbyte_agent_orb/_vendored/connector_sdk/http/adapters/httpx_adapter.py +251 -0
  19. airbyte_agent_orb/_vendored/connector_sdk/http/config.py +98 -0
  20. airbyte_agent_orb/_vendored/connector_sdk/http/exceptions.py +119 -0
  21. airbyte_agent_orb/_vendored/connector_sdk/http/protocols.py +114 -0
  22. airbyte_agent_orb/_vendored/connector_sdk/http/response.py +104 -0
  23. airbyte_agent_orb/_vendored/connector_sdk/http_client.py +693 -0
  24. airbyte_agent_orb/_vendored/connector_sdk/introspection.py +481 -0
  25. airbyte_agent_orb/_vendored/connector_sdk/logging/__init__.py +11 -0
  26. airbyte_agent_orb/_vendored/connector_sdk/logging/logger.py +273 -0
  27. airbyte_agent_orb/_vendored/connector_sdk/logging/types.py +93 -0
  28. airbyte_agent_orb/_vendored/connector_sdk/observability/__init__.py +11 -0
  29. airbyte_agent_orb/_vendored/connector_sdk/observability/config.py +179 -0
  30. airbyte_agent_orb/_vendored/connector_sdk/observability/models.py +19 -0
  31. airbyte_agent_orb/_vendored/connector_sdk/observability/redactor.py +81 -0
  32. airbyte_agent_orb/_vendored/connector_sdk/observability/session.py +103 -0
  33. airbyte_agent_orb/_vendored/connector_sdk/performance/__init__.py +6 -0
  34. airbyte_agent_orb/_vendored/connector_sdk/performance/instrumentation.py +57 -0
  35. airbyte_agent_orb/_vendored/connector_sdk/performance/metrics.py +93 -0
  36. airbyte_agent_orb/_vendored/connector_sdk/schema/__init__.py +75 -0
  37. airbyte_agent_orb/_vendored/connector_sdk/schema/base.py +201 -0
  38. airbyte_agent_orb/_vendored/connector_sdk/schema/components.py +244 -0
  39. airbyte_agent_orb/_vendored/connector_sdk/schema/connector.py +120 -0
  40. airbyte_agent_orb/_vendored/connector_sdk/schema/extensions.py +301 -0
  41. airbyte_agent_orb/_vendored/connector_sdk/schema/operations.py +146 -0
  42. airbyte_agent_orb/_vendored/connector_sdk/schema/security.py +236 -0
  43. airbyte_agent_orb/_vendored/connector_sdk/secrets.py +182 -0
  44. airbyte_agent_orb/_vendored/connector_sdk/telemetry/__init__.py +10 -0
  45. airbyte_agent_orb/_vendored/connector_sdk/telemetry/config.py +32 -0
  46. airbyte_agent_orb/_vendored/connector_sdk/telemetry/events.py +59 -0
  47. airbyte_agent_orb/_vendored/connector_sdk/telemetry/tracker.py +155 -0
  48. airbyte_agent_orb/_vendored/connector_sdk/types.py +255 -0
  49. airbyte_agent_orb/_vendored/connector_sdk/utils.py +60 -0
  50. airbyte_agent_orb/_vendored/connector_sdk/validation.py +828 -0
  51. airbyte_agent_orb/connector.py +1035 -0
  52. airbyte_agent_orb/connector_model.py +2163 -0
  53. airbyte_agent_orb/models.py +513 -0
  54. airbyte_agent_orb/types.py +1090 -0
  55. airbyte_agent_orb-0.1.0.dist-info/METADATA +152 -0
  56. airbyte_agent_orb-0.1.0.dist-info/RECORD +57 -0
  57. airbyte_agent_orb-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,513 @@
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 SubscriptionCustomer(BaseModel):
82
+ """The customer 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 customer ID")
86
+ """The customer ID"""
87
+ external_customer_id: Union[str | None, Any] = Field(default=None, description="The external customer ID")
88
+ """The external customer ID"""
89
+
90
+ class SubscriptionPlan(BaseModel):
91
+ """The plan 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 plan ID")
95
+ """The plan ID"""
96
+ name: Union[str | None, Any] = Field(default=None, description="The plan name")
97
+ """The plan name"""
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 InvoiceCustomer(BaseModel):
184
+ """The customer associated with the invoice"""
185
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
186
+
187
+ id: Union[str | None, Any] = Field(default=None, description="The customer ID")
188
+ """The customer ID"""
189
+ external_customer_id: Union[str | None, Any] = Field(default=None, description="The external customer ID")
190
+ """The external customer ID"""
191
+
192
+ class InvoiceLineItemsItem(BaseModel):
193
+ """Nested schema for Invoice.line_items_item"""
194
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
195
+
196
+ id: Union[str | None, Any] = Field(default=None, description="The unique identifier of the line item")
197
+ """The unique identifier of the line item"""
198
+ quantity: Union[float | None, Any] = Field(default=None, description="The quantity of the line item")
199
+ """The quantity of the line item"""
200
+ amount: Union[str | None, Any] = Field(default=None, description="The amount of the line item")
201
+ """The amount of the line item"""
202
+ name: Union[str | None, Any] = Field(default=None, description="The name of the line item")
203
+ """The name of the line item"""
204
+ start_date: Union[str | None, Any] = Field(default=None, description="The start date of the line item")
205
+ """The start date of the line item"""
206
+ end_date: Union[str | None, Any] = Field(default=None, description="The end date of the line item")
207
+ """The end date of the line item"""
208
+
209
+ class InvoiceSubscription(BaseModel):
210
+ """The subscription associated with the invoice"""
211
+ model_config = ConfigDict(extra="allow", populate_by_name=True)
212
+
213
+ id: Union[str | None, Any] = Field(default=None, description="The subscription ID")
214
+ """The subscription 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
+ # ===== RESPONSE ENVELOPE MODELS =====
290
+
291
+ # Type variables for generic envelope models
292
+ T = TypeVar('T')
293
+ S = TypeVar('S')
294
+
295
+
296
+ class OrbExecuteResult(BaseModel, Generic[T]):
297
+ """Response envelope with data only.
298
+
299
+ Used for actions that return data without metadata.
300
+ """
301
+ model_config = ConfigDict(extra="forbid")
302
+
303
+ data: T
304
+ """Response data containing the result of the action."""
305
+
306
+
307
+ class OrbExecuteResultWithMeta(OrbExecuteResult[T], Generic[T, S]):
308
+ """Response envelope with data and metadata.
309
+
310
+ Used for actions that return both data and metadata (e.g., pagination info).
311
+ """
312
+ meta: S
313
+ """Metadata about the response (e.g., pagination cursors, record counts)."""
314
+
315
+ # ===== SEARCH DATA MODELS =====
316
+ # Entity-specific Pydantic models for search result data
317
+
318
+ # Type variable for search data generic
319
+ D = TypeVar('D')
320
+
321
+ class CustomersSearchData(BaseModel):
322
+ """Search result data for customers entity."""
323
+ model_config = ConfigDict(extra="allow")
324
+
325
+ id: str = None
326
+ """The unique identifier of the customer"""
327
+ external_customer_id: str | None = None
328
+ """The ID of the customer in an external system"""
329
+ name: str | None = None
330
+ """The name of the customer"""
331
+ email: str | None = None
332
+ """The email address of the customer"""
333
+ created_at: str | None = None
334
+ """The date and time when the customer was created"""
335
+ payment_provider: str | None = None
336
+ """The payment provider used by the customer"""
337
+ payment_provider_id: str | None = None
338
+ """The ID of the customer in the payment provider's system"""
339
+ timezone: str | None = None
340
+ """The timezone setting of the customer"""
341
+ shipping_address: dict[str, Any] | None = None
342
+ """The shipping address of the customer"""
343
+ billing_address: dict[str, Any] | None = None
344
+ """The billing address of the customer"""
345
+ balance: str | None = None
346
+ """The current balance of the customer"""
347
+ currency: str | None = None
348
+ """The currency of the customer"""
349
+ auto_collection: bool | None = None
350
+ """Whether auto collection is enabled"""
351
+ metadata: dict[str, Any] | None = None
352
+ """Additional metadata for the customer"""
353
+
354
+
355
+ class SubscriptionsSearchData(BaseModel):
356
+ """Search result data for subscriptions entity."""
357
+ model_config = ConfigDict(extra="allow")
358
+
359
+ id: str = None
360
+ """The unique identifier of the subscription"""
361
+ created_at: str | None = None
362
+ """The date and time when the subscription was created"""
363
+ start_date: str | None = None
364
+ """The date and time when the subscription starts"""
365
+ end_date: str | None = None
366
+ """The date and time when the subscription ends"""
367
+ status: str | None = None
368
+ """The current status of the subscription"""
369
+ customer: dict[str, Any] | None = None
370
+ """The customer associated with the subscription"""
371
+ plan: dict[str, Any] | None = None
372
+ """The plan associated with the subscription"""
373
+ current_billing_period_start_date: str | None = None
374
+ """The start date of the current billing period"""
375
+ current_billing_period_end_date: str | None = None
376
+ """The end date of the current billing period"""
377
+ auto_collection: bool | None = None
378
+ """Whether auto collection is enabled"""
379
+ net_terms: int | None = None
380
+ """The net terms for the subscription"""
381
+ metadata: dict[str, Any] | None = None
382
+ """Additional metadata for the subscription"""
383
+
384
+
385
+ class PlansSearchData(BaseModel):
386
+ """Search result data for plans entity."""
387
+ model_config = ConfigDict(extra="allow")
388
+
389
+ id: str = None
390
+ """The unique identifier of the plan"""
391
+ created_at: str | None = None
392
+ """The date and time when the plan was created"""
393
+ name: str | None = None
394
+ """The name of the plan"""
395
+ description: str | None = None
396
+ """A description of the plan"""
397
+ status: str | None = None
398
+ """The status of the plan"""
399
+ currency: str | None = None
400
+ """The currency of the plan"""
401
+ prices: list[Any] | None = None
402
+ """The pricing options for the plan"""
403
+ product: dict[str, Any] | None = None
404
+ """The product associated with the plan"""
405
+ external_plan_id: str | None = None
406
+ """The external plan ID"""
407
+ metadata: dict[str, Any] | None = None
408
+ """Additional metadata for the plan"""
409
+
410
+
411
+ class InvoicesSearchData(BaseModel):
412
+ """Search result data for invoices entity."""
413
+ model_config = ConfigDict(extra="allow")
414
+
415
+ id: str = None
416
+ """The unique identifier of the invoice"""
417
+ created_at: str | None = None
418
+ """The date and time when the invoice was created"""
419
+ invoice_date: str | None = None
420
+ """The date of the invoice"""
421
+ due_date: str | None = None
422
+ """The due date for the invoice"""
423
+ invoice_pdf: str | None = None
424
+ """The URL to download the PDF version of the invoice"""
425
+ subtotal: str | None = None
426
+ """The subtotal amount of the invoice"""
427
+ total: str | None = None
428
+ """The total amount of the invoice"""
429
+ amount_due: str | None = None
430
+ """The amount due on the invoice"""
431
+ status: str | None = None
432
+ """The current status of the invoice"""
433
+ memo: str | None = None
434
+ """Any additional notes or comments on the invoice"""
435
+ paid_at: str | None = None
436
+ """The date and time when the invoice was paid"""
437
+ issued_at: str | None = None
438
+ """The date and time when the invoice was issued"""
439
+ hosted_invoice_url: str | None = None
440
+ """The URL to view the hosted invoice"""
441
+ line_items: list[Any] | None = None
442
+ """The line items on the invoice"""
443
+ subscription: dict[str, Any] | None = None
444
+ """The subscription associated with the invoice"""
445
+ customer: dict[str, Any] | None = None
446
+ """The customer associated with the invoice"""
447
+ currency: str | None = None
448
+ """The currency of the invoice"""
449
+ invoice_number: str | None = None
450
+ """The invoice number"""
451
+ metadata: dict[str, Any] | None = None
452
+ """Additional metadata for the invoice"""
453
+
454
+
455
+ # ===== GENERIC SEARCH RESULT TYPES =====
456
+
457
+ class AirbyteSearchHit(BaseModel, Generic[D]):
458
+ """A single search result with typed data."""
459
+ model_config = ConfigDict(extra="allow")
460
+
461
+ id: str | None = None
462
+ """Unique identifier for the record."""
463
+ score: float | None = None
464
+ """Relevance score for the match."""
465
+ data: D
466
+ """The matched record data."""
467
+
468
+
469
+ class AirbyteSearchResult(BaseModel, Generic[D]):
470
+ """Result from Airbyte cache search operations with typed hits."""
471
+ model_config = ConfigDict(extra="allow")
472
+
473
+ hits: list[AirbyteSearchHit[D]] = Field(default_factory=list)
474
+ """List of matching records."""
475
+ next_cursor: str | None = None
476
+ """Cursor for fetching the next page of results."""
477
+ took_ms: int | None = None
478
+ """Time taken to execute the search in milliseconds."""
479
+
480
+
481
+ # ===== ENTITY-SPECIFIC SEARCH RESULT TYPE ALIASES =====
482
+
483
+ CustomersSearchResult = AirbyteSearchResult[CustomersSearchData]
484
+ """Search result type for customers entity."""
485
+
486
+ SubscriptionsSearchResult = AirbyteSearchResult[SubscriptionsSearchData]
487
+ """Search result type for subscriptions entity."""
488
+
489
+ PlansSearchResult = AirbyteSearchResult[PlansSearchData]
490
+ """Search result type for plans entity."""
491
+
492
+ InvoicesSearchResult = AirbyteSearchResult[InvoicesSearchData]
493
+ """Search result type for invoices entity."""
494
+
495
+
496
+
497
+ # ===== OPERATION RESULT TYPE ALIASES =====
498
+
499
+ # Concrete type aliases for each operation result.
500
+ # These provide simpler, more readable type annotations than using the generic forms.
501
+
502
+ CustomersListResult = OrbExecuteResultWithMeta[list[Customer], CustomersListResultMeta]
503
+ """Result type for customers.list operation with data and metadata."""
504
+
505
+ SubscriptionsListResult = OrbExecuteResultWithMeta[list[Subscription], SubscriptionsListResultMeta]
506
+ """Result type for subscriptions.list operation with data and metadata."""
507
+
508
+ PlansListResult = OrbExecuteResultWithMeta[list[Plan], PlansListResultMeta]
509
+ """Result type for plans.list operation with data and metadata."""
510
+
511
+ InvoicesListResult = OrbExecuteResultWithMeta[list[Invoice], InvoicesListResultMeta]
512
+ """Result type for invoices.list operation with data and metadata."""
513
+