paid-python 0.5.0__py3-none-any.whl → 1.0.0a0__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 (54) hide show
  1. paid/__init__.py +33 -0
  2. paid/client.py +1 -472
  3. paid/core/client_wrapper.py +3 -2
  4. paid/customers/__init__.py +3 -0
  5. paid/customers/client.py +428 -4
  6. paid/customers/raw_client.py +594 -2
  7. paid/customers/types/__init__.py +8 -0
  8. paid/customers/types/customers_check_entitlement_request_view.py +5 -0
  9. paid/customers/types/customers_check_entitlement_response.py +22 -0
  10. paid/orders/client.py +445 -0
  11. paid/orders/raw_client.py +705 -0
  12. paid/plans/client.py +142 -0
  13. paid/plans/raw_client.py +238 -0
  14. paid/types/__init__.py +30 -0
  15. paid/types/cancel_renewal_response.py +49 -0
  16. paid/types/contact_create_for_customer.py +37 -0
  17. paid/types/invoice.py +75 -0
  18. paid/types/invoice_status.py +5 -0
  19. paid/types/payment_method.py +58 -0
  20. paid/types/payment_method_card.py +49 -0
  21. paid/types/payment_method_type.py +5 -0
  22. paid/types/payment_method_us_bank_account.py +36 -0
  23. paid/types/payment_method_us_bank_account_account_type.py +5 -0
  24. paid/types/plan_group.py +60 -0
  25. paid/types/plan_plan_products_item.py +6 -0
  26. paid/types/plan_with_features.py +69 -0
  27. paid/types/plan_with_features_features_item.py +34 -0
  28. paid/types/proration_attribute_update.py +44 -0
  29. paid/types/proration_detail.py +49 -0
  30. paid/types/proration_upgrade_response.py +73 -0
  31. paid/types/signal_v_2.py +5 -5
  32. paid/usage/client.py +6 -6
  33. {paid_python-0.5.0.dist-info → paid_python-1.0.0a0.dist-info}/METADATA +6 -4
  34. {paid_python-0.5.0.dist-info → paid_python-1.0.0a0.dist-info}/RECORD +36 -36
  35. opentelemetry/instrumentation/openai/__init__.py +0 -54
  36. opentelemetry/instrumentation/openai/shared/__init__.py +0 -399
  37. opentelemetry/instrumentation/openai/shared/audio_wrappers.py +0 -247
  38. opentelemetry/instrumentation/openai/shared/chat_wrappers.py +0 -1192
  39. opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -292
  40. opentelemetry/instrumentation/openai/shared/config.py +0 -15
  41. opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +0 -311
  42. opentelemetry/instrumentation/openai/shared/event_emitter.py +0 -108
  43. opentelemetry/instrumentation/openai/shared/event_models.py +0 -41
  44. opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -68
  45. opentelemetry/instrumentation/openai/shared/span_utils.py +0 -0
  46. opentelemetry/instrumentation/openai/utils.py +0 -213
  47. opentelemetry/instrumentation/openai/v0/__init__.py +0 -176
  48. opentelemetry/instrumentation/openai/v1/__init__.py +0 -394
  49. opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -329
  50. opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +0 -134
  51. opentelemetry/instrumentation/openai/v1/responses_wrappers.py +0 -1113
  52. opentelemetry/instrumentation/openai/version.py +0 -1
  53. {paid_python-0.5.0.dist-info → paid_python-1.0.0a0.dist-info}/LICENSE +0 -0
  54. {paid_python-0.5.0.dist-info → paid_python-1.0.0a0.dist-info}/WHEEL +0 -0
paid/plans/client.py CHANGED
@@ -6,6 +6,8 @@ import typing
6
6
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
7
  from ..core.request_options import RequestOptions
8
8
  from ..types.plan import Plan
9
+ from ..types.plan_group import PlanGroup
10
+ from ..types.plan_with_features import PlanWithFeatures
9
11
  from ..types.usage_summaries_response import UsageSummariesResponse
10
12
  from .raw_client import AsyncRawPlansClient, RawPlansClient
11
13
 
@@ -127,6 +129,68 @@ class PlansClient:
127
129
  )
128
130
  return _response.data
129
131
 
