paid-python 1.5.0__tar.gz → 1.6.0__tar.gz

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 (145) hide show
  1. {paid_python-1.5.0 → paid_python-1.6.0}/PKG-INFO +1 -1
  2. {paid_python-1.5.0 → paid_python-1.6.0}/pyproject.toml +2 -2
  3. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/__init__.py +18 -1
  4. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/client.py +19 -0
  5. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/client_wrapper.py +2 -2
  6. paid_python-1.6.0/src/paid/credits/client.py +104 -0
  7. paid_python-1.6.0/src/paid/credits/raw_client.py +140 -0
  8. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/customers/client.py +149 -0
  9. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/customers/raw_client.py +285 -0
  10. paid_python-1.6.0/src/paid/signals/__init__.py +4 -0
  11. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/__init__.py +15 -0
  12. paid_python-1.6.0/src/paid/types/credit_balance.py +44 -0
  13. paid_python-1.6.0/src/paid/types/credit_balance_list_response.py +20 -0
  14. paid_python-1.6.0/src/paid/types/credit_balance_recipient.py +5 -0
  15. paid_python-1.6.0/src/paid/types/credit_currency.py +34 -0
  16. paid_python-1.6.0/src/paid/types/credit_currency_list_response.py +20 -0
  17. {paid_python-1.5.0 → paid_python-1.6.0}/LICENSE +0 -0
  18. {paid_python-1.5.0 → paid_python-1.6.0}/README.md +0 -0
  19. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/checkouts/__init__.py +0 -0
  20. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/checkouts/client.py +0 -0
  21. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/checkouts/raw_client.py +0 -0
  22. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/checkouts/types/__init__.py +0 -0
  23. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/checkouts/types/list_checkouts_request_status.py +0 -0
  24. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/contacts/__init__.py +0 -0
  25. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/contacts/client.py +0 -0
  26. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/contacts/raw_client.py +0 -0
  27. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/contacts/types/__init__.py +0 -0
  28. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/contacts/types/create_contact_request_roles_item.py +0 -0
  29. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/__init__.py +0 -0
  30. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/api_error.py +0 -0
  31. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/datetime_utils.py +0 -0
  32. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/file.py +0 -0
  33. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/force_multipart.py +0 -0
  34. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/http_client.py +0 -0
  35. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/http_response.py +0 -0
  36. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/http_sse/__init__.py +0 -0
  37. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/http_sse/_api.py +0 -0
  38. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/http_sse/_decoders.py +0 -0
  39. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/http_sse/_exceptions.py +0 -0
  40. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/http_sse/_models.py +0 -0
  41. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/jsonable_encoder.py +0 -0
  42. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/pydantic_utilities.py +0 -0
  43. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/query_encoder.py +0 -0
  44. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/remove_none_from_dict.py +0 -0
  45. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/request_options.py +0 -0
  46. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/core/serialization.py +0 -0
  47. {paid_python-1.5.0/src/paid/customers → paid_python-1.6.0/src/paid/credits}/__init__.py +0 -0
  48. {paid_python-1.5.0/src/paid/invoices → paid_python-1.6.0/src/paid/customers}/__init__.py +0 -0
  49. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/environment.py +0 -0
  50. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/errors/__init__.py +0 -0
  51. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/errors/bad_request_error.py +0 -0
  52. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/errors/forbidden_error.py +0 -0
  53. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/errors/internal_server_error.py +0 -0
  54. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/errors/not_found_error.py +0 -0
  55. {paid_python-1.5.0/src/paid/orders → paid_python-1.6.0/src/paid/invoices}/__init__.py +0 -0
  56. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/invoices/client.py +0 -0
  57. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/invoices/raw_client.py +0 -0
  58. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/logger.py +0 -0
  59. {paid_python-1.5.0/src/paid/products → paid_python-1.6.0/src/paid/orders}/__init__.py +0 -0
  60. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/orders/client.py +0 -0
  61. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/orders/raw_client.py +0 -0
  62. {paid_python-1.5.0/src/paid/signals → paid_python-1.6.0/src/paid/products}/__init__.py +0 -0
  63. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/products/client.py +0 -0
  64. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/products/raw_client.py +0 -0
  65. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/py.typed +0 -0
  66. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/signals/client.py +0 -0
  67. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/signals/raw_client.py +0 -0
  68. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/__init__.py +0 -0
  69. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/anthropic_patches/__init__.py +0 -0
  70. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/anthropic_patches/patches.py +0 -0
  71. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/autoinstrumentation.py +0 -0
  72. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/context_data.py +0 -0
  73. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/context_manager.py +0 -0
  74. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/distributed_tracing.py +0 -0
  75. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/gemini_patches/__init__.py +0 -0
  76. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/gemini_patches/patches.py +0 -0
  77. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/openai_agents_patches/__init__.py +0 -0
  78. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/openai_agents_patches/patches.py +0 -0
  79. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/openai_patches/__init__.py +0 -0
  80. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/openai_patches/patches.py +0 -0
  81. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/signal.py +0 -0
  82. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/tracing.py +0 -0
  83. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/__init__.py +0 -0
  84. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/anthropic/__init__.py +0 -0
  85. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/anthropic/anthropicWrapper.py +0 -0
  86. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/bedrock/__init__.py +0 -0
  87. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/bedrock/bedrockWrapper.py +0 -0
  88. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/gemini/__init__.py +0 -0
  89. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/gemini/geminiWrapper.py +0 -0
  90. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/langchain/__init__.py +0 -0
  91. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/langchain/paidLangChainCallback.py +0 -0
  92. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/mistral/__init__.py +0 -0
  93. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/mistral/mistralWrapper.py +0 -0
  94. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/openai/__init__.py +0 -0
  95. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/openai/openAiWrapper.py +0 -0
  96. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/openai_agents/__init__.py +0 -0
  97. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/openai_agents/openaiAgentsHook.py +0 -0
  98. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/tracing/wrappers/utils.py +0 -0
  99. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/attribution.py +0 -0
  100. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/bulk_signals_response.py +0 -0
  101. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/checkout.py +0 -0
  102. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/checkout_list_response.py +0 -0
  103. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/checkout_product.py +0 -0
  104. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/checkout_product_input.py +0 -0
  105. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/checkout_status.py +0 -0
  106. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/contact.py +0 -0
  107. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/contact_billing_address.py +0 -0
  108. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/contact_list_response.py +0 -0
  109. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/contact_roles_item.py +0 -0
  110. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/create_order_line_attribute_request.py +0 -0
  111. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/create_order_line_request.py +0 -0
  112. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/customer.py +0 -0
  113. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/customer_attribution.py +0 -0
  114. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/customer_billing_address.py +0 -0
  115. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/customer_by_external_id.py +0 -0
  116. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/customer_by_id.py +0 -0
  117. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/customer_creation_state.py +0 -0
  118. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/customer_list_response.py +0 -0
  119. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/empty_response.py +0 -0
  120. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/error_response.py +0 -0
  121. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/invoice.py +0 -0
  122. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/invoice_line.py +0 -0
  123. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/invoice_line_payment_status.py +0 -0
  124. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/invoice_lines_response.py +0 -0
  125. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/invoice_list_response.py +0 -0
  126. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/invoice_payment_status.py +0 -0
  127. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/invoice_source.py +0 -0
  128. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/invoice_status.py +0 -0
  129. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/invoice_tax_status.py +0 -0
  130. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/order.py +0 -0
  131. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/order_creation_state.py +0 -0
  132. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/order_line.py +0 -0
  133. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/order_lines_response.py +0 -0
  134. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/order_list_response.py +0 -0
  135. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/pagination.py +0 -0
  136. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/product.py +0 -0
  137. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/product_by_external_id.py +0 -0
  138. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/product_by_id.py +0 -0
  139. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/product_list_response.py +0 -0
  140. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/signal.py +0 -0
  141. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/update_contact_request.py +0 -0
  142. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/update_contact_request_roles_item.py +0 -0
  143. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/update_customer_request.py +0 -0
  144. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/types/update_product_request.py +0 -0
  145. {paid_python-1.5.0 → paid_python-1.6.0}/src/paid/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: paid-python
