paid-python 1.0.0a0__py3-none-any.whl → 1.0.0a1__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 +415 -133
  4. paid/contacts/raw_client.py +1046 -118
  5. paid/core/client_wrapper.py +8 -10
  6. paid/customers/__init__.py +0 -3
  7. paid/customers/client.py +392 -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 +310 -201
  16. paid/orders/__init__.py +0 -3
  17. paid/orders/client.py +279 -471
  18. paid/orders/raw_client.py +551 -538
  19. paid/products/__init__.py +0 -3
  20. paid/products/client.py +129 -265
  21. paid/products/raw_client.py +563 -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.0a1.dist-info}/METADATA +22 -8
  68. paid_python-1.0.0a1.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.0a1.dist-info}/LICENSE +0 -0
  137. {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a1.dist-info}/WHEEL +0 -0
paid/products/client.py CHANGED
@@ -4,11 +4,9 @@ import typing
4
4
 
5
5
  from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
6
  from ..core.request_options import RequestOptions
7
- from ..types.agent_attribute import AgentAttribute
8
7
  from ..types.product import Product
9
- from ..types.product_update_type import ProductUpdateType
8
+ from ..types.product_list_response import ProductListResponse
10
9
  from .raw_client import AsyncRawProductsClient, RawProductsClient
11
- from .types.product_create_type import ProductCreateType
12
10
 
13
11
  # this is used as the default value for optional parameters
14
12
  OMIT = typing.cast(typing.Any, ...)
@@ -29,17 +27,29 @@ class ProductsClient:
29
27
  """
30
28
  return self._raw_client
31
29
 
32
- def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Product]:
30
+ def list_products(
31
+ self,
32
+ *,
33
+ limit: typing.Optional[int] = None,
34
+ offset: typing.Optional[int] = None,
35
+ request_options: typing.Optional[RequestOptions] = None,
36
+ ) -> ProductListResponse:
33
37
  """
38
+ Get a list of products for the organization
39
+
34
40
  Parameters
35
41
  ----------
42
+ limit : typing.Optional[int]
43
+
44
+ offset : typing.Optional[int]
45
+
36
46
  request_options : typing.Optional[RequestOptions]
37
47
  Request-specific configuration.
38
48
 
39
49
  Returns
40
50
  -------
41
- typing.List[Product]
42
- Success response
51
+ ProductListResponse
52
+ 200
43
53
 
44
54
  Examples
45
55
  --------
@@ -48,38 +58,37 @@ class ProductsClient:
48
58
  client = Paid(
49
59
  token="YOUR_TOKEN",
50
60
  )
51
- client.products.list()
61
+ client.products.list_products()
52
62
  """
53
- _response = self._raw_client.list(request_options=request_options)
63
+ _response = self._raw_client.list_products(limit=limit, offset=offset, request_options=request_options)
54
64
  return _response.data
55
65
 
56
- def create(
66
+ def create_a_new_product(
57
67
  self,
58
68
  *,
59
69
  name: str,
60
70
  description: typing.Optional[str] = OMIT,
61
- external_id: typing.Optional[str] = OMIT,
62
- type: typing.Optional[ProductCreateType] = OMIT,
63
71
  active: typing.Optional[bool] = OMIT,
64
72
  product_code: typing.Optional[str] = OMIT,
73
+ external_id: typing.Optional[str] = OMIT,
65
74
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
66
75
  request_options: typing.Optional[RequestOptions] = None,
67
76
  ) -> Product:
68
77
  """
78
+ Creates a new product for the organization
79
+
69
80
  Parameters
70
81
  ----------
71
82
  name : str
72
83
 
73
84
  description : typing.Optional[str]
74
85
 
75
- external_id : typing.Optional[str]
76
-
77
- type : typing.Optional[ProductCreateType]
78
-
79
86
  active : typing.Optional[bool]
80
87
 
81
88
  product_code : typing.Optional[str]
82
89
 
90
+ external_id : typing.Optional[str]
91
+
83
92
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
84
93
 
85
94
  request_options : typing.Optional[RequestOptions]
@@ -88,7 +97,7 @@ class ProductsClient:
88
97
  Returns
89
98
  -------
90
99
  Product
91
- Success response
100
+ 201
92
101
 
93
102
  Examples
94
103
  --------
@@ -97,30 +106,28 @@ class ProductsClient:
97
106
  client = Paid(
98
107
  token="YOUR_TOKEN",
99
108
  )