132
+ def get_group_by_id(
133
+ self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
134
+ ) -> PlanGroup:
135
+ """
136
+ Parameters
137
+ ----------
138
+ plan_group_id : str
139
+ The ID of the plan group
140
+
141
+ request_options : typing.Optional[RequestOptions]
142
+ Request-specific configuration.
143
+
144
+ Returns
145
+ -------
146
+ PlanGroup
147
+ Success response
148
+
149
+ Examples
150
+ --------
151
+ from paid import Paid
152
+
153
+ client = Paid(
154
+ token="YOUR_TOKEN",
155
+ )
156
+ client.plans.get_group_by_id(
157
+ plan_group_id="planGroupId",
158
+ )
159
+ """
160
+ _response = self._raw_client.get_group_by_id(plan_group_id, request_options=request_options)
161
+ return _response.data
162
+
163
+ def get_group_plans(
164
+ self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
165
+ ) -> typing.List[PlanWithFeatures]:
166
+ """
167
+ Parameters
168
+ ----------
169
+ plan_group_id : str
170
+ The ID of the plan group
171
+
172
+ request_options : typing.Optional[RequestOptions]
173
+ Request-specific configuration.
174
+
175
+ Returns
176
+ -------
177
+ typing.List[PlanWithFeatures]
178
+ Success response
179
+
180
+ Examples
181
+ --------
182
+ from paid import Paid
183
+
184
+ client = Paid(
185
+ token="YOUR_TOKEN",
186
+ )
187
+ client.plans.get_group_plans(
188
+ plan_group_id="planGroupId",
189
+ )
190
+ """
191
+ _response = self._raw_client.get_group_plans(plan_group_id, request_options=request_options)
192
+ return _response.data
193
+
130
194
 
131
195
  class AsyncPlansClient:
132
196
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -259,3 +323,81 @@ class AsyncPlansClient:
259
323
  request_options=request_options,
260
324
  )
261
325
  return _response.data
326
+
327
+ async def get_group_by_id(
328
+ self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
329
+ ) -> PlanGroup:
330
+ """
331
+ Parameters
332
+ ----------
333
+ plan_group_id : str
334
+ The ID of the plan group
335
+
336
+ request_options : typing.Optional[RequestOptions]
337
+ Request-specific configuration.
338
+
339
+ Returns
340
+ -------
341
+ PlanGroup
342
+ Success response
343
+
344
+ Examples
345
+ --------
346
+ import asyncio
347
+
348
+ from paid import AsyncPaid
349
+
350
+ client = AsyncPaid(
351
+ token="YOUR_TOKEN",
352
+ )
353
+
354
+
355
+ async def main() -> None:
356
+ await client.plans.get_group_by_id(
357
+ plan_group_id="planGroupId",
358
+ )
359
+
360
+
361
+ asyncio.run(main())
362
+ """
363
+ _response = await self._raw_client.get_group_by_id(plan_group_id, request_options=request_options)
364
+ return _response.data
365
+
366
+ async def get_group_plans(
367
+ self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
368
+ ) -> typing.List[PlanWithFeatures]:
369
+ """
370
+ Parameters
371
+ ----------
372
+ plan_group_id : str
373
+ The ID of the plan group
374
+
375
+ request_options : typing.Optional[RequestOptions]
376
+ Request-specific configuration.
377
+
378
+ Returns
379
+ -------
380
+ typing.List[PlanWithFeatures]
381
+ Success response
382
+
383
+ Examples
384
+ --------
385
+ import asyncio
386
+
387
+ from paid import AsyncPaid
388
+
389
+ client = AsyncPaid(
390
+ token="YOUR_TOKEN",
391
+ )
392
+
393
+
394
+ async def main() -> None:
395
+ await client.plans.get_group_plans(
396
+ plan_group_id="planGroupId",
397
+ )
398
+
399
+
400
+ asyncio.run(main())
401
+ """
402
+ _response = await self._raw_client.get_group_plans(plan_group_id, request_options=request_options)
403
+ return _response.data
paid/plans/raw_client.py CHANGED
@@ -16,6 +16,8 @@ from ..errors.forbidden_error import ForbiddenError
16
16
  from ..errors.not_found_error import NotFoundError
17
17
  from ..types.error import Error
18
18
  from ..types.plan import Plan
19
+ from ..types.plan_group import PlanGroup
20
+ from ..types.plan_with_features import PlanWithFeatures
19
21
  from ..types.usage_summaries_response import UsageSummariesResponse
20
22
 
21
23
 
@@ -180,6 +182,124 @@ class RawPlansClient:
180
182
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
181
183
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
182
184
 
