paid-python 1.0.0a0__py3-none-any.whl → 1.0.0a1__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 (137) hide show
  1. paid/__init__.py +61 -122
  2. paid/client.py +16 -22
  3. paid/contacts/client.py +415 -133
  4. paid/contacts/raw_client.py +1046 -118
  5. paid/core/client_wrapper.py +8 -10
  6. paid/customers/__init__.py +0 -3
  7. paid/customers/client.py +392 -1112
  8. paid/customers/raw_client.py +656 -1054
  9. paid/environment.py +1 -1
  10. paid/errors/bad_request_error.py +2 -2
  11. paid/errors/forbidden_error.py +2 -2
  12. paid/errors/internal_server_error.py +2 -2
  13. paid/errors/not_found_error.py +2 -2
  14. paid/invoices/client.py +369 -0
  15. paid/{plans → invoices}/raw_client.py +310 -201
  16. paid/orders/__init__.py +0 -3
  17. paid/orders/client.py +279 -471
  18. paid/orders/raw_client.py +551 -538
  19. paid/products/__init__.py +0 -3
  20. paid/products/client.py +129 -265
  21. paid/products/raw_client.py +563 -233
  22. paid/signals/client.py +130 -0
  23. paid/signals/raw_client.py +190 -0
  24. paid/tracing/autoinstrumentation.py +12 -6
  25. paid/tracing/context_manager.py +2 -6
  26. paid/tracing/distributed_tracing.py +3 -3
  27. paid/tracing/signal.py +3 -3
  28. paid/tracing/wrappers/openai_agents/openaiAgentsHook.py +1 -1
  29. paid/types/__init__.py +58 -110
  30. paid/types/attribution.py +8 -0
  31. paid/types/{agent_attribute.py → bulk_signals_response.py} +4 -5
  32. paid/types/contact.py +12 -20
  33. paid/types/{address.py → contact_billing_address.py} +6 -7
  34. paid/types/{traces_response.py → contact_list_response.py} +5 -9
  35. paid/types/customer.py +15 -22
  36. paid/types/customer_attribution.py +8 -0
  37. paid/types/customer_billing_address.py +26 -0
  38. paid/types/{usage_summary_order.py → customer_by_external_id.py} +3 -5
  39. paid/types/{usage_summary_order_line.py → customer_by_id.py} +3 -5
  40. paid/types/customer_creation_state.py +5 -0
  41. paid/types/customer_list_response.py +22 -0
  42. paid/types/empty_response.py +17 -0
  43. paid/types/{error.py → error_response.py} +4 -7
  44. paid/types/invoice.py +33 -51
  45. paid/types/invoice_line.py +42 -0
  46. paid/types/invoice_line_payment_status.py +7 -0
  47. paid/types/invoice_lines_response.py +22 -0
  48. paid/types/invoice_list_response.py +22 -0
  49. paid/types/invoice_payment_status.py +5 -0
  50. paid/types/invoice_source.py +5 -0
  51. paid/types/invoice_status.py +3 -1
  52. paid/types/invoice_tax_status.py +7 -0
  53. paid/types/order.py +30 -29
  54. paid/types/order_creation_state.py +5 -0
  55. paid/types/order_line.py +6 -24
  56. paid/types/order_lines_response.py +22 -0
  57. paid/types/order_list_response.py +22 -0
  58. paid/types/pagination.py +24 -0
  59. paid/types/product.py +4 -29
  60. paid/types/{tier.py → product_by_external_id.py} +5 -4
  61. paid/types/{cost_amount.py → product_by_id.py} +5 -12
  62. paid/types/product_list_response.py +22 -0
  63. paid/types/signal.py +8 -34
  64. paid/types/{agent_update.py → update_contact_request.py} +10 -9
  65. paid/types/update_customer_request.py +38 -0
  66. paid/types/{product_update.py → update_product_request.py} +2 -12
  67. {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a1.dist-info}/METADATA +22 -8
  68. paid_python-1.0.0a1.dist-info/RECORD +110 -0
  69. paid/agents/client.py +0 -880
  70. paid/agents/raw_client.py +0 -785
  71. paid/customers/types/__init__.py +0 -8
  72. paid/customers/types/customers_check_entitlement_request_view.py +0 -5
  73. paid/customers/types/customers_check_entitlement_response.py +0 -22
  74. paid/orders/lines/client.py +0 -144
  75. paid/orders/lines/raw_client.py +0 -129
  76. paid/plans/__init__.py +0 -4
  77. paid/plans/client.py +0 -403
  78. paid/products/types/__init__.py +0 -7
  79. paid/products/types/product_create_type.py +0 -5
  80. paid/traces/__init__.py +0 -4
  81. paid/traces/client.py +0 -218
  82. paid/traces/raw_client.py +0 -226
  83. paid/types/agent.py +0 -31
  84. paid/types/agent_price_point.py +0 -27
  85. paid/types/agent_price_point_tiers.py +0 -23
  86. paid/types/api_error.py +0 -29
  87. paid/types/billing_frequency.py +0 -5
  88. paid/types/cancel_renewal_response.py +0 -49
  89. paid/types/charge_type.py +0 -5
  90. paid/types/contact_create_for_customer.py +0 -37
  91. paid/types/cost_trace.py +0 -55
  92. paid/types/cost_traces_response.py +0 -26
  93. paid/types/creation_source.py +0 -5
  94. paid/types/creation_state.py +0 -5
  95. paid/types/customer_update.py +0 -40
  96. paid/types/entitlement_usage.py +0 -48
  97. paid/types/order_line_attribute.py +0 -27
  98. paid/types/order_line_attribute_create_one.py +0 -5
  99. paid/types/order_line_attribute_pricing.py +0 -33
  100. paid/types/order_line_create.py +0 -72
  101. paid/types/pagination_meta.py +0 -84
  102. paid/types/payment_method.py +0 -58
  103. paid/types/payment_method_card.py +0 -49
  104. paid/types/payment_method_type.py +0 -5
  105. paid/types/payment_method_us_bank_account.py +0 -36
  106. paid/types/payment_method_us_bank_account_account_type.py +0 -5
  107. paid/types/plan.py +0 -81
  108. paid/types/plan_group.py +0 -60
  109. paid/types/plan_plan_products_item.py +0 -41
  110. paid/types/plan_plan_products_item_plan_product_attribute_item.py +0 -34
  111. paid/types/plan_with_features.py +0 -69
  112. paid/types/plan_with_features_features_item.py +0 -34
  113. paid/types/price_point.py +0 -25
  114. paid/types/pricing.py +0 -31
  115. paid/types/pricing_model_type.py +0 -7
  116. paid/types/product_type.py +0 -5
  117. paid/types/product_update_type.py +0 -5
  118. paid/types/proration_attribute_update.py +0 -44
  119. paid/types/proration_detail.py +0 -49
  120. paid/types/proration_upgrade_response.py +0 -73
  121. paid/types/salutation.py +0 -5
  122. paid/types/signal_v_2.py +0 -56
  123. paid/types/tax_exempt_status.py +0 -5
  124. paid/types/trace.py +0 -69
  125. paid/types/usage_pagination_meta.py +0 -43
  126. paid/types/usage_summaries_response.py +0 -26
  127. paid/types/usage_summary.py +0 -121
  128. paid/usage/__init__.py +0 -7
  129. paid/usage/client.py +0 -321
  130. paid/usage/raw_client.py +0 -387
  131. paid/usage/types/__init__.py +0 -7
  132. paid/usage/types/usage_check_usage_response.py +0 -53
  133. paid_python-1.0.0a0.dist-info/RECORD +0 -152
  134. /paid/{agents → invoices}/__init__.py +0 -0
  135. /paid/{orders/lines → signals}/__init__.py +0 -0
  136. {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a1.dist-info}/LICENSE +0 -0
  137. {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a1.dist-info}/WHEEL +0 -0
