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/__init__.py
CHANGED
|
@@ -3,161 +3,100 @@
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
5
|
from .types import (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
AgentAttribute,
|
|
9
|
-
AgentPricePoint,
|
|
10
|
-
AgentPricePointTiers,
|
|
11
|
-
AgentUpdate,
|
|
12
|
-
ApiError,
|
|
13
|
-
BillingFrequency,
|
|
14
|
-
CancelRenewalResponse,
|
|
15
|
-
ChargeType,
|
|
6
|
+
Attribution,
|
|
7
|
+
BulkSignalsResponse,
|
|
16
8
|
Contact,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
CostTrace,
|
|
20
|
-
CostTracesResponse,
|
|
21
|
-
CreationSource,
|
|
22
|
-
CreationState,
|
|
9
|
+
ContactBillingAddress,
|
|
10
|
+
ContactListResponse,
|
|
23
11
|
Customer,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
CustomerAttribution,
|
|
13
|
+
CustomerBillingAddress,
|
|
14
|
+
CustomerByExternalId,
|
|
15
|
+
CustomerById,
|
|
16
|
+
CustomerCreationState,
|
|
17
|
+
CustomerListResponse,
|
|
18
|
+
EmptyResponse,
|
|
19
|
+
ErrorResponse,
|
|
27
20
|
Invoice,
|
|
21
|
+
InvoiceLine,
|
|
22
|
+
InvoiceLinePaymentStatus,
|
|
23
|
+
InvoiceLinesResponse,
|
|
24
|
+
InvoiceListResponse,
|
|
25
|
+
InvoicePaymentStatus,
|
|
26
|
+
InvoiceSource,
|
|
28
27
|
InvoiceStatus,
|
|
28
|
+
InvoiceTaxStatus,
|
|
29
29
|
Order,
|
|
30
|
+
OrderCreationState,
|
|
30
31
|
OrderLine,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
OrderLineCreate,
|
|
35
|
-
PaginationMeta,
|
|
36
|
-
PaymentMethod,
|
|
37
|
-
PaymentMethodCard,
|
|
38
|
-
PaymentMethodType,
|
|
39
|
-
PaymentMethodUsBankAccount,
|
|
40
|
-
PaymentMethodUsBankAccountAccountType,
|
|
41
|
-
Plan,
|
|
42
|
-
PlanGroup,
|
|
43
|
-
PlanPlanProductsItem,
|
|
44
|
-
PlanPlanProductsItemPlanProductAttributeItem,
|
|
45
|
-
PlanWithFeatures,
|
|
46
|
-
PlanWithFeaturesFeaturesItem,
|
|
47
|
-
PricePoint,
|
|
48
|
-
Pricing,
|
|
49
|
-
PricingModelType,
|
|
32
|
+
OrderLinesResponse,
|
|
33
|
+
OrderListResponse,
|
|
34
|
+
Pagination,
|
|
50
35
|
Product,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
ProrationAttributeUpdate,
|
|
55
|
-
ProrationDetail,
|
|
56
|
-
ProrationUpgradeResponse,
|
|
57
|
-
Salutation,
|
|
36
|
+
ProductByExternalId,
|
|
37
|
+
ProductById,
|
|
38
|
+
ProductListResponse,
|
|
58
39
|
Signal,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Trace,
|
|
63
|
-
TracesResponse,
|
|
64
|
-
UsagePaginationMeta,
|
|
65
|
-
UsageSummariesResponse,
|
|
66
|
-
UsageSummary,
|
|
67
|
-
UsageSummaryOrder,
|
|
68
|
-
UsageSummaryOrderLine,
|
|
40
|
+
UpdateContactRequest,
|
|
41
|
+
UpdateCustomerRequest,
|
|
42
|
+
UpdateProductRequest,
|
|
69
43
|
)
|
|
70
44
|
from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError
|
|
71
|
-
from . import
|
|
45
|
+
from . import contacts, customers, invoices, orders, products, signals
|
|
72
46
|
from .client import AsyncPaid, Paid
|
|
73
|
-
from .customers import CustomersCheckEntitlementRequestView, CustomersCheckEntitlementResponse
|
|
74
47
|
from .environment import PaidEnvironment
|
|
75
|
-
from .products import ProductCreateType
|
|
76
|
-
from .usage import UsageCheckUsageResponse
|
|
77
48
|
from .version import __version__
|
|
78
49
|
|
|
79
50
|
__all__ = [
|
|
80
|
-
"Address",
|
|
81
|
-
"Agent",
|
|
82
|
-
"AgentAttribute",
|
|
83
|
-
"AgentPricePoint",
|
|
84
|
-
"AgentPricePointTiers",
|
|
85
|
-
"AgentUpdate",
|
|
86
|
-
"ApiError",
|
|
87
51
|
"AsyncPaid",
|
|
52
|
+
"Attribution",
|
|
88
53
|
"BadRequestError",
|
|
89
|
-
"
|
|
90
|
-
"CancelRenewalResponse",
|
|
91
|
-
"ChargeType",
|
|
54
|
+
"BulkSignalsResponse",
|
|
92
55
|
"Contact",
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"CostTrace",
|
|
96
|
-
"CostTracesResponse",
|
|
97
|
-
"CreationSource",
|
|
98
|
-
"CreationState",
|
|
56
|
+
"ContactBillingAddress",
|
|
57
|
+
"ContactListResponse",
|
|
99
58
|
"Customer",
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
59
|
+
"CustomerAttribution",
|
|
60
|
+
"CustomerBillingAddress",
|
|
61
|
+
"CustomerByExternalId",
|
|
62
|
+
"CustomerById",
|
|
63
|
+
"CustomerCreationState",
|
|
64
|
+
"CustomerListResponse",
|
|
65
|
+
"EmptyResponse",
|
|
66
|
+
"ErrorResponse",
|
|
105
67
|
"ForbiddenError",
|
|
106
68
|
"InternalServerError",
|
|
107
69
|
"Invoice",
|
|
70
|
+
"InvoiceLine",
|
|
71
|
+
"InvoiceLinePaymentStatus",
|
|
72
|
+
"InvoiceLinesResponse",
|
|
73
|
+
"InvoiceListResponse",
|
|
74
|
+
"InvoicePaymentStatus",
|
|
75
|
+
"InvoiceSource",
|
|
108
76
|
"InvoiceStatus",
|
|
77
|
+
"InvoiceTaxStatus",
|
|
109
78
|
"NotFoundError",
|
|
110
79
|
"Order",
|
|
80
|
+
"OrderCreationState",
|
|
111
81
|
"OrderLine",
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"OrderLineCreate",
|
|
116
|
-
"PaginationMeta",
|
|
82
|
+
"OrderLinesResponse",
|
|
83
|
+
"OrderListResponse",
|
|
84
|
+
"Pagination",
|
|
117
85
|
"Paid",
|
|
118
86
|
"PaidEnvironment",
|
|
119
|
-
"PaymentMethod",
|
|
120
|
-
"PaymentMethodCard",
|
|
121
|
-
"PaymentMethodType",
|
|
122
|
-
"PaymentMethodUsBankAccount",
|
|
123
|
-
"PaymentMethodUsBankAccountAccountType",
|
|
124
|
-
"Plan",
|
|
125
|
-
"PlanGroup",
|
|
126
|
-
"PlanPlanProductsItem",
|
|
127
|
-
"PlanPlanProductsItemPlanProductAttributeItem",
|
|
128
|
-
"PlanWithFeatures",
|
|
129
|
-
"PlanWithFeaturesFeaturesItem",
|
|
130
|
-
"PricePoint",
|
|
131
|
-
"Pricing",
|
|
132
|
-
"PricingModelType",
|
|
133
87
|
"Product",
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"
|
|
137
|
-
"ProductUpdateType",
|
|
138
|
-
"ProrationAttributeUpdate",
|
|
139
|
-
"ProrationDetail",
|
|
140
|
-
"ProrationUpgradeResponse",
|
|
141
|
-
"Salutation",
|
|
88
|
+
"ProductByExternalId",
|
|
89
|
+
"ProductById",
|
|
90
|
+
"ProductListResponse",
|
|
142
91
|
"Signal",
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"Trace",
|
|
147
|
-
"TracesResponse",
|
|
148
|
-
"UsageCheckUsageResponse",
|
|
149
|
-
"UsagePaginationMeta",
|
|
150
|
-
"UsageSummariesResponse",
|
|
151
|
-
"UsageSummary",
|
|
152
|
-
"UsageSummaryOrder",
|
|
153
|
-
"UsageSummaryOrderLine",
|
|
92
|
+
"UpdateContactRequest",
|
|
93
|
+
"UpdateCustomerRequest",
|
|
94
|
+
"UpdateProductRequest",
|
|
154
95
|
"__version__",
|
|
155
|
-
"agents",
|
|
156
96
|
"contacts",
|
|
157
97
|
"customers",
|
|
98
|
+
"invoices",
|
|
158
99
|
"orders",
|
|
159
|
-
"plans",
|
|
160
100
|
"products",
|
|
161
|
-
"
|
|
162
|
-
"usage",
|
|
101
|
+
"signals",
|
|
163
102
|
]
|
paid/client.py
CHANGED
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
import typing
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
|
-
from .agents.client import AgentsClient, AsyncAgentsClient
|
|
7
6
|
from .contacts.client import AsyncContactsClient, ContactsClient
|
|
8
7
|
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
9
8
|
from .customers.client import AsyncCustomersClient, CustomersClient
|
|
10
9
|
from .environment import PaidEnvironment
|
|
10
|
+
from .invoices.client import AsyncInvoicesClient, InvoicesClient
|
|
11
11
|
from .orders.client import AsyncOrdersClient, OrdersClient
|
|
12
|
-
from .plans.client import AsyncPlansClient, PlansClient
|
|
13
12
|
from .products.client import AsyncProductsClient, ProductsClient
|
|
14
|
-
from .
|
|
15
|
-
from .usage.client import AsyncUsageClient, UsageClient
|
|
13
|
+
from .signals.client import AsyncSignalsClient, SignalsClient
|
|
16
14
|
|
|
17
15
|
|
|
18
16
|
class Paid:
|
|
@@ -29,11 +27,11 @@ class Paid:
|
|
|
29
27
|
|
|
30
28
|
|
|
31
29
|
|
|
32
|
-
Defaults to PaidEnvironment.
|
|
30
|
+
Defaults to PaidEnvironment.DEFAULT
|
|
33
31
|
|
|
34
32
|
|
|
35
33
|
|
|
36
|
-
token : typing.
|
|
34
|
+
token : typing.Union[str, typing.Callable[[], str]]
|
|
37
35
|
timeout : typing.Optional[float]
|
|
38
36
|
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
39
37
|
|
|
@@ -56,8 +54,8 @@ class Paid:
|
|
|
56
54
|
self,
|
|
57
55
|
*,
|
|
58
56
|
base_url: typing.Optional[str] = None,
|
|
59
|
-
environment: PaidEnvironment = PaidEnvironment.
|
|
60
|
-
token: typing.
|
|
57
|
+
environment: PaidEnvironment = PaidEnvironment.DEFAULT,
|
|
58
|
+
token: typing.Union[str, typing.Callable[[], str]],
|
|
61
59
|
timeout: typing.Optional[float] = None,
|
|
62
60
|
follow_redirects: typing.Optional[bool] = True,
|
|
63
61
|
httpx_client: typing.Optional[httpx.Client] = None,
|
|
@@ -75,14 +73,12 @@ class Paid:
|
|
|
75
73
|
else httpx.Client(timeout=_defaulted_timeout),
|
|
76
74
|
timeout=_defaulted_timeout,
|
|
77
75
|
)
|
|
78
|
-
self.customers = CustomersClient(client_wrapper=self._client_wrapper)
|
|
79
|
-
self.agents = AgentsClient(client_wrapper=self._client_wrapper)
|
|
80
76
|
self.products = ProductsClient(client_wrapper=self._client_wrapper)
|
|
77
|
+
self.customers = CustomersClient(client_wrapper=self._client_wrapper)
|
|
81
78
|
self.contacts = ContactsClient(client_wrapper=self._client_wrapper)
|
|
82
79
|
self.orders = OrdersClient(client_wrapper=self._client_wrapper)
|
|
83
|
-
self.
|
|
84
|
-
self.
|
|
85
|
-
self.traces = TracesClient(client_wrapper=self._client_wrapper)
|
|
80
|
+
self.invoices = InvoicesClient(client_wrapper=self._client_wrapper)
|
|
81
|
+
self.signals = SignalsClient(client_wrapper=self._client_wrapper)
|
|
86
82
|
|
|
87
83
|
|
|
88
84
|
class AsyncPaid:
|
|
@@ -99,11 +95,11 @@ class AsyncPaid:
|
|
|
99
95
|
|
|
100
96
|
|
|
101
97
|
|
|
102
|
-
Defaults to PaidEnvironment.
|
|
98
|
+
Defaults to PaidEnvironment.DEFAULT
|
|
103
99
|
|
|
104
100
|
|
|
105
101
|
|
|
106
|
-
token : typing.
|
|
102
|
+
token : typing.Union[str, typing.Callable[[], str]]
|
|
107
103
|
timeout : typing.Optional[float]
|
|
108
104
|
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
|
|
109
105
|
|
|
@@ -126,8 +122,8 @@ class AsyncPaid:
|
|
|
126
122
|
self,
|
|
127
123
|
*,
|
|
128
124
|
base_url: typing.Optional[str] = None,
|
|
129
|
-
environment: PaidEnvironment = PaidEnvironment.
|
|
130
|
-
token: typing.
|
|
125
|
+
environment: PaidEnvironment = PaidEnvironment.DEFAULT,
|
|
126
|
+
token: typing.Union[str, typing.Callable[[], str]],
|
|
131
127
|
timeout: typing.Optional[float] = None,
|
|
132
128
|
follow_redirects: typing.Optional[bool] = True,
|
|
133
129
|
httpx_client: typing.Optional[httpx.AsyncClient] = None,
|
|
@@ -145,14 +141,12 @@ class AsyncPaid:
|
|
|
145
141
|
else httpx.AsyncClient(timeout=_defaulted_timeout),
|
|
146
142
|
timeout=_defaulted_timeout,
|
|
147
143
|
)
|
|
148
|
-
self.customers = AsyncCustomersClient(client_wrapper=self._client_wrapper)
|
|
149
|
-
self.agents = AsyncAgentsClient(client_wrapper=self._client_wrapper)
|
|
150
144
|
self.products = AsyncProductsClient(client_wrapper=self._client_wrapper)
|
|
145
|
+
self.customers = AsyncCustomersClient(client_wrapper=self._client_wrapper)
|
|
151
146
|
self.contacts = AsyncContactsClient(client_wrapper=self._client_wrapper)
|
|
152
147
|
self.orders = AsyncOrdersClient(client_wrapper=self._client_wrapper)
|
|
153
|
-
self.
|
|
154
|
-
self.
|
|
155
|
-
self.traces = AsyncTracesClient(client_wrapper=self._client_wrapper)
|
|
148
|
+
self.invoices = AsyncInvoicesClient(client_wrapper=self._client_wrapper)
|
|
149
|
+
self.signals = AsyncSignalsClient(client_wrapper=self._client_wrapper)
|
|
156
150
|
|
|
157
151
|
|
|
158
152
|
def _get_base_url(*, base_url: typing.Optional[str] = None, environment: PaidEnvironment) -> str:
|