185
+ def get_group_by_id(
186
+ self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
187
+ ) -> HttpResponse[PlanGroup]:
188
+ """
189
+ Parameters
190
+ ----------
191
+ plan_group_id : str
192
+ The ID of the plan group
193
+
194
+ request_options : typing.Optional[RequestOptions]
195
+ Request-specific configuration.
196
+
197
+ Returns
198
+ -------
199
+ HttpResponse[PlanGroup]
200
+ Success response
201
+ """
202
+ _response = self._client_wrapper.httpx_client.request(
203
+ f"plans/planGroup/{jsonable_encoder(plan_group_id)}",
204
+ method="GET",
205
+ request_options=request_options,
206
+ )
207
+ try:
208
+ if 200 <= _response.status_code < 300:
209
+ _data = typing.cast(
210
+ PlanGroup,
211
+ parse_obj_as(
212
+ type_=PlanGroup, # type: ignore
213
+ object_=_response.json(),
214
+ ),
215
+ )
216
+ return HttpResponse(response=_response, data=_data)
217
+ if _response.status_code == 403:
218
+ raise ForbiddenError(
219
+ headers=dict(_response.headers),
220
+ body=typing.cast(
221
+ Error,
222
+ parse_obj_as(
223
+ type_=Error, # type: ignore
224
+ object_=_response.json(),
225
+ ),
226
+ ),
227
+ )
228
+ if _response.status_code == 404:
229
+ raise NotFoundError(
230
+ headers=dict(_response.headers),
231
+ body=typing.cast(
232
+ Error,
233
+ parse_obj_as(
234
+ type_=Error, # type: ignore
235
+ object_=_response.json(),
236
+ ),
237
+ ),
238
+ )
239
+ _response_json = _response.json()
240
+ except JSONDecodeError:
241
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
242
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
243
+
244
+ def get_group_plans(
245
+ self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
246
+ ) -> HttpResponse[typing.List[PlanWithFeatures]]:
247
+ """
248
+ Parameters
249
+ ----------
250
+ plan_group_id : str
251
+ The ID of the plan group
252
+
253
+ request_options : typing.Optional[RequestOptions]
254
+ Request-specific configuration.
255
+
256
+ Returns
257
+ -------
258
+ HttpResponse[typing.List[PlanWithFeatures]]
259
+ Success response
260
+ """
261
+ _response = self._client_wrapper.httpx_client.request(
262
+ f"plans/planGroup/{jsonable_encoder(plan_group_id)}/plans",
263
+ method="GET",
264
+ request_options=request_options,
265
+ )
266
+ try:
267
+ if 200 <= _response.status_code < 300:
268
+ _data = typing.cast(
269
+ typing.List[PlanWithFeatures],
270
+ parse_obj_as(
271
+ type_=typing.List[PlanWithFeatures], # type: ignore
272
+ object_=_response.json(),
273
+ ),
274
+ )
275
+ return HttpResponse(response=_response, data=_data)
276
+ if _response.status_code == 403:
277
+ raise ForbiddenError(
278
+ headers=dict(_response.headers),
279
+ body=typing.cast(
280
+ Error,
281
+ parse_obj_as(
282
+ type_=Error, # type: ignore
283
+ object_=_response.json(),
284
+ ),
285
+ ),
286
+ )
287
+ if _response.status_code == 404:
288
+ raise NotFoundError(
289
+ headers=dict(_response.headers),
290
+ body=typing.cast(
291
+ Error,
292
+ parse_obj_as(
293
+ type_=Error, # type: ignore
294
+ object_=_response.json(),
295
+ ),
296
+ ),
297
+ )
298
+ _response_json = _response.json()
299
+ except JSONDecodeError:
300
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
301
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
302
+
183
303
 
184
304
  class AsyncRawPlansClient:
185
305
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -343,3 +463,121 @@ class AsyncRawPlansClient:
343
463
  except JSONDecodeError:
344
464
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
345
465
  raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