paid/types/price_point.py DELETED
@@ -1,25 +0,0 @@
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 .tier import Tier
10
-
11
-
12
- class PricePoint(UniversalBaseModel):
13
- currency: typing.Optional[str] = None
14
- unit_price: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="unitPrice")] = None
15
- min_quantity: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="minQuantity")] = None
16
- tiers: typing.Optional[typing.List[Tier]] = None
17
-
18
- if IS_PYDANTIC_V2:
19
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
20
- else:
21
-
22
- class Config:
23
- frozen = True
24
- smart_union = True
25
- extra = pydantic.Extra.allow
paid/types/pricing.py DELETED
@@ -1,31 +0,0 @@
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 .agent_price_point import AgentPricePoint
10
- from .billing_frequency import BillingFrequency
11
- from .charge_type import ChargeType
12
- from .pricing_model_type import PricingModelType
13
-
14
-
15
- class Pricing(UniversalBaseModel):
16
- event_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="eventName")] = None
17
- taxable: bool
18
- credit_cost: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="creditCost")] = None
19
- charge_type: typing_extensions.Annotated[ChargeType, FieldMetadata(alias="chargeType")]
20
- pricing_model: typing_extensions.Annotated[PricingModelType, FieldMetadata(alias="pricingModel")]
21
- billing_frequency: typing_extensions.Annotated[BillingFrequency, FieldMetadata(alias="billingFrequency")]
22
- price_points: typing_extensions.Annotated[typing.Dict[str, AgentPricePoint], FieldMetadata(alias="pricePoints")]
23
-
24
- if IS_PYDANTIC_V2:
25
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
26
- else:
27
-
28
- class Config:
29
- frozen = True
30
- smart_union = True
31
- extra = pydantic.Extra.allow
@@ -1,7 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- PricingModelType = typing.Union[
6
- typing.Literal["PerUnit", "VolumePricing", "GraduatedPricing", "PrepaidCredits"], typing.Any
7
- ]
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- ProductType = typing.Union[typing.Literal["agent", "product", "prepaidCreditBundle"], typing.Any]
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- ProductUpdateType = typing.Union[typing.Literal["agent", "product", "prepaidCreditBundle"], typing.Any]
@@ -1,44 +0,0 @@
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
-
10
-
11
- class ProrationAttributeUpdate(UniversalBaseModel):
12
- """
13
- An attribute update for a proration upgrade
14
- """
15
-
16
- order_line_attribute_id: typing_extensions.Annotated[str, FieldMetadata(alias="orderLineAttributeId")] = (
17
- pydantic.Field()
18
- )
19
- """
20
- The ID of the order line attribute to update
21
- """
22
-
23
- new_pricing: typing_extensions.Annotated[
24
- typing.Dict[str, typing.Optional[typing.Any]], FieldMetadata(alias="newPricing")
25
- ] = pydantic.Field()
26
- """
27
- The new pricing configuration
28
- """
29
-
30
- new_quantity: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="newQuantity")] = (
31
- pydantic.Field(default=None)
32
- )
33
- """
34
- Optional new quantity for the attribute
35
- """
36
-
37
- if IS_PYDANTIC_V2:
38
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
39
- else:
40
-
41
- class Config:
42
- frozen = True
43
- smart_union = True
44
- extra = pydantic.Extra.allow
@@ -1,49 +0,0 @@
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
-
10
-
11
- class ProrationDetail(UniversalBaseModel):
12
- """
13
- Details about the proration calculation for an attribute
14
- """
15
-
16
- old_attribute_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="oldAttributeId")] = None
17
- new_attribute_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="newAttributeId")] = None
18
- credit_line_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="creditLineId")] = None
19
- old_price: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="oldPrice")] = None
20
- new_price: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="newPrice")] = None
21
- credit_amount: typing_extensions.Annotated[typing.Optional[float], FieldMetadata(alias="creditAmount")] = (
22
- pydantic.Field(default=None)
23
- )
24
- """
25
- The credit amount applied for the unused portion
26
- """
27
-
28
- remaining_days: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="remainingDays")] = (
29
- pydantic.Field(default=None)
30
- )
31
- """
32
- Number of days remaining in the current billing cycle
33
- """
34
-
35
- total_days_in_cycle: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="totalDaysInCycle")] = (
36
- pydantic.Field(default=None)
37
- )
38
- """
39
- Total number of days in the billing cycle
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
@@ -1,73 +0,0 @@
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 .proration_detail import ProrationDetail
11
-
12
-
13
- class ProrationUpgradeResponse(UniversalBaseModel):
14
- """
15
- Response after successfully scheduling a plan change
16
- """
17
-
18
- order_id: typing_extensions.Annotated[str, FieldMetadata(alias="orderId")] = pydantic.Field()
19
- """
20
- The ID of the order
21
- """
22
-
23
- amendment_id: typing_extensions.Annotated[str, FieldMetadata(alias="amendmentId")] = pydantic.Field()
24
- """
25
- The ID of the amendment record
26
- """
27
-
28
- version: int = pydantic.Field()
29
- """
30
- The new version of the order after the amendment
31
- """
32
-
33
- effective_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="effectiveDate")] = pydantic.Field()
34
- """
35
- The effective date of the plan change
36
- """
37
-
38
- ended_line_ids: typing_extensions.Annotated[typing.List[str], FieldMetadata(alias="endedLineIds")] = (
39
- pydantic.Field()
40
- )
41
- """
42
- IDs of order lines that were ended
43
- """
44
-
45
- created_line_ids: typing_extensions.Annotated[typing.List[str], FieldMetadata(alias="createdLineIds")] = (
46
- pydantic.Field()
47
- )
48
- """
49
- IDs of new order lines that were created
50
- """
51
-
52
- credit_line_ids: typing_extensions.Annotated[typing.List[str], FieldMetadata(alias="creditLineIds")] = (
53
- pydantic.Field()
54
- )
55
- """
56
- IDs of credit lines that were created
57
- """
58
-
59
- proration_details: typing_extensions.Annotated[
60
- typing.List[ProrationDetail], FieldMetadata(alias="prorationDetails")
61
- ] = pydantic.Field()
62
- """
63
- Detailed proration calculations for each updated attribute
64
- """
65
-
66
- if IS_PYDANTIC_V2:
67
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
68
- else:
69
-
70
- class Config:
71
- frozen = True
72
- smart_union = True
73
- extra = pydantic.Extra.allow
paid/types/salutation.py DELETED
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- Salutation = typing.Union[typing.Literal["Mr.", "Mrs.", "Miss", "Ms.", "Dr.", "Prof."], typing.Any]
paid/types/signal_v_2.py DELETED
@@ -1,56 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- import pydantic
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
-
8
-
9
- class SignalV2(UniversalBaseModel):
10
- """
11
- V2 signal schema with clean field names. IMPORTANT: Exactly one customer ID field (customer_id OR external_customer_id) and exactly one product ID field (product_id OR external_product_id) must be provided per signal.
12
- """
13
-
14
- event_name: str = pydantic.Field()
15
- """
16
- The name of the event being tracked
17
- """
18
-
19
- product_id: typing.Optional[str] = pydantic.Field(default=None)
20
- """
21
- Paid's display ID for the product (e.g., prod_abc123). Cannot be used with external_product_id. Either this or external_product_id is required.
22
- """
23
-
24
- external_product_id: typing.Optional[str] = pydantic.Field(default=None)
25
- """
26
- Your system's product ID. Cannot be used with product_id. Either this or product_id is required.
27
- """
28
-
29
- customer_id: typing.Optional[str] = pydantic.Field(default=None)
30
- """
31
- Paid's display ID for the customer (e.g., cus_xyz789). Cannot be used with external_customer_id. Either this or external_customer_id is required.
32
- """
33
-
34
- external_customer_id: typing.Optional[str] = pydantic.Field(default=None)
35
- """
36
- Your system's customer ID. Cannot be used with customer_id. Either this or customer_id is required.
37
- """
38
-
39
- data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
40
- """
41
- Optional additional data/metadata for the signal
42
- """
43
-
44
- idempotency_key: typing.Optional[str] = pydantic.Field(default=None)
45
- """
46
- A unique key to ensure idempotent signal processing
47
- """
48
-
49
- if IS_PYDANTIC_V2:
50
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
51
- else:
52
-
53
- class Config:
54
- frozen = True
55
- smart_union = True
56
- extra = pydantic.Extra.allow
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- TaxExemptStatus = typing.Union[typing.Literal["none", "exempt", "reverse"], typing.Any]
paid/types/trace.py DELETED
@@ -1,69 +0,0 @@
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 .cost_amount import CostAmount
10
-
11
-
12
- class Trace(UniversalBaseModel):
13
- """
14
- A single cost trace record with customer and product info
15
- """
16
-
17
- name: str = pydantic.Field()
18
- """
19
- The name/type of the operation (e.g., "trace.openai.agents.on_agent")
20
- """
21
-
22
- vendor: str = pydantic.Field()
23
- """
24
- The vendor/provider (e.g., "openai", "anthropic", "mistral")
25
- """
26
-
27
- model: str = pydantic.Field()
28
- """
29
- The model used for the operation (e.g., "gpt-4o-mini", "claude-3-sonnet")
30
- """
31
-
32
- cost: CostAmount
33
- start_time_unix_nano: typing_extensions.Annotated[str, FieldMetadata(alias="startTimeUnixNano")] = pydantic.Field()
34
- """
35
- Unix timestamp in nanoseconds when the operation started
36
- """
37
-
38
- end_time_unix_nano: typing_extensions.Annotated[str, FieldMetadata(alias="endTimeUnixNano")] = pydantic.Field()
39
- """
40
- Unix timestamp in nanoseconds when the operation completed
41
- """
42
-
43
- attributes: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
44
- """
45
- Additional metadata about the trace (e.g., tokens, etc.)
46
- """
47
-
48
- customer_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="customerId")] = pydantic.Field(
49
- default=None
50
- )
51
- """
52
- The internal customer ID associated with this trace
53
- """
54
-
55
- product_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="productId")] = pydantic.Field(
56
- default=None
57
- )
58
- """
59
- The product/agent ID associated with this trace (optional)
60
- """
61
-
62
- if IS_PYDANTIC_V2:
63
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
64
- else:
65
-
66
- class Config:
67
- frozen = True
68
- smart_union = True
69
- extra = pydantic.Extra.allow
@@ -1,43 +0,0 @@
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
-
10
-
11
- class UsagePaginationMeta(UniversalBaseModel):
12
- """
13
- Pagination metadata for usage summaries
14
- """
15
-
16
- limit: int = pydantic.Field()
17
- """
18
- The requested limit
19
- """
20
-
21
- offset: int = pydantic.Field()
22
- """
23
- The requested offset
24
- """
25
-
26
- total: int = pydantic.Field()
27
- """
28
- Total number of usage summaries available
29
- """
30
-
31
- has_more: typing_extensions.Annotated[bool, FieldMetadata(alias="hasMore")] = pydantic.Field()
32
- """
33
- Whether there are more results available
34
- """
35
-
36
- if IS_PYDANTIC_V2:
37
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
38
- else:
39
-
40
- class Config:
41
- frozen = True
42
- smart_union = True
43
- extra = pydantic.Extra.allow
@@ -1,26 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- import pydantic
6
- from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
7
- from .usage_pagination_meta import UsagePaginationMeta
8
- from .usage_summary import UsageSummary
9
-
10
-
11
- class UsageSummariesResponse(UniversalBaseModel):
12
- """
13
- Response containing usage summaries and pagination metadata
14
- """
15
-
16
- data: typing.List[UsageSummary]
17
- pagination: UsagePaginationMeta
18
-
19
- if IS_PYDANTIC_V2:
20
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
21
- else:
22
-
23
- class Config:
24
- frozen = True
25
- smart_union = True
26
- extra = pydantic.Extra.allow
@@ -1,121 +0,0 @@
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 .usage_summary_order import UsageSummaryOrder
11
- from .usage_summary_order_line import UsageSummaryOrderLine
12
-
13
-
14
- class UsageSummary(UniversalBaseModel):
15
- """
16
- A single usage summary record
17
- """
18
-
19
- id: str = pydantic.Field()
20
- """
21
- The unique identifier of the usage summary
22
- """
23
-
24
- event_name: typing_extensions.Annotated[str, FieldMetadata(alias="eventName")] = pydantic.Field()
25
- """
26
- The name of the event being tracked
27
- """
28
-
29
- events_quantity: typing_extensions.Annotated[int, FieldMetadata(alias="eventsQuantity")] = pydantic.Field()
30
- """
31
- The quantity of events in this usage period
32
- """
33
-
34
- start_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="startDate")] = pydantic.Field()
35
- """
36
- The start date of the usage period
37
- """
38
-
39
- end_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="endDate")] = pydantic.Field()
40
- """
41
- The end date of the usage period
42
- """
43
-
44
- subtotal: int = pydantic.Field()
45
- """
46
- The subtotal amount in the smallest currency unit (e.g., cents)
47
- """
48
-
49
- next_billing_date: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="nextBillingDate")] = (
50
- pydantic.Field()
51
- )
52
- """
53
- The next billing date for this usage
54
- """
55
-
56
- customer_id: typing_extensions.Annotated[str, FieldMetadata(alias="customerId")] = pydantic.Field()
57
- """
58
- The internal customer ID
59
- """
60
-
61
- order_id: typing_extensions.Annotated[str, FieldMetadata(alias="orderId")] = pydantic.Field()
62
- """
63
- The order ID associated with this usage
64
- """
65
-
66
- order_line_id: typing_extensions.Annotated[str, FieldMetadata(alias="orderLineId")] = pydantic.Field()
67
- """
68
- The order line ID associated with this usage
69
- """
70
-
71
- order_line_attribute_id: typing_extensions.Annotated[str, FieldMetadata(alias="orderLineAttributeId")] = (
72
- pydantic.Field()
73
- )
74
- """
75
- The order line attribute ID associated with this usage
76
- """
77
-
78
- invoice_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="invoiceId")] = pydantic.Field(
79
- default=None
80
- )
81
- """
82
- The invoice ID if this usage has been invoiced
83
- """
84
-
85
- invoice_line_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="invoiceLineId")] = (
86
- pydantic.Field(default=None)
87
- )
88
- """
89
- The invoice line ID if this usage has been invoiced
90
- """
91
-
92
- created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field()
93
- """
94
- When the usage summary was created
95
- """
96
-
97
- updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field()
98
- """
99
- When the usage summary was last updated
100
- """
101
-
102
- order: typing.Optional[UsageSummaryOrder] = pydantic.Field(default=None)
103
- """
104
- Associated order information
105
- """
106
-
107
- order_line: typing_extensions.Annotated[
108
- typing.Optional[UsageSummaryOrderLine], FieldMetadata(alias="orderLine")
109
- ] = pydantic.Field(default=None)
110
- """
111
- Associated order line information
112
- """
113
-
114
- if IS_PYDANTIC_V2:
115
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
116
- else:
117
-
118
- class Config:
119
- frozen = True
120
- smart_union = True
121
- extra = pydantic.Extra.allow
paid/usage/__init__.py DELETED
@@ -1,7 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- # isort: skip_file
4
-
5
- from .types import UsageCheckUsageResponse
6
-
7
- __all__ = ["UsageCheckUsageResponse"]