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.
- paid/__init__.py +33 -0
- paid/client.py +1 -472
- paid/core/client_wrapper.py +3 -2
- paid/customers/__init__.py +3 -0
- paid/customers/client.py +428 -4
- paid/customers/raw_client.py +594 -2
- paid/customers/types/__init__.py +8 -0
- paid/customers/types/customers_check_entitlement_request_view.py +5 -0
- paid/customers/types/customers_check_entitlement_response.py +22 -0
- paid/orders/client.py +445 -0
- paid/orders/raw_client.py +705 -0
- paid/plans/client.py +142 -0
- paid/plans/raw_client.py +238 -0
- paid/types/__init__.py +30 -0
- paid/types/cancel_renewal_response.py +49 -0
- paid/types/contact_create_for_customer.py +37 -0
- paid/types/invoice.py +75 -0
- paid/types/invoice_status.py +5 -0
- paid/types/payment_method.py +58 -0
- paid/types/payment_method_card.py +49 -0
- paid/types/payment_method_type.py +5 -0
- paid/types/payment_method_us_bank_account.py +36 -0
- paid/types/payment_method_us_bank_account_account_type.py +5 -0
- paid/types/plan_group.py +60 -0
- paid/types/plan_plan_products_item.py +6 -0
- paid/types/plan_with_features.py +69 -0
- paid/types/plan_with_features_features_item.py +34 -0
- paid/types/proration_attribute_update.py +44 -0
- paid/types/proration_detail.py +49 -0
- paid/types/proration_upgrade_response.py +73 -0
- paid/types/signal_v_2.py +5 -5
- paid/usage/client.py +6 -6
- {paid_python-0.5.0.dist-info → paid_python-1.0.0a0.dist-info}/METADATA +6 -4
- {paid_python-0.5.0.dist-info → paid_python-1.0.0a0.dist-info}/RECORD +36 -36
- opentelemetry/instrumentation/openai/__init__.py +0 -54
- opentelemetry/instrumentation/openai/shared/__init__.py +0 -399
- opentelemetry/instrumentation/openai/shared/audio_wrappers.py +0 -247
- opentelemetry/instrumentation/openai/shared/chat_wrappers.py +0 -1192
- opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -292
- opentelemetry/instrumentation/openai/shared/config.py +0 -15
- opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +0 -311
- opentelemetry/instrumentation/openai/shared/event_emitter.py +0 -108
- opentelemetry/instrumentation/openai/shared/event_models.py +0 -41
- opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -68
- opentelemetry/instrumentation/openai/shared/span_utils.py +0 -0
- opentelemetry/instrumentation/openai/utils.py +0 -213
- opentelemetry/instrumentation/openai/v0/__init__.py +0 -176
- opentelemetry/instrumentation/openai/v1/__init__.py +0 -394
- opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -329
- opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +0 -134
- opentelemetry/instrumentation/openai/v1/responses_wrappers.py +0 -1113
- opentelemetry/instrumentation/openai/version.py +0 -1
- {paid_python-0.5.0.dist-info → paid_python-1.0.0a0.dist-info}/LICENSE +0 -0
- {paid_python-0.5.0.dist-info → paid_python-1.0.0a0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
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 .payment_method_card import PaymentMethodCard
|
|
11
|
+
from .payment_method_type import PaymentMethodType
|
|
12
|
+
from .payment_method_us_bank_account import PaymentMethodUsBankAccount
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class PaymentMethod(UniversalBaseModel):
|
|
16
|
+
"""
|
|
17
|
+
A customer's payment method
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
id: typing.Optional[str] = pydantic.Field(default=None)
|
|
21
|
+
"""
|
|
22
|
+
The payment method ID (typically from Stripe)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
type: typing.Optional[PaymentMethodType] = pydantic.Field(default=None)
|
|
26
|
+
"""
|
|
27
|
+
The type of payment method
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
card: typing.Optional[PaymentMethodCard] = pydantic.Field(default=None)
|
|
31
|
+
"""
|
|
32
|
+
Card details (present when type is 'card')
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
us_bank_account: typing_extensions.Annotated[
|
|
36
|
+
typing.Optional[PaymentMethodUsBankAccount], FieldMetadata(alias="usBankAccount")
|
|
37
|
+
] = pydantic.Field(default=None)
|
|
38
|
+
"""
|
|
39
|
+
US bank account details (present when type is 'us_bank_account')
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
is_default: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="isDefault")] = pydantic.Field(
|
|
43
|
+
default=None
|
|
44
|
+
)
|
|
45
|
+
"""
|
|
46
|
+
Whether this is the customer's default payment method
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
|
|
50
|
+
|
|
51
|
+
if IS_PYDANTIC_V2:
|
|
52
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
53
|
+
else:
|
|
54
|
+
|
|
55
|
+
class Config:
|
|
56
|
+
frozen = True
|
|
57
|
+
smart_union = True
|
|
58
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,49 @@
|
|
|
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 PaymentMethodCard(UniversalBaseModel):
|
|
12
|
+
"""
|
|
13
|
+
Card details (present when type is 'card')
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
brand: typing.Optional[str] = pydantic.Field(default=None)
|
|
17
|
+
"""
|
|
18
|
+
Card brand (visa, mastercard, amex, etc.)
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
last_4: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="last4")] = pydantic.Field(
|
|
22
|
+
default=None
|
|
23
|
+
)
|
|
24
|
+
"""
|
|
25
|
+
Last 4 digits of the card number
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
exp_month: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="expMonth")] = pydantic.Field(
|
|
29
|
+
default=None
|
|
30
|
+
)
|
|
31
|
+
"""
|
|
32
|
+
Expiration month (1-12)
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
exp_year: typing_extensions.Annotated[typing.Optional[int], FieldMetadata(alias="expYear")] = pydantic.Field(
|
|
36
|
+
default=None
|
|
37
|
+
)
|
|
38
|
+
"""
|
|
39
|
+
Expiration year
|
|
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,36 @@
|
|
|
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 .payment_method_us_bank_account_account_type import PaymentMethodUsBankAccountAccountType
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PaymentMethodUsBankAccount(UniversalBaseModel):
|
|
13
|
+
"""
|
|
14
|
+
US bank account details (present when type is 'us_bank_account')
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
bank_name: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="bankName")] = None
|
|
18
|
+
last_4: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="last4")] = pydantic.Field(
|
|
19
|
+
default=None
|
|
20
|
+
)
|
|
21
|
+
"""
|
|
22
|
+
Last 4 digits of the account number
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
account_type: typing_extensions.Annotated[
|
|
26
|
+
typing.Optional[PaymentMethodUsBankAccountAccountType], FieldMetadata(alias="accountType")
|
|
27
|
+
] = None
|
|
28
|
+
|
|
29
|
+
if IS_PYDANTIC_V2:
|
|
30
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
31
|
+
else:
|
|
32
|
+
|
|
33
|
+
class Config:
|
|
34
|
+
frozen = True
|
|
35
|
+
smart_union = True
|
|
36
|
+
extra = pydantic.Extra.allow
|
paid/types/plan_group.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
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 .plan import Plan
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PlanGroup(UniversalBaseModel):
|
|
14
|
+
"""
|
|
15
|
+
A plan group containing multiple plans
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
id: str = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
The unique identifier of the plan group
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
organization_id: typing_extensions.Annotated[str, FieldMetadata(alias="organizationId")] = pydantic.Field()
|
|
24
|
+
"""
|
|
25
|
+
The organization ID that owns this plan group
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
name: str = pydantic.Field()
|
|
29
|
+
"""
|
|
30
|
+
The name of the plan group
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
34
|
+
"""
|
|
35
|
+
The description of the plan group
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field()
|
|
39
|
+
"""
|
|
40
|
+
When the plan group was created
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field()
|
|
44
|
+
"""
|
|
45
|
+
When the plan group was last updated
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
plans: typing.Optional[typing.List[Plan]] = pydantic.Field(default=None)
|
|
49
|
+
"""
|
|
50
|
+
The plans included in this plan group
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
if IS_PYDANTIC_V2:
|
|
54
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
55
|
+
else:
|
|
56
|
+
|
|
57
|
+
class Config:
|
|
58
|
+
frozen = True
|
|
59
|
+
smart_union = True
|
|
60
|
+
extra = pydantic.Extra.allow
|
|
@@ -8,6 +8,7 @@ import typing_extensions
|
|
|
8
8
|
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
9
|
from ..core.serialization import FieldMetadata
|
|
10
10
|
from .plan_plan_products_item_plan_product_attribute_item import PlanPlanProductsItemPlanProductAttributeItem
|
|
11
|
+
from .product import Product
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class PlanPlanProductsItem(UniversalBaseModel):
|
|
@@ -17,6 +18,11 @@ class PlanPlanProductsItem(UniversalBaseModel):
|
|
|
17
18
|
product_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="productId")] = None
|
|
18
19
|
created_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="createdAt")] = None
|
|
19
20
|
updated_at: typing_extensions.Annotated[typing.Optional[dt.datetime], FieldMetadata(alias="updatedAt")] = None
|
|
21
|
+
product: typing.Optional[Product] = pydantic.Field(default=None)
|
|
22
|
+
"""
|
|
23
|
+
The product associated with this plan product
|
|
24
|
+
"""
|
|
25
|
+
|
|
20
26
|
plan_product_attribute: typing_extensions.Annotated[
|
|
21
27
|
typing.Optional[typing.List[PlanPlanProductsItemPlanProductAttributeItem]],
|
|
22
28
|
FieldMetadata(alias="planProductAttribute"),
|
|
@@ -0,0 +1,69 @@
|
|
|
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 .plan_with_features_features_item import PlanWithFeaturesFeaturesItem
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PlanWithFeatures(UniversalBaseModel):
|
|
14
|
+
"""
|
|
15
|
+
A plan with its features (product-attribute pairs) for display
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
id: str = pydantic.Field()
|
|
19
|
+
"""
|
|
20
|
+
The unique identifier of the plan
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
name: str = pydantic.Field()
|
|
24
|
+
"""
|
|
25
|
+
The name of the plan
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
description: typing.Optional[str] = pydantic.Field(default=None)
|
|
29
|
+
"""
|
|
30
|
+
The description of the plan
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
created_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="createdAt")] = pydantic.Field()
|
|
34
|
+
"""
|
|
35
|
+
When the plan was created
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
updated_at: typing_extensions.Annotated[dt.datetime, FieldMetadata(alias="updatedAt")] = pydantic.Field()
|
|
39
|
+
"""
|
|
40
|
+
When the plan was last updated
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
next_plan_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="nextPlanId")] = pydantic.Field(
|
|
44
|
+
default=None
|
|
45
|
+
)
|
|
46
|
+
"""
|
|
47
|
+
The ID of the next plan in the sequence
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
prev_plan_id: typing_extensions.Annotated[typing.Optional[str], FieldMetadata(alias="prevPlanId")] = pydantic.Field(
|
|
51
|
+
default=None
|
|
52
|
+
)
|
|
53
|
+
"""
|
|
54
|
+
The ID of the previous plan in the sequence
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
features: typing.List[PlanWithFeaturesFeaturesItem] = pydantic.Field()
|
|
58
|
+
"""
|
|
59
|
+
The features (product-attribute pairs) included in this plan
|
|
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
|
|
@@ -0,0 +1,34 @@
|
|
|
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 PlanWithFeaturesFeaturesItem(UniversalBaseModel):
|
|
12
|
+
product_name: typing_extensions.Annotated[str, FieldMetadata(alias="productName")] = pydantic.Field()
|
|
13
|
+
"""
|
|
14
|
+
The name of the product
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
attribute_name: typing_extensions.Annotated[str, FieldMetadata(alias="attributeName")] = pydantic.Field()
|
|
18
|
+
"""
|
|
19
|
+
The name of the product attribute
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
pricing: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field()
|
|
23
|
+
"""
|
|
24
|
+
The pricing configuration for this feature
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
if IS_PYDANTIC_V2:
|
|
28
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
29
|
+
else:
|
|
30
|
+
|
|
31
|
+
class Config:
|
|
32
|
+
frozen = True
|
|
33
|
+
smart_union = True
|
|
34
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
|
@@ -0,0 +1,73 @@
|
|
|
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/signal_v_2.py
CHANGED
|
@@ -8,7 +8,7 @@ from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
|
8
8
|
|
|
9
9
|
class SignalV2(UniversalBaseModel):
|
|
10
10
|
"""
|
|
11
|
-
V2 signal schema with clean field names.
|
|
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
12
|
"""
|
|
13
13
|
|
|
14
14
|
event_name: str = pydantic.Field()
|
|
@@ -18,22 +18,22 @@ class SignalV2(UniversalBaseModel):
|
|
|
18
18
|
|
|
19
19
|
product_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
20
20
|
"""
|
|
21
|
-
Paid's
|
|
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
22
|
"""
|
|
23
23
|
|
|
24
24
|
external_product_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
25
25
|
"""
|
|
26
|
-
Your system's product ID.
|
|
26
|
+
Your system's product ID. Cannot be used with product_id. Either this or product_id is required.
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
29
|
customer_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
30
30
|
"""
|
|
31
|
-
Paid's
|
|
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
32
|
"""
|
|
33
33
|
|
|
34
34
|
external_customer_id: typing.Optional[str] = pydantic.Field(default=None)
|
|
35
35
|
"""
|
|
36
|
-
Your system's customer ID.
|
|
36
|
+
Your system's customer ID. Cannot be used with customer_id. Either this or customer_id is required.
|
|
37
37
|
"""
|
|
38
38
|
|
|
39
39
|
data: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None)
|
paid/usage/client.py
CHANGED
|
@@ -91,8 +91,8 @@ class UsageClient:
|
|
|
91
91
|
signals=[
|
|
92
92
|
SignalV2(
|
|
93
93
|
event_name="emails_sent",
|
|
94
|
-
product_id="
|
|
95
|
-
customer_id="
|
|
94
|
+
product_id="prod_abc123def",
|
|
95
|
+
customer_id="cus_xyz789ghi",
|
|
96
96
|
),
|
|
97
97
|
SignalV2(
|
|
98
98
|
event_name="emails_sent",
|
|
@@ -101,7 +101,7 @@ class UsageClient:
|
|
|
101
101
|
),
|
|
102
102
|
SignalV2(
|
|
103
103
|
event_name="meeting_booked",
|
|
104
|
-
product_id="
|
|
104
|
+
product_id="prod_abc123def",
|
|
105
105
|
external_customer_id="acme-inc",
|
|
106
106
|
data={"meeting_duration": 30, "meeting_type": "demo"},
|
|
107
107
|
),
|
|
@@ -246,8 +246,8 @@ class AsyncUsageClient:
|
|
|
246
246
|
signals=[
|
|
247
247
|
SignalV2(
|
|
248
248
|
event_name="emails_sent",
|
|
249
|
-
product_id="
|
|
250
|
-
customer_id="
|
|
249
|
+
product_id="prod_abc123def",
|
|
250
|
+
customer_id="cus_xyz789ghi",
|
|
251
251
|
),
|
|
252
252
|
SignalV2(
|
|
253
253
|
event_name="emails_sent",
|
|
@@ -256,7 +256,7 @@ class AsyncUsageClient:
|
|
|
256
256
|
),
|
|
257
257
|
SignalV2(
|
|
258
258
|
event_name="meeting_booked",
|
|
259
|
-
product_id="
|
|
259
|
+
product_id="prod_abc123def",
|
|
260
260
|
external_customer_id="acme-inc",
|
|
261
261
|
data={"meeting_duration": 30, "meeting_type": "demo"},
|
|
262
262
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: paid-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0a0
|
|
4
4
|
Summary:
|
|
5
5
|
Requires-Python: >=3.9,<3.14
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -15,9 +15,10 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
19
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
20
|
Classifier: Typing :: Typed
|
|
20
|
-
Requires-Dist: httpx (>=0.21.
|
|
21
|
+
Requires-Dist: httpx (>=0.21.2)
|
|
21
22
|
Requires-Dist: mutagen (>=1.47.0)
|
|
22
23
|
Requires-Dist: openinference-instrumentation-bedrock (>=0.1.0)
|
|
23
24
|
Requires-Dist: openinference-instrumentation-google-genai (>=0.1.8)
|
|
@@ -26,9 +27,10 @@ Requires-Dist: openinference-instrumentation-openai-agents (>=1.0.0)
|
|
|
26
27
|
Requires-Dist: opentelemetry-api (>=1.23.0)
|
|
27
28
|
Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.23.0)
|
|
28
29
|
Requires-Dist: opentelemetry-instrumentation-anthropic (>=0.47.0)
|
|
30
|
+
Requires-Dist: opentelemetry-instrumentation-openai (>=0.50.0)
|
|
29
31
|
Requires-Dist: opentelemetry-sdk (>=1.23.0)
|
|
30
|
-
Requires-Dist: pydantic (>=1.9.
|
|
31
|
-
Requires-Dist: pydantic-core (>=2.18.0)
|
|
32
|
+
Requires-Dist: pydantic (>=1.9.2)
|
|
33
|
+
Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
|
|
32
34
|
Requires-Dist: python-dotenv (>=0.15.0)
|
|
33
35
|
Requires-Dist: typing_extensions (>=4.0.0)
|
|
34
36
|
Description-Content-Type: text/markdown
|