466
+
467
+ async def get_group_by_id(
468
+ self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
469
+ ) -> AsyncHttpResponse[PlanGroup]:
470
+ """
471
+ Parameters
472
+ ----------
473
+ plan_group_id : str
474
+ The ID of the plan group
475
+
476
+ request_options : typing.Optional[RequestOptions]
477
+ Request-specific configuration.
478
+
479
+ Returns
480
+ -------
481
+ AsyncHttpResponse[PlanGroup]
482
+ Success response
483
+ """
484
+ _response = await self._client_wrapper.httpx_client.request(
485
+ f"plans/planGroup/{jsonable_encoder(plan_group_id)}",
486
+ method="GET",
487
+ request_options=request_options,
488
+ )
489
+ try:
490
+ if 200 <= _response.status_code < 300:
491
+ _data = typing.cast(
492
+ PlanGroup,
493
+ parse_obj_as(
494
+ type_=PlanGroup, # type: ignore
495
+ object_=_response.json(),
496
+ ),
497
+ )
498
+ return AsyncHttpResponse(response=_response, data=_data)
499
+ if _response.status_code == 403:
500
+ raise ForbiddenError(
501
+ headers=dict(_response.headers),
502
+ body=typing.cast(
503
+ Error,
504
+ parse_obj_as(
505
+ type_=Error, # type: ignore
506
+ object_=_response.json(),
507
+ ),
508
+ ),
509
+ )
510
+ if _response.status_code == 404:
511
+ raise NotFoundError(
512
+ headers=dict(_response.headers),
513
+ body=typing.cast(
514
+ Error,
515
+ parse_obj_as(
516
+ type_=Error, # type: ignore
517
+ object_=_response.json(),
518
+ ),
519
+ ),
520
+ )
521
+ _response_json = _response.json()
522
+ except JSONDecodeError:
523
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
524
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
525
+
526
+ async def get_group_plans(
527
+ self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
528
+ ) -> AsyncHttpResponse[typing.List[PlanWithFeatures]]:
529
+ """
530
+ Parameters
531
+ ----------
532
+ plan_group_id : str
533
+ The ID of the plan group
534
+
535
+ request_options : typing.Optional[RequestOptions]
536
+ Request-specific configuration.
537
+
538
+ Returns
539
+ -------
540
+ AsyncHttpResponse[typing.List[PlanWithFeatures]]
541
+ Success response
542
+ """
543
+ _response = await self._client_wrapper.httpx_client.request(
544
+ f"plans/planGroup/{jsonable_encoder(plan_group_id)}/plans",
545
+ method="GET",
546
+ request_options=request_options,
547
+ )
548
+ try:
549
+ if 200 <= _response.status_code < 300:
550
+ _data = typing.cast(
551
+ typing.List[PlanWithFeatures],
552
+ parse_obj_as(
553
+ type_=typing.List[PlanWithFeatures], # type: ignore
554
+ object_=_response.json(),
555
+ ),
556
+ )
557
+ return AsyncHttpResponse(response=_response, data=_data)
558
+ if _response.status_code == 403:
559
+ raise ForbiddenError(
560
+ headers=dict(_response.headers),
561
+ body=typing.cast(
562
+ Error,
563
+ parse_obj_as(
564
+ type_=Error, # type: ignore
565
+ object_=_response.json(),
566
+ ),
567
+ ),
568
+ )
569
+ if _response.status_code == 404:
570
+ raise NotFoundError(
571
+ headers=dict(_response.headers),
572
+ body=typing.cast(
573
+ Error,
574
+ parse_obj_as(
575
+ type_=Error, # type: ignore
576
+ object_=_response.json(),
577
+ ),
578
+ ),
579
+ )
580
+ _response_json = _response.json()
581
+ except JSONDecodeError:
582
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
583
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
paid/types/__init__.py CHANGED
@@ -10,8 +10,10 @@ from .agent_price_point_tiers import AgentPricePointTiers
10
10
  from .agent_update import AgentUpdate
11
11
  from .api_error import ApiError
12
12
  from .billing_frequency import BillingFrequency
13
+ from .cancel_renewal_response import CancelRenewalResponse
13
14
  from .charge_type import ChargeType
14
15
  from .contact import Contact
16
+ from .contact_create_for_customer import ContactCreateForCustomer
15
17
  from .cost_amount import CostAmount
16
18
  from .cost_trace import CostTrace
17
19
  from .cost_traces_response import CostTracesResponse
@@ -21,6 +23,8 @@ from .customer import Customer
21
23
  from .customer_update import CustomerUpdate
22
24
  from .entitlement_usage import EntitlementUsage
23
25
  from .error import Error
26
+ from .invoice import Invoice
27
+ from .invoice_status import InvoiceStatus
24
28
  from .order import Order
25
29
  from .order_line import OrderLine
