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