paid-python 1.0.0a0__py3-none-any.whl → 1.0.0a2__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.
- paid/__init__.py +61 -122
- paid/client.py +16 -22
- paid/contacts/client.py +417 -133
- paid/contacts/raw_client.py +1048 -118
- paid/core/client_wrapper.py +8 -10
- paid/customers/__init__.py +0 -3
- paid/customers/client.py +394 -1112
- paid/customers/raw_client.py +656 -1054
- paid/environment.py +1 -1
- paid/errors/bad_request_error.py +2 -2
- paid/errors/forbidden_error.py +2 -2
- paid/errors/internal_server_error.py +2 -2
- paid/errors/not_found_error.py +2 -2
- paid/invoices/client.py +369 -0
- paid/{plans → invoices}/raw_client.py +312 -201
- paid/orders/__init__.py +0 -3
- paid/orders/client.py +281 -471
- paid/orders/raw_client.py +552 -537
- paid/products/__init__.py +0 -3
- paid/products/client.py +129 -265
- paid/products/raw_client.py +565 -233
- paid/signals/client.py +130 -0
- paid/signals/raw_client.py +190 -0
- paid/tracing/autoinstrumentation.py +12 -6
- paid/tracing/context_manager.py +2 -6
- paid/tracing/distributed_tracing.py +3 -3
- paid/tracing/signal.py +3 -3
- paid/tracing/wrappers/openai_agents/openaiAgentsHook.py +1 -1
- paid/types/__init__.py +58 -110
- paid/types/attribution.py +8 -0
- paid/types/{agent_attribute.py → bulk_signals_response.py} +4 -5
- paid/types/contact.py +12 -20
- paid/types/{address.py → contact_billing_address.py} +6 -7
- paid/types/{traces_response.py → contact_list_response.py} +5 -9
- paid/types/customer.py +15 -22
- paid/types/customer_attribution.py +8 -0
- paid/types/customer_billing_address.py +26 -0
- paid/types/{usage_summary_order.py → customer_by_external_id.py} +3 -5
- paid/types/{usage_summary_order_line.py → customer_by_id.py} +3 -5
- paid/types/customer_creation_state.py +5 -0
- paid/types/customer_list_response.py +22 -0
- paid/types/empty_response.py +17 -0
- paid/types/{error.py → error_response.py} +4 -7
- paid/types/invoice.py +33 -51
- paid/types/invoice_line.py +42 -0
- paid/types/invoice_line_payment_status.py +7 -0
- paid/types/invoice_lines_response.py +22 -0
- paid/types/invoice_list_response.py +22 -0
- paid/types/invoice_payment_status.py +5 -0
- paid/types/invoice_source.py +5 -0
- paid/types/invoice_status.py +3 -1
- paid/types/invoice_tax_status.py +7 -0
- paid/types/order.py +30 -29
- paid/types/order_creation_state.py +5 -0
- paid/types/order_line.py +6 -24
- paid/types/order_lines_response.py +22 -0
- paid/types/order_list_response.py +22 -0
- paid/types/pagination.py +24 -0
- paid/types/product.py +4 -29
- paid/types/{tier.py → product_by_external_id.py} +5 -4
- paid/types/{cost_amount.py → product_by_id.py} +5 -12
- paid/types/product_list_response.py +22 -0
- paid/types/signal.py +8 -34
- paid/types/{agent_update.py → update_contact_request.py} +10 -9
- paid/types/update_customer_request.py +38 -0
- paid/types/{product_update.py → update_product_request.py} +2 -12
- {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a2.dist-info}/METADATA +23 -8
- paid_python-1.0.0a2.dist-info/RECORD +110 -0
- paid/agents/client.py +0 -880
- paid/agents/raw_client.py +0 -785
- paid/customers/types/__init__.py +0 -8
- paid/customers/types/customers_check_entitlement_request_view.py +0 -5
- paid/customers/types/customers_check_entitlement_response.py +0 -22
- paid/orders/lines/client.py +0 -144
- paid/orders/lines/raw_client.py +0 -129
- paid/plans/__init__.py +0 -4
- paid/plans/client.py +0 -403
- paid/products/types/__init__.py +0 -7
- paid/products/types/product_create_type.py +0 -5
- paid/traces/__init__.py +0 -4
- paid/traces/client.py +0 -218
- paid/traces/raw_client.py +0 -226
- paid/types/agent.py +0 -31
- paid/types/agent_price_point.py +0 -27
- paid/types/agent_price_point_tiers.py +0 -23
- paid/types/api_error.py +0 -29
- paid/types/billing_frequency.py +0 -5
- paid/types/cancel_renewal_response.py +0 -49
- paid/types/charge_type.py +0 -5
- paid/types/contact_create_for_customer.py +0 -37
- paid/types/cost_trace.py +0 -55
- paid/types/cost_traces_response.py +0 -26
- paid/types/creation_source.py +0 -5
- paid/types/creation_state.py +0 -5
- paid/types/customer_update.py +0 -40
- paid/types/entitlement_usage.py +0 -48
- paid/types/order_line_attribute.py +0 -27
- paid/types/order_line_attribute_create_one.py +0 -5
- paid/types/order_line_attribute_pricing.py +0 -33
- paid/types/order_line_create.py +0 -72
- paid/types/pagination_meta.py +0 -84
- paid/types/payment_method.py +0 -58
- paid/types/payment_method_card.py +0 -49
- paid/types/payment_method_type.py +0 -5
- paid/types/payment_method_us_bank_account.py +0 -36
- paid/types/payment_method_us_bank_account_account_type.py +0 -5
- paid/types/plan.py +0 -81
- paid/types/plan_group.py +0 -60
- paid/types/plan_plan_products_item.py +0 -41
- paid/types/plan_plan_products_item_plan_product_attribute_item.py +0 -34
- paid/types/plan_with_features.py +0 -69
- paid/types/plan_with_features_features_item.py +0 -34
- paid/types/price_point.py +0 -25
- paid/types/pricing.py +0 -31
- paid/types/pricing_model_type.py +0 -7
- paid/types/product_type.py +0 -5
- paid/types/product_update_type.py +0 -5
- paid/types/proration_attribute_update.py +0 -44
- paid/types/proration_detail.py +0 -49
- paid/types/proration_upgrade_response.py +0 -73
- paid/types/salutation.py +0 -5
- paid/types/signal_v_2.py +0 -56
- paid/types/tax_exempt_status.py +0 -5
- paid/types/trace.py +0 -69
- paid/types/usage_pagination_meta.py +0 -43
- paid/types/usage_summaries_response.py +0 -26
- paid/types/usage_summary.py +0 -121
- paid/usage/__init__.py +0 -7
- paid/usage/client.py +0 -321
- paid/usage/raw_client.py +0 -387
- paid/usage/types/__init__.py +0 -7
- paid/usage/types/usage_check_usage_response.py +0 -53
- paid_python-1.0.0a0.dist-info/RECORD +0 -152
- /paid/{agents → invoices}/__init__.py +0 -0
- /paid/{orders/lines → signals}/__init__.py +0 -0
- {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a2.dist-info}/LICENSE +0 -0
- {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a2.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
|
paid/types/pricing_model_type.py
DELETED
paid/types/product_type.py
DELETED
|
@@ -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
|
paid/types/proration_detail.py
DELETED
|
@@ -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
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
|
paid/types/tax_exempt_status.py
DELETED
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
|
paid/types/usage_summary.py
DELETED
|
@@ -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
|