26
30
  from .order_line_attribute import OrderLineAttribute
@@ -28,9 +32,17 @@ from .order_line_attribute_create_one import OrderLineAttributeCreateOne
28
32
  from .order_line_attribute_pricing import OrderLineAttributePricing
29
33
  from .order_line_create import OrderLineCreate
30
34
  from .pagination_meta import PaginationMeta
35
+ from .payment_method import PaymentMethod
36
+ from .payment_method_card import PaymentMethodCard
37
+ from .payment_method_type import PaymentMethodType
38
+ from .payment_method_us_bank_account import PaymentMethodUsBankAccount
39
+ from .payment_method_us_bank_account_account_type import PaymentMethodUsBankAccountAccountType
31
40
  from .plan import Plan
41
+ from .plan_group import PlanGroup
32
42
  from .plan_plan_products_item import PlanPlanProductsItem
33
43
  from .plan_plan_products_item_plan_product_attribute_item import PlanPlanProductsItemPlanProductAttributeItem
44
+ from .plan_with_features import PlanWithFeatures
45
+ from .plan_with_features_features_item import PlanWithFeaturesFeaturesItem
34
46
  from .price_point import PricePoint
35
47
  from .pricing import Pricing
36
48
  from .pricing_model_type import PricingModelType
@@ -38,6 +50,9 @@ from .product import Product
38
50
  from .product_type import ProductType
39
51
  from .product_update import ProductUpdate
40
52
  from .product_update_type import ProductUpdateType
53
+ from .proration_attribute_update import ProrationAttributeUpdate
54
+ from .proration_detail import ProrationDetail
55
+ from .proration_upgrade_response import ProrationUpgradeResponse
41
56
  from .salutation import Salutation
42
57
  from .signal import Signal
43
58
  from .signal_v_2 import SignalV2