3
- Version: 1.5.0
3
+ Version: 1.6.0
4
4
  Summary:
5
5
  Requires-Python: >=3.10,<3.14
6
6
  Classifier: Intended Audience :: Developers
@@ -4,7 +4,7 @@ dynamic = ["version"]
4
4
 
5
5
  [tool.poetry]
6
6
  name = "paid-python"
7
- version = "1.5.0"
7
+ version = "1.6.0"
8
8
  description = ""
9
9
  readme = "README.md"
10
10
  authors = []
@@ -64,7 +64,7 @@ claude-agent-sdk = ">=0.1.0,<0.1.49"
64
64
  google-genai = ">=1.19.0"
65
65
  instructor = ">=1.0.0"
66
66
  langchain-core = ">=0.1.0"
67
- mistralai = ">=1.9.0,<2.0.0"
67
+ mistralai = ">=1.9.0, <2.0.0"
68
68
  openai = ">=1.12.0"
69
69
  openai-agents = ">=0.2.0"
70
70
  pydantic-ai = ">=1.41.0"
@@ -20,6 +20,11 @@ if typing.TYPE_CHECKING:
20
20
  ContactRolesItem,
21
21
  CreateOrderLineAttributeRequest,
22
22
  CreateOrderLineRequest,
23
+ CreditBalance,
24
+ CreditBalanceListResponse,
25
+ CreditBalanceRecipient,
26
+ CreditCurrency,
27
+ CreditCurrencyListResponse,
23
28
  Customer,
