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.
Files changed (137) hide show
  1. paid/__init__.py +61 -122
  2. paid/client.py +16 -22
  3. paid/contacts/client.py +417 -133
  4. paid/contacts/raw_client.py +1048 -118
  5. paid/core/client_wrapper.py +8 -10
  6. paid/customers/__init__.py +0 -3
  7. paid/customers/client.py +394 -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 +312 -201
  16. paid/orders/__init__.py +0 -3
  17. paid/orders/client.py +281 -471
  18. paid/orders/raw_client.py +552 -537
  19. paid/products/__init__.py +0 -3
  20. paid/products/client.py +129 -265
  21. paid/products/raw_client.py +565 -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.0a2.dist-info}/METADATA +23 -8
  68. paid_python-1.0.0a2.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.0a2.dist-info}/LICENSE +0 -0
  137. {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a2.dist-info}/WHEEL +0 -0
@@ -1,8 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- # isort: skip_file
4
-
5
- from .customers_check_entitlement_request_view import CustomersCheckEntitlementRequestView
6
- from .customers_check_entitlement_response import CustomersCheckEntitlementResponse
7
-
8
- __all__ = ["CustomersCheckEntitlementRequestView", "CustomersCheckEntitlementResponse"]
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- CustomersCheckEntitlementRequestView = typing.Union[typing.Literal["all", "active_only"], typing.Any]
@@ -1,22 +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 CustomersCheckEntitlementResponse(UniversalBaseModel):
10
- entitled: bool = pydantic.Field()
11
- """
12
- Whether the customer is entitled to the specified event
13
- """
14
-
15
- if IS_PYDANTIC_V2:
16
- model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
17
- else:
18
-
19
- class Config:
20
- frozen = True
21
- smart_union = True
22
- extra = pydantic.Extra.allow
@@ -1,144 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
- from ...core.request_options import RequestOptions
7
- from ...types.order import Order
8
- from ...types.order_line_create import OrderLineCreate
9
- from .raw_client import AsyncRawLinesClient, RawLinesClient
10
-
11
- # this is used as the default value for optional parameters
12
- OMIT = typing.cast(typing.Any, ...)
13
-
14
-
15
- class LinesClient:
16
- def __init__(self, *, client_wrapper: SyncClientWrapper):
17
- self._raw_client = RawLinesClient(client_wrapper=client_wrapper)
18
-
19
- @property
20
- def with_raw_response(self) -> RawLinesClient:
21
- """
22
- Retrieves a raw implementation of this client that returns raw responses.
23
-
24
- Returns
25
- -------
26
- RawLinesClient
27
- """
28
- return self._raw_client
29
-
30
- def update(
31
- self,
32
- order_id: str,
33
- *,
34
- lines: typing.Optional[typing.Sequence[OrderLineCreate]] = OMIT,
35
- request_options: typing.Optional[RequestOptions] = None,
36
- ) -> Order:
37
- """
38
- Parameters
39
- ----------
40
- order_id : str
41
-
42
- lines : typing.Optional[typing.Sequence[OrderLineCreate]]
43
-
44
- request_options : typing.Optional[RequestOptions]
45
- Request-specific configuration.
46
-
47
- Returns
48
- -------
49
- Order
50
- Success response
51
-
52
- Examples
53
- --------
54
- from paid import OrderLineCreate, Paid
55
-
56
- client = Paid(
57
- token="YOUR_TOKEN",
58
- )
59
- client.orders.lines.update(
60
- order_id="orderId",
61
- lines=[
62
- OrderLineCreate(
63
- name="Order Line One",
64
- description="Order Line One is an order line for Acme, Inc.",
65
- ),
66
- OrderLineCreate(
67
- name="Order Line Two",
68
- description="Order Line Two is an order line for Acme, Inc.",
69
- ),
70
- ],
71
- )
72
- """
73
- _response = self._raw_client.update(order_id, lines=lines, request_options=request_options)
74
- return _response.data
75
-
76
-
77
- class AsyncLinesClient:
78
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
79
- self._raw_client = AsyncRawLinesClient(client_wrapper=client_wrapper)
80
-
81
- @property
82
- def with_raw_response(self) -> AsyncRawLinesClient:
83
- """
84
- Retrieves a raw implementation of this client that returns raw responses.
85
-
86
- Returns
87
- -------
88
- AsyncRawLinesClient
89
- """
90
- return self._raw_client
91
-
92
- async def update(
93
- self,
94
- order_id: str,
95
- *,
96
- lines: typing.Optional[typing.Sequence[OrderLineCreate]] = OMIT,
97
- request_options: typing.Optional[RequestOptions] = None,
98
- ) -> Order:
99
- """
100
- Parameters
101
- ----------
102
- order_id : str
103
-
104
- lines : typing.Optional[typing.Sequence[OrderLineCreate]]
105
-
106
- request_options : typing.Optional[RequestOptions]
107
- Request-specific configuration.
108
-
109
- Returns
110
- -------
111
- Order
112
- Success response
113
-
114
- Examples
115
- --------
116
- import asyncio
117
-
118
- from paid import AsyncPaid, OrderLineCreate
119
-
120
- client = AsyncPaid(
121
- token="YOUR_TOKEN",
122
- )
123
-
124
-
125
- async def main() -> None:
126
- await client.orders.lines.update(
127
- order_id="orderId",
128
- lines=[
129
- OrderLineCreate(
130
- name="Order Line One",
131
- description="Order Line One is an order line for Acme, Inc.",
132
- ),
133
- OrderLineCreate(
134
- name="Order Line Two",
135
- description="Order Line Two is an order line for Acme, Inc.",
136
- ),
137
- ],
138
- )
139
-
140
-
141
- asyncio.run(main())
142
- """
143
- _response = await self._raw_client.update(order_id, lines=lines, request_options=request_options)
144
- return _response.data
@@ -1,129 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
- from json.decoder import JSONDecodeError
5
-
6
- from ...core.api_error import ApiError
7
- from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
- from ...core.http_response import AsyncHttpResponse, HttpResponse
9
- from ...core.jsonable_encoder import jsonable_encoder
10
- from ...core.pydantic_utilities import parse_obj_as
11
- from ...core.request_options import RequestOptions
12
- from ...core.serialization import convert_and_respect_annotation_metadata
13
- from ...types.order import Order
14
- from ...types.order_line_create import OrderLineCreate
15
-
16
- # this is used as the default value for optional parameters
17
- OMIT = typing.cast(typing.Any, ...)
18
-
19
-
20
- class RawLinesClient:
21
- def __init__(self, *, client_wrapper: SyncClientWrapper):
22
- self._client_wrapper = client_wrapper
23
-
24
- def update(
25
- self,
26
- order_id: str,
27
- *,
28
- lines: typing.Optional[typing.Sequence[OrderLineCreate]] = OMIT,
29
- request_options: typing.Optional[RequestOptions] = None,
30
- ) -> HttpResponse[Order]:
31
- """
32
- Parameters
33
- ----------
34
- order_id : str
35
-
36
- lines : typing.Optional[typing.Sequence[OrderLineCreate]]
37
-
38
- request_options : typing.Optional[RequestOptions]
39
- Request-specific configuration.
40
-
41
- Returns
42
- -------
43
- HttpResponse[Order]
44
- Success response
45
- """
46
- _response = self._client_wrapper.httpx_client.request(
47
- f"orders/{jsonable_encoder(order_id)}/lines",
48
- method="PUT",
49
- json={
50
- "lines": convert_and_respect_annotation_metadata(
51
- object_=lines, annotation=typing.Sequence[OrderLineCreate], direction="write"
52
- ),
53
- },
54
- headers={
55
- "content-type": "application/json",
56
- },
57
- request_options=request_options,
58
- omit=OMIT,
59
- )
60
- try:
61
- if 200 <= _response.status_code < 300:
62
- _data = typing.cast(
63
- Order,
64
- parse_obj_as(
65
- type_=Order, # type: ignore
66
- object_=_response.json(),
67
- ),
68
- )
69
- return HttpResponse(response=_response, data=_data)
70
- _response_json = _response.json()
71
- except JSONDecodeError:
72
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
73
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
74
-
75
-
76
- class AsyncRawLinesClient:
77
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
78
- self._client_wrapper = client_wrapper
79
-
80
- async def update(
81
- self,
82
- order_id: str,
83
- *,
84
- lines: typing.Optional[typing.Sequence[OrderLineCreate]] = OMIT,
85
- request_options: typing.Optional[RequestOptions] = None,
86
- ) -> AsyncHttpResponse[Order]:
87
- """
88
- Parameters
89
- ----------
90
- order_id : str
91
-
92
- lines : typing.Optional[typing.Sequence[OrderLineCreate]]
93
-
94
- request_options : typing.Optional[RequestOptions]
95
- Request-specific configuration.
96
-
97
- Returns
98
- -------
99
- AsyncHttpResponse[Order]
100
- Success response
101
- """
102
- _response = await self._client_wrapper.httpx_client.request(
103
- f"orders/{jsonable_encoder(order_id)}/lines",
104
- method="PUT",
105
- json={
106
- "lines": convert_and_respect_annotation_metadata(
107
- object_=lines, annotation=typing.Sequence[OrderLineCreate], direction="write"
108
- ),
109
- },
110
- headers={
111
- "content-type": "application/json",
112
- },
113
- request_options=request_options,
114
- omit=OMIT,
115
- )
116
- try:
117
- if 200 <= _response.status_code < 300:
118
- _data = typing.cast(
119
- Order,
120
- parse_obj_as(
121
- type_=Order, # type: ignore
122
- object_=_response.json(),
123
- ),
124
- )
125
- return AsyncHttpResponse(response=_response, data=_data)
126
- _response_json = _response.json()
127
- except JSONDecodeError:
128
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
129
- raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
paid/plans/__init__.py DELETED
@@ -1,4 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- # isort: skip_file
4
-