@@ -60,8 +75,10 @@ __all__ = [
60
75
  "AgentUpdate",
61
76
  "ApiError",
62
77
  "BillingFrequency",
78
+ "CancelRenewalResponse",
63
79
  "ChargeType",
64
80
  "Contact",
81
+ "ContactCreateForCustomer",
65
82
  "CostAmount",
66
83
  "CostTrace",
67
84
  "CostTracesResponse",
@@ -71,6 +88,8 @@ __all__ = [
71
88
  "CustomerUpdate",
72
89
  "EntitlementUsage",
73
90
  "Error",
91
+ "Invoice",
92
+ "InvoiceStatus",
74
93
  "Order",
75
94
  "OrderLine",
76
95
  "OrderLineAttribute",
@@ -78,9 +97,17 @@ __all__ = [
78
97
  "OrderLineAttributePricing",
79
98
  "OrderLineCreate",
80
99
  "PaginationMeta",
100
+ "PaymentMethod",
101
+ "PaymentMethodCard",
102
+ "PaymentMethodType",
103
+ "PaymentMethodUsBankAccount",
104
+ "PaymentMethodUsBankAccountAccountType",
81
105
  "Plan",
106
+ "PlanGroup",
82
107
  "PlanPlanProductsItem",
83
108
  "PlanPlanProductsItemPlanProductAttributeItem",
109
+ "PlanWithFeatures",
110
+ "PlanWithFeaturesFeaturesItem",
84
111
  "PricePoint",
85
112
  "Pricing",
86
113
  "PricingModelType",
@@ -88,6 +115,9 @@ __all__ = [
88
115
  "ProductType",
89
116
  "ProductUpdate",
90
117
  "ProductUpdateType",
118
+ "ProrationAttributeUpdate",
119
+ "ProrationDetail",
120
+ "ProrationUpgradeResponse",
91
121
  "Salutation",
92
122
  "Signal",
93
123
  "SignalV2",
@@ -0,0 +1,49 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ import typing_extensions
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
9
+ from ..core.serialization import FieldMetadata
10
+
11
+
12
+ class CancelRenewalResponse(UniversalBaseModel):
13
+ """
14
+ Response after successfully cancelling an order's renewal
15
+ """
16
+
17
+ order_id: typing_extensions.Annotated[str, FieldMetadata(alias="orderId")] = pydantic.Field()
18
+ """
19
+ The ID of the order
20
+ """
21
+
22
+ amendment_id: typing_extensions.Annotated[str, FieldMetadata(alias="amendmentId")] = pydantic.Field()
23
+ """
24
+ The ID of the amendment record
25
+ """
26
+
27
+ version: int = pydantic.Field()
28
+ """
29
+ The new version of the order after the amendment
30
+ """
31
+
32
+ end_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="endDate")] = pydantic.Field()
33
+ """
34
+ The new end date of the order
35
+ """
36
+
37
+ effective_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="effectiveDate")] = pydantic.Field()
38
+ """
39
+ The effective date of the cancellation
40
+ """
41
+
42
+ if IS_PYDANTIC_V2:
43
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
44
+ else:
45
+
46
+ class Config:
47
+ frozen = True
48
+ smart_union = True
49
+ extra = pydantic.Extra.allow
@@ -0,0 +1,37 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ import pydantic
6
+ import typing_extensions
7
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
8
+ from ..core.serialization import FieldMetadata
9
+ from .salutation import Salutation
10
+
11
+
12
+ class ContactCreateForCustomer(UniversalBaseModel):
13
+ external_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="externalId")] = None
14
+ salutation: Salutation
15
+ first_name: typing_extensions.Annotated[str, FieldMetadata(alias="firstName")]
16
+ last_name: typing_extensions.Annotated[str, FieldMetadata(alias="lastName")]
17
+ account_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="accountName")] = None
18
+ email: str
19
+ phone: typing.Optional[str] = None
20
+ billing_street: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="billingStreet")] = None
21
+ billing_city: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="billingCity")] = None
22
+ billing_state_province: typing_extensions.Annotated[
23
+ typing.Optional[str], FieldMetadata(alias="billingStateProvince")
24
+ ] = None
25
+ billing_country: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="billingCountry")] = None
26
+ billing_postal_code: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="billingPostalCode")] = (
27
+ None
28
+ )
29
+
30
+ if IS_PYDANTIC_V2:
31
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
32
+ else:
33
+
34
+ class Config:
35
+ frozen = True
36
+ smart_union = True
37
+ extra = pydantic.Extra.allow
paid/types/invoice.py ADDED
@@ -0,0 +1,75 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import datetime as dt
4
+ import typing
5
+
6
+ import pydantic
7
+ import typing_extensions
8
+ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
9
+ from ..core.serialization import FieldMetadata
10
+ from .customer import Customer
11
+ from .invoice_status import InvoiceStatus
12
+
13
+
14
+ class Invoice(UniversalBaseModel):
15
+ """
16
+ An invoice for an order
17
+ """
18
+
19
+ id: typing.Optional[str] = None
20
+ display_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="displayId")] = pydantic.Field(
21
+ default=None
22
+ )
23
+ """
24
+ Human-readable invoice number
25
+ """
26
+
27
+ organization_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="organizationId")] = None
28
+ customer_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customerId")] = None
29
+ order_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="orderId")] = None
30
+ status: typing.Optional[InvoiceStatus] = None
31
+ currency: typing.Optional[str] = None
32
+ subtotal: typing.Optional[float] = pydantic.Field(default=None)
33
+ """
34
+ Total before tax (in smallest currency unit)
35
+ """
36
+
37
+ tax: typing.Optional[float] = pydantic.Field(default=None)
38
+ """
39
+ Tax amount (in smallest currency unit)
40
+ """
41
+
42
+ total: typing.Optional[float] = pydantic.Field(default=None)
43
+ """
44
+ Total amount including tax (in smallest currency unit)
45
+ """
46
+
47
+ amount_paid: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="amountPaid")] = (
48
+ pydantic.Field(default=None)
49
+ )
50
+ """
51
+ Amount already paid (in smallest currency unit)
52
+ """
53
+
54
+ amount_due: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="amountDue")] = pydantic.Field(
55
+ default=None
56
+ )
57
+ """
58
+ Amount still due (in smallest currency unit)
59
+ """
60
+
61
+ due_date: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="dueDate")] = None
62
+ paid_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="paidAt")] = None
63
+ voided_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="voidedAt")] = None
64
+ created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
65
+ updated_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="updatedAt")] = None
66
+ customer: typing.Optional[Customer] = None
67
+
68
+ if IS_PYDANTIC_V2:
69
+ model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
70
+ else:
71
+
72
+ class Config:
73
+ frozen = True
74
+ smart_union = True
75
+ extra = pydantic.Extra.allow
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+
5
+ InvoiceStatus = typing.Union[typing.Literal["draft", "open", "paid", "void", "uncollectible"], typing.Any]