100
- client.products.create(
101
- name="Acme Product",
102
- description="Acme Product does amazing things.",
103
- external_id="acme-product",
104
- type="product",
109
+ client.products.create_a_new_product(
110
+ name="name",
105
111
  )
106
112
  """
107
- _response = self._raw_client.create(
113
+ _response = self._raw_client.create_a_new_product(
108
114
  name=name,
109
115
  description=description,
110
- external_id=external_id,
111
- type=type,
112
116
  active=active,
113
117
  product_code=product_code,
118
+ external_id=external_id,
114
119
  metadata=metadata,
115
120
  request_options=request_options,
116
121
  )
117
122
  return _response.data
118
123
 
119
- def get(self, product_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Product:
124
+ def get_product(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Product:
120
125
  """
126
+ Get a product by its ID
127
+
121
128
  Parameters
122
129
  ----------
123
- product_id : str
130
+ id : str
124
131
 
125
132
  request_options : typing.Optional[RequestOptions]
126
133
  Request-specific configuration.
@@ -128,7 +135,7 @@ class ProductsClient:
128
135
  Returns
129
136
  -------
130
137
  Product
131
- Success response
138
+ 200
132
139
 
133
140
  Examples
134
141
  --------
@@ -137,46 +144,41 @@ class ProductsClient:
137
144
  client = Paid(
138
145
  token="YOUR_TOKEN",
139
146
  )
140
- client.products.get(
141
- product_id="productId",
147
+ client.products.get_product(
148
+ id="id",
142
149
  )
143
150
  """
144
- _response = self._raw_client.get(product_id, request_options=request_options)
151
+ _response = self._raw_client.get_product(id, request_options=request_options)
145
152
  return _response.data
146
153
 
147
- def update(
154
+ def update_product(
148
155
  self,
149
- product_id: str,
156
+ id: str,
150
157
  *,
151
158
  name: typing.Optional[str] = OMIT,
152
159
  description: typing.Optional[str] = OMIT,
153
- external_id: typing.Optional[str] = OMIT,
154
- type: typing.Optional[ProductUpdateType] = OMIT,
155
160
  active: typing.Optional[bool] = OMIT,
156
161
  product_code: typing.Optional[str] = OMIT,
157
- product_attribute: typing.Optional[typing.Sequence[AgentAttribute]] = OMIT,
162
+ external_id: typing.Optional[str] = OMIT,
158
163
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
159
164
  request_options: typing.Optional[RequestOptions] = None,
160
165
  ) -> Product:
161
166
  """
167
+ Update a product by its ID
168
+
162
169
  Parameters
163
170
  ----------
164
- product_id : str
171
+ id : str
165
172
 
166
173
  name : typing.Optional[str]
167
174
 
168
175
  description : typing.Optional[str]
169
176
 
170
- external_id : typing.Optional[str]
171
-
172
- type : typing.Optional[ProductUpdateType]
173
-
174
177
  active : typing.Optional[bool]
175
178
 
176
179
  product_code : typing.Optional[str]
177
180
 
178
- product_attribute : typing.Optional[typing.Sequence[AgentAttribute]]
179
- Pricing attributes for this product
181
+ external_id : typing.Optional[str]
180
182
 
181
183
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
182
184
 
@@ -186,7 +188,7 @@ class ProductsClient:
186
188
  Returns
187
189
  -------
188
190
  Product
189
- Success response
191
+ 200
190
192
 
191
193
  Examples
192
194
  --------
@@ -195,55 +197,28 @@ class ProductsClient:
195
197
  client = Paid(
196
198
  token="YOUR_TOKEN",
197
199
  )
198
- client.products.update(
199
- product_id="productId",
200
+ client.products.update_product(
201
+ id="id",
200
202
  )
201
203
  """
202
- _response = self._raw_client.update(
203
- product_id,
204
+ _response = self._raw_client.update_product(
205
+ id,
204
206
  name=name,
205
207
  description=description,
206
- external_id=external_id,
207
- type=type,
208
208
  active=active,
209
209
  product_code=product_code,
210
- product_attribute=product_attribute,
210
+ external_id=external_id,
211
211
  metadata=metadata,
212
212
  request_options=request_options,
213
213
  )
214
214
  return _response.data
215
215
 
216
- def delete(self, product_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
217
- """
218
- Parameters
219
- ----------
220
- product_id : str
221
-
222
- request_options : typing.Optional[RequestOptions]
223
- Request-specific configuration.
224
-
225
- Returns
226
- -------
227
- None
228
-
229
- Examples
230
- --------
231
- from paid import Paid
232
-
233
- client = Paid(
234
- token="YOUR_TOKEN",
235
- )
236
- client.products.delete(
237
- product_id="productId",
238
- )
239
- """
240
- _response = self._raw_client.delete(product_id, request_options=request_options)
241
- return _response.data
242
-
243
- def get_by_external_id(
216
+ def get_product_by_external_id(
244
217
  self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
245
218
  ) -> Product:
246
219
  """
220
+ Get a product by its externalId
221
+
247
222
  Parameters
248
223
  ----------
249
224
  external_id : str
@@ -254,7 +229,7 @@ class ProductsClient:
254
229
  Returns
255
230
  -------
256
231
  Product
257
- Success response
232
+ 200
258
233
 
259
234
  Examples
260
235
  --------
@@ -263,28 +238,28 @@ class ProductsClient:
263
238
  client = Paid(
264
239
  token="YOUR_TOKEN",
265
240
  )
266
- client.products.get_by_external_id(
241
+ client.products.get_product_by_external_id(
267
242
  external_id="externalId",
268
243
  )
269
244
  """
270
- _response = self._raw_client.get_by_external_id(external_id, request_options=request_options)
245
+ _response = self._raw_client.get_product_by_external_id(external_id, request_options=request_options)
271
246
  return _response.data
272
247
 
273
- def update_by_external_id(
248
+ def update_product_by_external_id(
274
249
  self,
275
250
  external_id_: str,
276
251
  *,
277
252
  name: typing.Optional[str] = OMIT,
278
253
  description: typing.Optional[str] = OMIT,
279
- external_id: typing.Optional[str] = OMIT,
280
- type: typing.Optional[ProductUpdateType] = OMIT,
281
254
  active: typing.Optional[bool] = OMIT,
282
255
  product_code: typing.Optional[str] = OMIT,
283
- product_attribute: typing.Optional[typing.Sequence[AgentAttribute]] = OMIT,
256
+ external_id: typing.Optional[str] = OMIT,
284
257
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
285
258
  request_options: typing.Optional[RequestOptions] = None,
286
259
  ) -> Product:
287
260
  """
261
+ Update a product by its externalId
262
+
288
263
  Parameters
289
264
  ----------
290
265
  external_id_ : str
@@ -293,16 +268,11 @@ class ProductsClient:
293
268
 
294
269
  description : typing.Optional[str]
295
270
 
296
- external_id : typing.Optional[str]
297
-
298
- type : typing.Optional[ProductUpdateType]
299
-
300
271
  active : typing.Optional[bool]
301
272
 
302
273
  product_code : typing.Optional[str]
303
274
 
304
- product_attribute : typing.Optional[typing.Sequence[AgentAttribute]]
305
- Pricing attributes for this product
275
+ external_id : typing.Optional[str]
306
276
 
307
277
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
308
278
 
@@ -312,7 +282,7 @@ class ProductsClient:
312
282
  Returns
313
283
  -------
314
284
  Product
315
- Success response
285
+ 200
316
286
 
317
287
  Examples
318
288
  --------
@@ -321,53 +291,22 @@ class ProductsClient:
321
291
  client = Paid(
322
292
  token="YOUR_TOKEN",
323
293
  )
324
- client.products.update_by_external_id(
294
+ client.products.update_product_by_external_id(
325
295
  external_id_="externalId",
326
296
  )
327
297
  """
328
- _response = self._raw_client.update_by_external_id(
298
+ _response = self._raw_client.update_product_by_external_id(
329
299
  external_id_,
330
300
  name=name,
331
301
  description=description,
332
- external_id=external_id,
333
- type=type,
334
302
  active=active,
335
303
  product_code=product_code,
336
- product_attribute=product_attribute,
304
+ external_id=external_id,
337
305
  metadata=metadata,
338
306
  request_options=request_options,
339
307
  )
340
308
  return _response.data
341
309
 
342
- def delete_by_external_id(
343
- self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
344
- ) -> None:
345
- """
346
- Parameters
347
- ----------
348
- external_id : str
349
-
350
- request_options : typing.Optional[RequestOptions]
351
- Request-specific configuration.
352
-
353
- Returns
354
- -------
355
- None
356
-
357
- Examples
358
- --------
359
- from paid import Paid
360
-
361
- client = Paid(
362
- token="YOUR_TOKEN",
363
- )
364
- client.products.delete_by_external_id(
365
- external_id="externalId",
366
- )
367
- """
368
- _response = self._raw_client.delete_by_external_id(external_id, request_options=request_options)
369
- return _response.data
370
-
371
310
 
372
311
  class AsyncProductsClient:
373
312
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -384,17 +323,29 @@ class AsyncProductsClient:
384
323
  """
385
324
  return self._raw_client
386
325
 
387
- async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Product]:
326
+ async def list_products(
327
+ self,
328
+ *,
329
+ limit: typing.Optional[int] = None,
330
+ offset: typing.Optional[int] = None,
331
+ request_options: typing.Optional[RequestOptions] = None,
332
+ ) -> ProductListResponse:
388
333
  """
334
+ Get a list of products for the organization
335
+
389
336
  Parameters
390
337
  ----------
338
+ limit : typing.Optional[int]
339
+
340
+ offset : typing.Optional[int]
341
+
391
342
  request_options : typing.Optional[RequestOptions]
392
343
  Request-specific configuration.
393
344
 
394
345
  Returns
395
346
  -------
396
- typing.List[Product]
397
- Success response
347
+ ProductListResponse
348
+ 200
398
349
 
399
350
  Examples
400
351
  --------
@@ -408,41 +359,40 @@ class AsyncProductsClient:
408
359
 
409
360
 
410
361
  async def main() -> None:
411
- await client.products.list()
362
+ await client.products.list_products()
412
363
 
413
364
 
414
365
  asyncio.run(main())
415
366
  """
416
- _response = await self._raw_client.list(request_options=request_options)
367
+ _response = await self._raw_client.list_products(limit=limit, offset=offset, request_options=request_options)
417
368
  return _response.data
418
369
 
419
- async def create(
370
+ async def create_a_new_product(
420
371
  self,
421
372
  *,
422
373
  name: str,
423
374
  description: typing.Optional[str] = OMIT,
424
- external_id: typing.Optional[str] = OMIT,
425
- type: typing.Optional[ProductCreateType] = OMIT,
426
375
  active: typing.Optional[bool] = OMIT,
427
376
  product_code: typing.Optional[str] = OMIT,
377
+ external_id: typing.Optional[str] = OMIT,
428
378
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
429
379
  request_options: typing.Optional[RequestOptions] = None,
430
380
  ) -> Product:
431
381
  """
382
+ Creates a new product for the organization
383
+
432
384
  Parameters
433
385
  ----------
434
386
  name : str
435
387
 
436
388
  description : typing.Optional[str]
437
389
 
438
- external_id : typing.Optional[str]
439
-
440
- type : typing.Optional[ProductCreateType]
441
-
442
390
  active : typing.Optional[bool]
443
391
 
444
392
  product_code : typing.Optional[str]
445
393
 
394
+ external_id : typing.Optional[str]
395
+
446
396
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
447
397
 
448
398
  request_options : typing.Optional[RequestOptions]
@@ -451,7 +401,7 @@ class AsyncProductsClient:
451
401
  Returns
452
402
  -------
453
403
  Product
454
- Success response
404
+ 201
455
405
 
456
406
  Examples
457
407
  --------
@@ -465,33 +415,31 @@ class AsyncProductsClient:
465
415
 
466
416
 
467
417
  async def main() -> None:
468
- await client.products.create(
469
- name="Acme Product",
470
- description="Acme Product does amazing things.",
471
- external_id="acme-product",
472
- type="product",
418
+ await client.products.create_a_new_product(
419
+ name="name",
473
420
  )
474
421
 
475
422
 
476
423
  asyncio.run(main())
477
424
  """
478
- _response = await self._raw_client.create(
425
+ _response = await self._raw_client.create_a_new_product(
479
426
  name=name,
480
427
  description=description,
481
- external_id=external_id,
482
- type=type,
483
428
  active=active,
484
429
  product_code=product_code,
430
+ external_id=external_id,
485
431
  metadata=metadata,
486
432
  request_options=request_options,
487
433
  )
488
434
  return _response.data
489
435
 
490
- async def get(self, product_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Product:
436
+ async def get_product(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Product:
491
437
  """
438
+ Get a product by its ID
439
+
492
440
  Parameters
493
441
  ----------
494
- product_id : str
442
+ id : str
495
443
 
496
444
  request_options : typing.Optional[RequestOptions]
497
445
  Request-specific configuration.
@@ -499,7 +447,7 @@ class AsyncProductsClient:
499
447
  Returns
500
448
  -------
501
449
  Product
502
- Success response
450
+ 200
503
451
 
504
452
  Examples
505
453
  --------
@@ -513,49 +461,44 @@ class AsyncProductsClient:
513
461
 
514
462
 
515
463
  async def main() -> None:
516
- await client.products.get(
517
- product_id="productId",
464
+ await client.products.get_product(
465
+ id="id",
518
466
  )
519
467
 
520
468
 
521
469
  asyncio.run(main())
522
470
  """
523
- _response = await self._raw_client.get(product_id, request_options=request_options)
471
+ _response = await self._raw_client.get_product(id, request_options=request_options)
524
472
  return _response.data
525
473
 
526
- async def update(
474
+ async def update_product(
527
475
  self,
528
- product_id: str,
476
+ id: str,
529
477
  *,
530
478
  name: typing.Optional[str] = OMIT,
531
479
  description: typing.Optional[str] = OMIT,
532
- external_id: typing.Optional[str] = OMIT,
533
- type: typing.Optional[ProductUpdateType] = OMIT,
534
480
  active: typing.Optional[bool] = OMIT,
535
481
  product_code: typing.Optional[str] = OMIT,
536
- product_attribute: typing.Optional[typing.Sequence[AgentAttribute]] = OMIT,
482
+ external_id: typing.Optional[str] = OMIT,
537
483
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
538
484
  request_options: typing.Optional[RequestOptions] = None,
539
485
  ) -> Product:
540
486
  """
487
+ Update a product by its ID
488
+
541
489
  Parameters
542
490
  ----------
543
- product_id : str
491
+ id : str
544
492
 
545
493
  name : typing.Optional[str]
546
494
 
547
495
  description : typing.Optional[str]
548
496
 
549
- external_id : typing.Optional[str]
550
-
551
- type : typing.Optional[ProductUpdateType]
552
-
553
497
  active : typing.Optional[bool]
554
498
 
555
499
  product_code : typing.Optional[str]
556
500
 
557
- product_attribute : typing.Optional[typing.Sequence[AgentAttribute]]
558
- Pricing attributes for this product
501
+ external_id : typing.Optional[str]
559
502
 
560
503
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
561
504
 
@@ -565,7 +508,7 @@ class AsyncProductsClient:
565
508
  Returns
566
509
  -------
567
510
  Product
568
- Success response
511
+ 200
569
512
 
570
513
  Examples
571
514
  --------
@@ -579,66 +522,31 @@ class AsyncProductsClient:
579
522
 
580
523
 
581
524
  async def main() -> None:
582
- await client.products.update(
583
- product_id="productId",
525
+ await client.products.update_product(
526
+ id="id",
584
527
  )
585
528
 
586
529
 
587
530
  asyncio.run(main())
588
531
  """
589
- _response = await self._raw_client.update(
590
- product_id,
532
+ _response = await self._raw_client.update_product(
533
+ id,
591
534
  name=name,
592
535
  description=description,
593
- external_id=external_id,
594
- type=type,
595
536
  active=active,
596
537
  product_code=product_code,
597
- product_attribute=product_attribute,
538
+ external_id=external_id,
598
539
  metadata=metadata,
599
540
  request_options=request_options,
600
541
  )
601
542
  return _response.data
602
543
 
603
- async def delete(self, product_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
604
- """
605
- Parameters
606
- ----------
607
- product_id : str
608
-
609
- request_options : typing.Optional[RequestOptions]
610
- Request-specific configuration.
611
-
612
- Returns
613
- -------
614
- None
615
-
616
- Examples
617
- --------
618
- import asyncio
619
-
620
- from paid import AsyncPaid
621
-
622
- client = AsyncPaid(
623
- token="YOUR_TOKEN",
624
- )
625
-
626
-
627
- async def main() -> None:
628
- await client.products.delete(
629
- product_id="productId",
630
- )
631
-
632
-
633
- asyncio.run(main())
634
- """
635
- _response = await self._raw_client.delete(product_id, request_options=request_options)
636
- return _response.data
637
-
638
- async def get_by_external_id(
544
+ async def get_product_by_external_id(
639
545
  self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
640
546
  ) -> Product:
641
547
  """
548
+ Get a product by its externalId
549
+
642
550
  Parameters
643
551
  ----------
644
552
  external_id : str
@@ -649,7 +557,7 @@ class AsyncProductsClient:
649
557
  Returns
650
558
  -------
651
559
  Product
652
- Success response
560
+ 200
653
561
 
654
562
  Examples
655
563
  --------
@@ -663,31 +571,31 @@ class AsyncProductsClient:
663
571
 
664
572
 
665
573
  async def main() -> None:
666
- await client.products.get_by_external_id(
574
+ await client.products.get_product_by_external_id(
667
575
  external_id="externalId",
668
576
  )
669
577
 
670
578
 
671
579
  asyncio.run(main())
672
580
  """
673
- _response = await self._raw_client.get_by_external_id(external_id, request_options=request_options)
581
+ _response = await self._raw_client.get_product_by_external_id(external_id, request_options=request_options)
674
582
  return _response.data
675
583
 
676
- async def update_by_external_id(
584
+ async def update_product_by_external_id(
677
585
  self,
678
586
  external_id_: str,
679
587
  *,
680
588
  name: typing.Optional[str] = OMIT,
681
589
  description: typing.Optional[str] = OMIT,
682
- external_id: typing.Optional[str] = OMIT,
683
- type: typing.Optional[ProductUpdateType] = OMIT,
684
590
  active: typing.Optional[bool] = OMIT,
685
591
  product_code: typing.Optional[str] = OMIT,
686
- product_attribute: typing.Optional[typing.Sequence[AgentAttribute]] = OMIT,
592
+ external_id: typing.Optional[str] = OMIT,
687
593
  metadata: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT,
688
594
  request_options: typing.Optional[RequestOptions] = None,
689
595
  ) -> Product:
690
596
  """
597
+ Update a product by its externalId
598
+
691
599
  Parameters
692
600
  ----------
693
601
  external_id_ : str
@@ -696,16 +604,11 @@ class AsyncProductsClient:
696
604
 
697
605
  description : typing.Optional[str]
698
606
 
699
- external_id : typing.Optional[str]
700
-
701
- type : typing.Optional[ProductUpdateType]
702
-
703
607
  active : typing.Optional[bool]
704
608
 
705
609
  product_code : typing.Optional[str]
706
610
 
707
- product_attribute : typing.Optional[typing.Sequence[AgentAttribute]]
708
- Pricing attributes for this product
611
+ external_id : typing.Optional[str]
709
612
 
710
613
  metadata : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]
711
614
 
@@ -715,7 +618,7 @@ class AsyncProductsClient:
715
618
  Returns
716
619
  -------
717
620
  Product
718
- Success response
621
+ 200
719
622
 
720
623
  Examples
721
624
  --------
@@ -729,60 +632,21 @@ class AsyncProductsClient:
729
632
 
730
633
 
731
634
  async def main() -> None:
732
- await client.products.update_by_external_id(
635
+ await client.products.update_product_by_external_id(
733
636
  external_id_="externalId",
734
637
  )
735
638
 
736
639
 
737
640
  asyncio.run(main())
738
641
  """
739
- _response = await self._raw_client.update_by_external_id(
642
+ _response = await self._raw_client.update_product_by_external_id(
740
643
  external_id_,
741
644
  name=name,
742
645
  description=description,
743
- external_id=external_id,
744
- type=type,
745
646
  active=active,
746
647
  product_code=product_code,
747
- product_attribute=product_attribute,
648
+ external_id=external_id,
748
649
  metadata=metadata,
749
650
  request_options=request_options,
750
651
  )
751
652
  return _response.data
752
-
753
- async def delete_by_external_id(
754
- self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
755
- ) -> None:
756
- """
757
- Parameters
758
- ----------
759
- external_id : str
760
-
761
- request_options : typing.Optional[RequestOptions]
762
- Request-specific configuration.
763
-
764
- Returns
765
- -------
766
- None
767
-
768
- Examples
769
- --------
770
- import asyncio
771
-
772
- from paid import AsyncPaid
773
-
774
- client = AsyncPaid(
775
- token="YOUR_TOKEN",
776
- )
777
-
778
-
779
- async def main() -> None:
780
- await client.products.delete_by_external_id(
781
- external_id="externalId",
782
- )
783
-
784
-
785
- asyncio.run(main())
786
- """
787
- _response = await self._raw_client.delete_by_external_id(external_id, request_options=request_options)
788
- return _response.data