24
29
  CustomerAttribution,
25
30
  CustomerBillingAddress,
@@ -55,7 +60,7 @@ if typing.TYPE_CHECKING:
55
60
  UpdateProductRequest,
56
61
  )
57
62
  from .errors import BadRequestError, ForbiddenError, InternalServerError, NotFoundError
58
- from . import checkouts, contacts, customers, invoices, orders, products, signals
63
+ from . import checkouts, contacts, credits, customers, invoices, orders, products, signals
59
64
  from .checkouts import ListCheckoutsRequestStatus
60
65
  from .client import AsyncPaid, Paid
61
66
  from .contacts import CreateContactRequestRolesItem
@@ -78,6 +83,11 @@ _dynamic_imports: typing.Dict[str, str] = {
78
83
  "CreateContactRequestRolesItem": ".contacts",
79
84
  "CreateOrderLineAttributeRequest": ".types",
80
85
  "CreateOrderLineRequest": ".types",
86
+ "CreditBalance": ".types",
87
+ "CreditBalanceListResponse": ".types",
88
+ "CreditBalanceRecipient": ".types",
89
+ "CreditCurrency": ".types",
90
+ "CreditCurrencyListResponse": ".types",
81
91
  "Customer": ".types",
82
92
  "CustomerAttribution": ".types",
83
93
  "CustomerBillingAddress": ".types",
@@ -120,6 +130,7 @@ _dynamic_imports: typing.Dict[str, str] = {
120
130
  "__version__": ".version",
121
131
  "checkouts": ".checkouts",
122
132
  "contacts": ".contacts",
133
+ "credits": ".credits",
123
134
  "customers": ".customers",
124
135
  "invoices": ".invoices",
125
136
  "orders": ".orders",
@@ -166,6 +177,11 @@ __all__ = [
166
177
  "CreateContactRequestRolesItem",
167
178
  "CreateOrderLineAttributeRequest",
168
179
  "CreateOrderLineRequest",
180
+ "CreditBalance",
181
+ "CreditBalanceListResponse",
182
+ "CreditBalanceRecipient",
183
+ "CreditCurrency",
184
+ "CreditCurrencyListResponse",
169
185
  "Customer",
170
186
  "CustomerAttribution",
171
187
  "CustomerBillingAddress",
@@ -208,6 +224,7 @@ __all__ = [
208
224
  "__version__",
209
225
  "checkouts",
210
226
  "contacts",
227
+ "credits",
211
228
  "customers",
212
229
  "invoices",
213
230
  "orders",
@@ -11,6 +11,7 @@ from .environment import PaidEnvironment
11
11
  if typing.TYPE_CHECKING:
12
12
  from .checkouts.client import AsyncCheckoutsClient, CheckoutsClient
13
13
  from .contacts.client import AsyncContactsClient, ContactsClient
14
+ from .credits.client import AsyncCreditsClient, CreditsClient
14
15
  from .customers.client import AsyncCustomersClient, CustomersClient
15
16
  from .invoices.client import AsyncInvoicesClient, InvoicesClient
16
17
  from .orders.client import AsyncOrdersClient, OrdersClient
@@ -89,6 +90,7 @@ class Paid:
89
90
  self._orders: typing.Optional[OrdersClient] = None
90
91
  self._invoices: typing.Optional[InvoicesClient] = None
91
92
  self._signals: typing.Optional[SignalsClient] = None
93
+ self._credits: typing.Optional[CreditsClient] = None
92
94
  self._checkouts: typing.Optional[CheckoutsClient] = None
93
95
 
94
96
  @property
@@ -139,6 +141,14 @@ class Paid:
139
141
  self._signals = SignalsClient(client_wrapper=self._client_wrapper)
140
142
  return self._signals
141
143
 
144
+ @property
145
+ def credits(self):
146
+ if self._credits is None:
147
+ from .credits.client import CreditsClient # noqa: E402
148
+
149
+ self._credits = CreditsClient(client_wrapper=self._client_wrapper)
150
+ return self._credits
151
+
142
152
  @property
143
153
  def checkouts(self):
144
154
  if self._checkouts is None:
@@ -219,6 +229,7 @@ class AsyncPaid:
219
229
  self._orders: typing.Optional[AsyncOrdersClient] = None
220
230
  self._invoices: typing.Optional[AsyncInvoicesClient] = None
221
231
  self._signals: typing.Optional[AsyncSignalsClient] = None
232
+ self._credits: typing.Optional[AsyncCreditsClient] = None
222
233
  self._checkouts: typing.Optional[AsyncCheckoutsClient] = None
223
234
 
224
235
  @property
@@ -269,6 +280,14 @@ class AsyncPaid:
269
280
  self._signals = AsyncSignalsClient(client_wrapper=self._client_wrapper)
270
281
  return self._signals
271
282
 
283
+ @property
284
+ def credits(self):
285
+ if self._credits is None:
286
+ from .credits.client import AsyncCreditsClient # noqa: E402
287
+
288
+ self._credits = AsyncCreditsClient(client_wrapper=self._client_wrapper)
289
+ return self._credits
290
+
272
291
  @property
273
292
  def checkouts(self):
274
293
  if self._checkouts is None:
@@ -24,12 +24,12 @@ class BaseClientWrapper:
24
24
  import platform
25
25
 
26
26
  headers: typing.Dict[str, str] = {
27
- "User-Agent": "paid-python/1.5.0",
27
+ "User-Agent": "paid-python/1.6.0",
28
28
  "X-Fern-Language": "Python",
29
29
  "X-Fern-Runtime": f"python/{platform.python_version()}",
30
30
  "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
31
31
  "X-Fern-SDK-Name": "paid-python",
32
- "X-Fern-SDK-Version": "1.5.0",
32
+ "X-Fern-SDK-Version": "1.6.0",
33
33
  **(self.get_custom_headers() or {}),
34
34
  }
35
35
  headers["Authorization"] = f"Bearer {self._get_token()}"
@@ -0,0 +1,104 @@
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.credit_currency_list_response import CreditCurrencyListResponse
8
+ from .raw_client import AsyncRawCreditsClient, RawCreditsClient
9
+
10
+
11
+ class CreditsClient:
12
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
13
+ self._raw_client = RawCreditsClient(client_wrapper=client_wrapper)
14
+
15
+ @property
16
+ def with_raw_response(self) -> RawCreditsClient:
17
+ """
18
+ Retrieves a raw implementation of this client that returns raw responses.
19
+
20
+ Returns
21
+ -------
22
+ RawCreditsClient
23
+ """
24
+ return self._raw_client
25
+
26
+ def list_credit_currencies(
27
+ self, *, request_options: typing.Optional[RequestOptions] = None
28
+ ) -> CreditCurrencyListResponse:
29
+ """
30
+ List credit currencies for the organization
31
+
32
+ Parameters
33
+ ----------
34
+ request_options : typing.Optional[RequestOptions]
35
+ Request-specific configuration.
36
+
37
+ Returns
38
+ -------
39
+ CreditCurrencyListResponse
40
+ 200
41
+
42
+ Examples
43
+ --------
44
+ from paid import Paid
45
+
46
+ client = Paid(
47
+ token="YOUR_TOKEN",
48
+ )
49
+ client.credits.list_credit_currencies()
50
+ """
51
+ _response = self._raw_client.list_credit_currencies(request_options=request_options)
52
+ return _response.data
53
+
54
+
55
+ class AsyncCreditsClient:
56
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
57
+ self._raw_client = AsyncRawCreditsClient(client_wrapper=client_wrapper)
58
+
59
+ @property
60
+ def with_raw_response(self) -> AsyncRawCreditsClient:
61
+ """
62
+ Retrieves a raw implementation of this client that returns raw responses.
63
+
64
+ Returns
65
+ -------
66
+ AsyncRawCreditsClient
67
+ """
68
+ return self._raw_client
69
+
70
+ async def list_credit_currencies(
71
+ self, *, request_options: typing.Optional[RequestOptions] = None
72
+ ) -> CreditCurrencyListResponse:
73
+ """
74
+ List credit currencies for the organization
75
+
76
+ Parameters
77
+ ----------
78
+ request_options : typing.Optional[RequestOptions]
79
+ Request-specific configuration.
80
+
81
+ Returns
82
+ -------
83
+ CreditCurrencyListResponse
84
+ 200
85
+
86
+ Examples
87
+ --------
88
+ import asyncio
89
+
90
+ from paid import AsyncPaid
91
+
92
+ client = AsyncPaid(
93
+ token="YOUR_TOKEN",
94
+ )
95
+
96
+
97
+ async def main() -> None:
98
+ await client.credits.list_credit_currencies()
99
+
100
+
101
+ asyncio.run(main())
102
+ """
103
+ _response = await self._raw_client.list_credit_currencies(request_options=request_options)
104
+ return _response.data
@@ -0,0 +1,140 @@
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.pydantic_utilities import parse_obj_as
10
+ from ..core.request_options import RequestOptions
11
+ from ..errors.forbidden_error import ForbiddenError
12
+ from ..errors.internal_server_error import InternalServerError
13
+ from ..types.credit_currency_list_response import CreditCurrencyListResponse
14
+ from ..types.error_response import ErrorResponse
15
+
16
+
17
+ class RawCreditsClient:
18
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
19
+ self._client_wrapper = client_wrapper
20
+
21
+ def list_credit_currencies(
22
+ self, *, request_options: typing.Optional[RequestOptions] = None
23
+ ) -> HttpResponse[CreditCurrencyListResponse]:
24
+ """
25
+ List credit currencies for the organization
26
+
27
+ Parameters
28
+ ----------
29
+ request_options : typing.Optional[RequestOptions]
30
+ Request-specific configuration.
31
+
32
+ Returns
33
+ -------
34
+ HttpResponse[CreditCurrencyListResponse]
35
+ 200
36
+ """
37
+ _response = self._client_wrapper.httpx_client.request(
38
+ "credits/currencies",
39
+ method="GET",
40
+ request_options=request_options,
41
+ )
42
+ try:
43
+ if 200 <= _response.status_code < 300:
44
+ _data = typing.cast(
45
+ CreditCurrencyListResponse,
46
+ parse_obj_as(
47
+ type_=CreditCurrencyListResponse, # type: ignore
48
+ object_=_response.json(),
49
+ ),
50
+ )
51
+ return HttpResponse(response=_response, data=_data)
52
+ if _response.status_code == 403:
53
+ raise ForbiddenError(
54
+ headers=dict(_response.headers),
55
+ body=typing.cast(
56
+ ErrorResponse,
57
+ parse_obj_as(
58
+ type_=ErrorResponse, # type: ignore
59
+ object_=_response.json(),
60
+ ),
61
+ ),
62
+ )
63
+ if _response.status_code == 500:
64
+ raise InternalServerError(
65
+ headers=dict(_response.headers),
66
+ body=typing.cast(
67
+ ErrorResponse,
68
+ parse_obj_as(
69
+ type_=ErrorResponse, # type: ignore
70
+ object_=_response.json(),
71
+ ),
72
+ ),
73
+ )
74
+ _response_json = _response.json()
75
+ except JSONDecodeError:
76
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
77
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
78
+
79
+
80
+ class AsyncRawCreditsClient:
81
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
82
+ self._client_wrapper = client_wrapper
83
+
84
+ async def list_credit_currencies(
85
+ self, *, request_options: typing.Optional[RequestOptions] = None
86
+ ) -> AsyncHttpResponse[CreditCurrencyListResponse]:
87
+ """
88
+ List credit currencies for the organization
89
+
90
+ Parameters
91
+ ----------
92
+ request_options : typing.Optional[RequestOptions]
93
+ Request-specific configuration.
94
+
95
+ Returns
96
+ -------
97
+ AsyncHttpResponse[CreditCurrencyListResponse]
98
+ 200
99
+ """
100
+ _response = await self._client_wrapper.httpx_client.request(
101
+ "credits/currencies",
102
+ method="GET",
103
+ request_options=request_options,
104
+ )
105
+ try:
106
+ if 200 <= _response.status_code < 300:
107
+ _data = typing.cast(
108
+ CreditCurrencyListResponse,
109
+ parse_obj_as(
110
+ type_=CreditCurrencyListResponse, # type: ignore
111
+ object_=_response.json(),
112
+ ),
113
+ )
114
+ return AsyncHttpResponse(response=_response, data=_data)
115
+ if _response.status_code == 403:
116
+ raise ForbiddenError(
117
+ headers=dict(_response.headers),
118
+ body=typing.cast(
119
+ ErrorResponse,
120
+ parse_obj_as(
121
+ type_=ErrorResponse, # type: ignore
122
+ object_=_response.json(),
123
+ ),
124
+ ),
125
+ )
126
+ if _response.status_code == 500:
127
+ raise InternalServerError(
128
+ headers=dict(_response.headers),
129
+ body=typing.cast(
130
+ ErrorResponse,
131
+ parse_obj_as(
132
+ type_=ErrorResponse, # type: ignore
133
+ object_=_response.json(),
134
+ ),
135
+ ),
136
+ )
137
+ _response_json = _response.json()
138
+ except JSONDecodeError:
139
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
140
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
@@ -5,6 +5,7 @@ import typing
5
5
 
6
6
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
7
  from ..core.request_options import RequestOptions
8
+ from ..types.credit_balance_list_response import CreditBalanceListResponse
8
9
  from ..types.customer import Customer
9
10
  from ..types.customer_billing_address import CustomerBillingAddress
10
11
  from ..types.customer_creation_state import CustomerCreationState
@@ -435,6 +436,72 @@ class CustomersClient:
435
436
  _response = self._raw_client.delete_customer_by_external_id(external_id, request_options=request_options)
436
437
  return _response.data
437
438
 
439
+ def get_customer_credit_balances(
440
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
441
+ ) -> CreditBalanceListResponse:
442
+ """
443
+ Get current customer credit balances grouped by currency
444
+
445
+ Parameters
446
+ ----------
447
+ id : str
448
+
449
+ request_options : typing.Optional[RequestOptions]
450
+ Request-specific configuration.
451
+
452
+ Returns
453
+ -------
454
+ CreditBalanceListResponse
455
+ 200
456
+
457
+ Examples
458
+ --------
459
+ from paid import Paid
460
+
461
+ client = Paid(
462
+ token="YOUR_TOKEN",
463
+ )
464
+ client.customers.get_customer_credit_balances(
465
+ id="id",
466
+ )
467
+ """
468
+ _response = self._raw_client.get_customer_credit_balances(id, request_options=request_options)
469
+ return _response.data
470
+
471
+ def get_customer_credit_balances_by_external_id(
472
+ self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
473
+ ) -> CreditBalanceListResponse:
474
+ """
475
+ Get current customer credit balances grouped by currency, looked up by external ID
476
+
477
+ Parameters
478
+ ----------
479
+ external_id : str
480
+
481
+ request_options : typing.Optional[RequestOptions]
482
+ Request-specific configuration.
483
+
484
+ Returns
485
+ -------
486
+ CreditBalanceListResponse
487
+ 200
488
+
489
+ Examples
490
+ --------
491
+ from paid import Paid
492
+
493
+ client = Paid(
494
+ token="YOUR_TOKEN",
495
+ )
496
+ client.customers.get_customer_credit_balances_by_external_id(
497
+ external_id="externalId",
498
+ )
499
+ """
500
+ _response = self._raw_client.get_customer_credit_balances_by_external_id(
501
+ external_id, request_options=request_options
502
+ )
503
+ return _response.data
504
+
438
505
 
439
506
  class AsyncCustomersClient:
440
507
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -918,3 +985,85 @@ class AsyncCustomersClient:
918
985
  """
919
986
  _response = await self._raw_client.delete_customer_by_external_id(external_id, request_options=request_options)
920
987
  return _response.data
988
+
989
+ async def get_customer_credit_balances(
990
+ self, id: str, *, request_options: typing.Optional[RequestOptions] = None
991
+ ) -> CreditBalanceListResponse:
992
+ """
993
+ Get current customer credit balances grouped by currency
994
+
995
+ Parameters
996
+ ----------
997
+ id : str
998
+
999
+ request_options : typing.Optional[RequestOptions]
1000
+ Request-specific configuration.
1001
+
1002
+ Returns
1003
+ -------
1004
+ CreditBalanceListResponse
1005
+ 200
1006
+
1007
+ Examples
1008
+ --------
1009
+ import asyncio
1010
+
1011
+ from paid import AsyncPaid
1012
+
1013
+ client = AsyncPaid(
1014
+ token="YOUR_TOKEN",
1015
+ )
1016
+
1017
+
1018
+ async def main() -> None:
1019
+ await client.customers.get_customer_credit_balances(
1020
+ id="id",
1021
+ )
1022
+
1023
+
1024
+ asyncio.run(main())
1025
+ """
1026
+ _response = await self._raw_client.get_customer_credit_balances(id, request_options=request_options)
1027
+ return _response.data
1028
+
1029
+ async def get_customer_credit_balances_by_external_id(
1030
+ self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
1031
+ ) -> CreditBalanceListResponse:
1032
+ """
1033
+ Get current customer credit balances grouped by currency, looked up by external ID
1034
+
1035
+ Parameters
1036
+ ----------
1037
+ external_id : str
1038
+
1039
+ request_options : typing.Optional[RequestOptions]
1040
+ Request-specific configuration.
1041
+
1042
+ Returns
1043
+ -------
1044
+ CreditBalanceListResponse
1045
+ 200
1046
+
1047
+ Examples
1048
+ --------
1049
+ import asyncio
1050
+
1051
+ from paid import AsyncPaid
1052
+
1053
+ client = AsyncPaid(
1054
+ token="YOUR_TOKEN",
1055
+ )
1056
+
1057
+
1058
+ async def main() -> None:
1059
+ await client.customers.get_customer_credit_balances_by_external_id(
1060
+ external_id="externalId",
1061
+ )
1062
+
1063
+
1064
+ asyncio.run(main())
1065
+ """
1066
+ _response = await self._raw_client.get_customer_credit_balances_by_external_id(
1067
+ external_id, request_options=request_options
1068
+ )
1069
+ return _response.data