paid-python 0.6.0__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.
- paid/__init__.py +65 -95
- paid/client.py +17 -494
- paid/contacts/client.py +415 -133
- paid/contacts/raw_client.py +1046 -118
- paid/core/client_wrapper.py +9 -10
- paid/customers/client.py +270 -566
- paid/customers/raw_client.py +731 -537
- paid/environment.py +1 -1
- paid/errors/bad_request_error.py +2 -2
- paid/errors/forbidden_error.py +2 -2
- paid/errors/internal_server_error.py +2 -2
- paid/errors/not_found_error.py +2 -2
- paid/invoices/client.py +369 -0
- paid/invoices/raw_client.py +692 -0
- paid/orders/__init__.py +0 -3
- paid/orders/client.py +371 -128
- paid/orders/raw_client.py +829 -121
- paid/products/__init__.py +0 -3
- paid/products/client.py +129 -265
- paid/products/raw_client.py +563 -233
- paid/signals/client.py +130 -0
- paid/signals/raw_client.py +190 -0
- paid/tracing/autoinstrumentation.py +12 -6
- paid/tracing/context_manager.py +2 -6
- paid/tracing/distributed_tracing.py +3 -3
- paid/tracing/signal.py +3 -3
- paid/tracing/wrappers/openai_agents/openaiAgentsHook.py +1 -1
- paid/types/__init__.py +62 -86
- paid/types/attribution.py +8 -0
- paid/types/{agent_attribute.py → bulk_signals_response.py} +4 -5
- paid/types/contact.py +12 -20
- paid/types/{address.py → contact_billing_address.py} +6 -7
- paid/types/{traces_response.py → contact_list_response.py} +5 -9
- paid/types/customer.py +15 -22
- paid/types/customer_attribution.py +8 -0
- paid/types/customer_billing_address.py +26 -0
- paid/types/{usage_summary_order.py → customer_by_external_id.py} +3 -5
- paid/types/{usage_summary_order_line.py → customer_by_id.py} +3 -5
- paid/types/customer_creation_state.py +5 -0
- paid/types/customer_list_response.py +22 -0
- paid/types/empty_response.py +17 -0
- paid/types/{error.py → error_response.py} +4 -7
- paid/types/invoice.py +57 -0
- paid/types/invoice_line.py +42 -0
- paid/types/invoice_line_payment_status.py +7 -0
- paid/types/invoice_lines_response.py +22 -0
- paid/types/invoice_list_response.py +22 -0
- paid/types/invoice_payment_status.py +5 -0
- paid/types/invoice_source.py +5 -0
- paid/types/invoice_status.py +7 -0
- paid/types/invoice_tax_status.py +7 -0
- paid/types/order.py +30 -29
- paid/types/order_creation_state.py +5 -0
- paid/types/order_line.py +6 -24
- paid/types/order_lines_response.py +22 -0
- paid/types/order_list_response.py +22 -0
- paid/types/pagination.py +24 -0
- paid/types/product.py +4 -29
- paid/types/{tier.py → product_by_external_id.py} +5 -4
- paid/types/{cost_amount.py → product_by_id.py} +5 -12
- paid/types/product_list_response.py +22 -0
- paid/types/signal.py +8 -34
- paid/types/{agent.py → update_contact_request.py} +10 -11
- paid/types/update_customer_request.py +38 -0
- paid/types/{product_update.py → update_product_request.py} +2 -12
- {paid_python-0.6.0.dist-info → paid_python-1.0.0a1.dist-info}/METADATA +27 -11
- paid_python-1.0.0a1.dist-info/RECORD +110 -0
- opentelemetry/instrumentation/openai/__init__.py +0 -54
- opentelemetry/instrumentation/openai/shared/__init__.py +0 -399
- opentelemetry/instrumentation/openai/shared/audio_wrappers.py +0 -247
- opentelemetry/instrumentation/openai/shared/chat_wrappers.py +0 -1192
- opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -292
- opentelemetry/instrumentation/openai/shared/config.py +0 -15
- opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +0 -311
- opentelemetry/instrumentation/openai/shared/event_emitter.py +0 -108
- opentelemetry/instrumentation/openai/shared/event_models.py +0 -41
- opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -68
- opentelemetry/instrumentation/openai/shared/span_utils.py +0 -0
- opentelemetry/instrumentation/openai/utils.py +0 -213
- opentelemetry/instrumentation/openai/v0/__init__.py +0 -176
- opentelemetry/instrumentation/openai/v1/__init__.py +0 -394
- opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -329
- opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +0 -134
- opentelemetry/instrumentation/openai/v1/responses_wrappers.py +0 -1113
- opentelemetry/instrumentation/openai/version.py +0 -1
- paid/agents/client.py +0 -880
- paid/agents/raw_client.py +0 -785
- paid/orders/lines/client.py +0 -144
- paid/orders/lines/raw_client.py +0 -129
- paid/plans/__init__.py +0 -4
- paid/plans/client.py +0 -332
- paid/plans/raw_client.py +0 -464
- paid/products/types/__init__.py +0 -7
- paid/products/types/product_create_type.py +0 -5
- paid/traces/__init__.py +0 -4
- paid/traces/client.py +0 -218
- paid/traces/raw_client.py +0 -226
- paid/types/agent_price_point.py +0 -27
- paid/types/agent_price_point_tiers.py +0 -23
- paid/types/agent_update.py +0 -29
- paid/types/api_error.py +0 -29
- paid/types/billing_frequency.py +0 -5
- paid/types/charge_type.py +0 -5
- paid/types/cost_trace.py +0 -55
- paid/types/cost_traces_response.py +0 -26
- paid/types/creation_source.py +0 -5
- paid/types/creation_state.py +0 -5
- paid/types/customer_update.py +0 -40
- paid/types/entitlement_usage.py +0 -48
- paid/types/order_line_attribute.py +0 -27
- paid/types/order_line_attribute_create_one.py +0 -5
- paid/types/order_line_attribute_pricing.py +0 -33
- paid/types/order_line_create.py +0 -72
- paid/types/pagination_meta.py +0 -84
- paid/types/plan.py +0 -81
- paid/types/plan_group.py +0 -60
- paid/types/plan_plan_products_item.py +0 -35
- paid/types/plan_plan_products_item_plan_product_attribute_item.py +0 -34
- paid/types/price_point.py +0 -25
- paid/types/pricing.py +0 -31
- paid/types/pricing_model_type.py +0 -7
- paid/types/product_type.py +0 -5
- paid/types/product_update_type.py +0 -5
- paid/types/salutation.py +0 -5
- paid/types/signal_v_2.py +0 -56
- paid/types/tax_exempt_status.py +0 -5
- paid/types/trace.py +0 -69
- paid/types/usage_pagination_meta.py +0 -43
- paid/types/usage_summaries_response.py +0 -26
- paid/types/usage_summary.py +0 -121
- paid/usage/__init__.py +0 -7
- paid/usage/client.py +0 -321
- paid/usage/raw_client.py +0 -387
- paid/usage/types/__init__.py +0 -7
- paid/usage/types/usage_check_usage_response.py +0 -53
- paid_python-0.6.0.dist-info/RECORD +0 -153
- /paid/{agents → invoices}/__init__.py +0 -0
- /paid/{orders/lines → signals}/__init__.py +0 -0
- {paid_python-0.6.0.dist-info → paid_python-1.0.0a1.dist-info}/LICENSE +0 -0
- {paid_python-0.6.0.dist-info → paid_python-1.0.0a1.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.
|
|
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
|
|
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
|
-
|
|
40
|
-
|
|
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.
|
|
63
|
+
client.contacts.list_contacts()
|
|
50
64
|
"""
|
|
51
|
-
_response = self._raw_client.
|
|
65
|
+
_response = self._raw_client.list_contacts(limit=limit, offset=offset, request_options=request_options)
|
|
52
66
|
return _response.data
|
|
53
67
|
|
|
54
|
-
def
|
|
68
|
+
def create_a_new_contact(
|
|
55
69
|
self,
|
|
56
70
|
*,
|
|
57
|
-
|
|
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
|
-
|
|
66
|
-
|
|
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
|
-
|
|
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
|
-
|
|
99
|
+
request_options : typing.Optional[RequestOptions]
|
|
100
|
+
Request-specific configuration.
|
|
86
101
|
|
|
87
|
-
|
|
102
|
+
Returns
|
|
103
|
+
-------
|
|
104
|
+
Contact
|
|
105
|
+
201
|
|
88
106
|
|
|
89
|
-
|
|
107
|
+
Examples
|
|
108
|
+
--------
|
|
109
|
+
from paid import Paid
|
|
110
|
+
|
|
111
|
+
client = Paid(
|
|
112
|
+
token="YOUR_TOKEN",
|
|
113
|
+
)
|
|
114
|
+
client.contacts.create_a_new_contact(
|
|
115
|
+
customer_id="customerId",
|
|
116
|
+
first_name="firstName",
|
|
117
|
+
last_name="lastName",
|
|
118
|
+
email="email",
|
|
119
|
+
)
|
|
120
|
+
"""
|
|
121
|
+
_response = self._raw_client.create_a_new_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(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Contact:
|
|
134
|
+
"""
|
|
135
|
+
Get a contact by its ID
|
|
90
136
|
|
|
91
|
-
|
|
137
|
+
Parameters
|
|
138
|
+
----------
|
|
139
|
+
id : str
|
|
92
140
|
|
|
93
|
-
|
|
141
|
+
request_options : typing.Optional[RequestOptions]
|
|
142
|
+
Request-specific configuration.
|
|
94
143
|
|
|
95
|
-
|
|
144
|
+
Returns
|
|
145
|
+
-------
|
|
146
|
+
Contact
|
|
147
|
+
200
|
|
96
148
|
|
|
97
|
-
|
|
149
|
+
Examples
|
|
150
|
+
--------
|
|
151
|
+
from paid import Paid
|
|
98
152
|
|
|
99
|
-
|
|
153
|
+
client = Paid(
|
|
154
|
+
token="YOUR_TOKEN",
|
|
155
|
+
)
|
|
156
|
+
client.contacts.get_contact(
|
|
157
|
+
id="id",
|
|
158
|
+
)
|
|
159
|
+
"""
|
|
160
|
+
_response = self._raw_client.get_contact(id, request_options=request_options)
|
|
161
|
+
return _response.data
|
|
162
|
+
|
|
163
|
+
def update_contact(
|
|
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
|
-
|
|
203
|
+
200
|
|
108
204
|
|
|
109
205
|
Examples
|
|
110
206
|
--------
|
|
@@ -113,45 +209,38 @@ class ContactsClient:
|
|
|
113
209
|
client = Paid(
|
|
114
210
|
token="YOUR_TOKEN",
|
|
115
211
|
)
|
|
116
|
-
client.contacts.
|
|
117
|
-
|
|
118
|
-
salutation="Mr.",
|
|
119
|
-
first_name="John",
|
|
120
|
-
last_name="Doe",
|
|
121
|
-
email="john.doe@example.com",
|
|
212
|
+
client.contacts.update_contact(
|
|
213
|
+
id="id",
|
|
122
214
|
)
|
|
123
215
|
"""
|
|
124
|
-
_response = self._raw_client.
|
|
125
|
-
|
|
216
|
+
_response = self._raw_client.update_contact(
|
|
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
|
-
|
|
134
|
-
|
|
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
|
|
229
|
+
def delete_contact(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> EmptyResponse:
|
|
143
230
|
"""
|
|
231
|
+
Delete a contact by its ID
|
|
232
|
+
|
|
144
233
|
Parameters
|
|
145
234
|
----------
|
|
146
|
-
|
|
235
|
+
id : str
|
|
147
236
|
|
|
148
237
|
request_options : typing.Optional[RequestOptions]
|
|
149
238
|
Request-specific configuration.
|
|
150
239
|
|
|
151
240
|
Returns
|
|
152
241
|
-------
|
|
153
|
-
|
|
154
|
-
|
|
242
|
+
EmptyResponse
|
|
243
|
+
200
|
|
155
244
|
|
|
156
245
|
Examples
|
|
157
246
|
--------
|
|
@@ -160,25 +249,30 @@ class ContactsClient:
|
|
|
160
249
|
client = Paid(
|
|
161
250
|
token="YOUR_TOKEN",
|
|
162
251
|
)
|
|
163
|
-
client.contacts.
|
|
164
|
-
|
|
252
|
+
client.contacts.delete_contact(
|
|
253
|
+
id="id",
|
|
165
254
|
)
|
|
166
255
|
"""
|
|
167
|
-
_response = self._raw_client.
|
|
256
|
+
_response = self._raw_client.delete_contact(id, request_options=request_options)
|
|
168
257
|
return _response.data
|
|
169
258
|
|
|
170
|
-
def
|
|
259
|
+
def get_contact_by_external_id(
|
|
260
|
+
self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
261
|
+
) -> Contact:
|
|
171
262
|
"""
|
|
263
|
+
Get a contact by its externalId
|
|
264
|
+
|
|
172
265
|
Parameters
|
|
173
266
|
----------
|
|
174
|
-
|
|
267
|
+
external_id : str
|
|
175
268
|
|
|
176
269
|
request_options : typing.Optional[RequestOptions]
|
|
177
270
|
Request-specific configuration.
|
|
178
271
|
|
|
179
272
|
Returns
|
|
180
273
|
-------
|
|
181
|
-
|
|
274
|
+
Contact
|
|
275
|
+
200
|
|
182
276
|
|
|
183
277
|
Examples
|
|
184
278
|
--------
|
|
@@ -187,20 +281,46 @@ class ContactsClient:
|
|
|
187
281
|
client = Paid(
|
|
188
282
|
token="YOUR_TOKEN",
|
|
189
283
|
)
|
|
190
|
-
client.contacts.
|
|
191
|
-
|
|
284
|
+
client.contacts.get_contact_by_external_id(
|
|
285
|
+
external_id="externalId",
|
|
192
286
|
)
|
|
193
287
|
"""
|
|
194
|
-
_response = self._raw_client.
|
|
288
|
+
_response = self._raw_client.get_contact_by_external_id(external_id, request_options=request_options)
|
|
195
289
|
return _response.data
|
|
196
290
|
|
|
197
|
-
def
|
|
198
|
-
self,
|
|
291
|
+
def update_contact_by_external_id(
|
|
292
|
+
self,
|
|
293
|
+
external_id_: str,
|
|
294
|
+
*,
|
|
295
|
+
customer_id: typing.Optional[str] = OMIT,
|
|
296
|
+
first_name: typing.Optional[str] = OMIT,
|
|
297
|
+
last_name: typing.Optional[str] = OMIT,
|
|
298
|
+
email: typing.Optional[str] = OMIT,
|
|
299
|
+
phone: typing.Optional[str] = OMIT,
|
|
300
|
+
billing_address: typing.Optional[ContactBillingAddress] = OMIT,
|
|
301
|
+
external_id: typing.Optional[str] = OMIT,
|
|
302
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
199
303
|
) -> Contact:
|
|
200
304
|
"""
|
|
305
|
+
Update a contact by its externalId
|
|
306
|
+
|
|
201
307
|
Parameters
|
|
202
308
|
----------
|
|
203
|
-
|
|
309
|
+
external_id_ : str
|
|
310
|
+
|
|
311
|
+
customer_id : typing.Optional[str]
|
|
312
|
+
|
|
313
|
+
first_name : typing.Optional[str]
|
|
314
|
+
|
|
315
|
+
last_name : typing.Optional[str]
|
|
316
|
+
|
|
317
|
+
email : typing.Optional[str]
|
|
318
|
+
|
|
319
|
+
phone : typing.Optional[str]
|
|
320
|
+
|
|
321
|
+
billing_address : typing.Optional[ContactBillingAddress]
|
|
322
|
+
|
|
323
|
+
external_id : typing.Optional[str]
|
|
204
324
|
|
|
205
325
|
request_options : typing.Optional[RequestOptions]
|
|
206
326
|
Request-specific configuration.
|
|
@@ -208,7 +328,7 @@ class ContactsClient:
|
|
|
208
328
|
Returns
|
|
209
329
|
-------
|
|
210
330
|
Contact
|
|
211
|
-
|
|
331
|
+
200
|
|
212
332
|
|
|
213
333
|
Examples
|
|
214
334
|
--------
|
|
@@ -217,17 +337,29 @@ class ContactsClient:
|
|
|
217
337
|
client = Paid(
|
|
218
338
|
token="YOUR_TOKEN",
|
|
219
339
|
)
|
|
220
|
-
client.contacts.
|
|
221
|
-
|
|
340
|
+
client.contacts.update_contact_by_external_id(
|
|
341
|
+
external_id_="externalId",
|
|
222
342
|
)
|
|
223
343
|
"""
|
|
224
|
-
_response = self._raw_client.
|
|
344
|
+
_response = self._raw_client.update_contact_by_external_id(
|
|
345
|
+
external_id_,
|
|
346
|
+
customer_id=customer_id,
|
|
347
|
+
first_name=first_name,
|
|
348
|
+
last_name=last_name,
|
|
349
|
+
email=email,
|
|
350
|
+
phone=phone,
|
|
351
|
+
billing_address=billing_address,
|
|
352
|
+
external_id=external_id,
|
|
353
|
+
request_options=request_options,
|
|
354
|
+
)
|
|
225
355
|
return _response.data
|
|
226
356
|
|
|
227
|
-
def
|
|
357
|
+
def delete_contact_by_external_id(
|
|
228
358
|
self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
229
|
-
) ->
|
|
359
|
+
) -> EmptyResponse:
|
|
230
360
|
"""
|
|
361
|
+
Delete a contact by its externalId
|
|
362
|
+
|
|
231
363
|
Parameters
|
|
232
364
|
----------
|
|
233
365
|
external_id : str
|
|
@@ -237,7 +369,8 @@ class ContactsClient:
|
|
|
237
369
|
|
|
238
370
|
Returns
|
|
239
371
|
-------
|
|
240
|
-
|
|
372
|
+
EmptyResponse
|
|
373
|
+
200
|
|
241
374
|
|
|
242
375
|
Examples
|
|
243
376
|
--------
|
|
@@ -246,11 +379,11 @@ class ContactsClient:
|
|
|
246
379
|
client = Paid(
|
|
247
380
|
token="YOUR_TOKEN",
|
|
248
381
|
)
|
|
249
|
-
client.contacts.
|
|
382
|
+
client.contacts.delete_contact_by_external_id(
|
|
250
383
|
external_id="externalId",
|
|
251
384
|
)
|
|
252
385
|
"""
|
|
253
|
-
_response = self._raw_client.
|
|
386
|
+
_response = self._raw_client.delete_contact_by_external_id(external_id, request_options=request_options)
|
|
254
387
|
return _response.data
|
|
255
388
|
|
|
256
389
|
|
|
@@ -269,17 +402,29 @@ class AsyncContactsClient:
|
|
|
269
402
|
"""
|
|
270
403
|
return self._raw_client
|
|
271
404
|
|
|
272
|
-
async def
|
|
405
|
+
async def list_contacts(
|
|
406
|
+
self,
|
|
407
|
+
*,
|
|
408
|
+
limit: typing.Optional[int] = None,
|
|
409
|
+
offset: typing.Optional[int] = None,
|
|
410
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
411
|
+
) -> ContactListResponse:
|
|
273
412
|
"""
|
|
413
|
+
Get a list of contacts for the organization
|
|
414
|
+
|
|
274
415
|
Parameters
|
|
275
416
|
----------
|
|
417
|
+
limit : typing.Optional[int]
|
|
418
|
+
|
|
419
|
+
offset : typing.Optional[int]
|
|
420
|
+
|
|
276
421
|
request_options : typing.Optional[RequestOptions]
|
|
277
422
|
Request-specific configuration.
|
|
278
423
|
|
|
279
424
|
Returns
|
|
280
425
|
-------
|
|
281
|
-
|
|
282
|
-
|
|
426
|
+
ContactListResponse
|
|
427
|
+
200
|
|
283
428
|
|
|
284
429
|
Examples
|
|
285
430
|
--------
|
|
@@ -293,36 +438,32 @@ class AsyncContactsClient:
|
|
|
293
438
|
|
|
294
439
|
|
|
295
440
|
async def main() -> None:
|
|
296
|
-
await client.contacts.
|
|
441
|
+
await client.contacts.list_contacts()
|
|
297
442
|
|
|
298
443
|
|
|
299
444
|
asyncio.run(main())
|
|
300
445
|
"""
|
|
301
|
-
_response = await self._raw_client.
|
|
446
|
+
_response = await self._raw_client.list_contacts(limit=limit, offset=offset, request_options=request_options)
|
|
302
447
|
return _response.data
|
|
303
448
|
|
|
304
|
-
async def
|
|
449
|
+
async def create_a_new_contact(
|
|
305
450
|
self,
|
|
306
451
|
*,
|
|
307
|
-
|
|
452
|
+
customer_id: str,
|
|
308
453
|
first_name: str,
|
|
309
454
|
last_name: str,
|
|
310
455
|
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
456
|
phone: typing.Optional[str] = OMIT,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
billing_state_province: typing.Optional[str] = OMIT,
|
|
318
|
-
billing_country: typing.Optional[str] = OMIT,
|
|
319
|
-
billing_postal_code: typing.Optional[str] = OMIT,
|
|
457
|
+
billing_address: typing.Optional[ContactBillingAddress] = OMIT,
|
|
458
|
+
external_id: typing.Optional[str] = OMIT,
|
|
320
459
|
request_options: typing.Optional[RequestOptions] = None,
|
|
321
460
|
) -> Contact:
|
|
322
461
|
"""
|
|
462
|
+
Creates a new contact for the organization
|
|
463
|
+
|
|
323
464
|
Parameters
|
|
324
465
|
----------
|
|
325
|
-
|
|
466
|
+
customer_id : str
|
|
326
467
|
|
|
327
468
|
first_name : str
|
|
328
469
|
|
|
@@ -330,23 +471,61 @@ class AsyncContactsClient:
|
|
|
330
471
|
|
|
331
472
|
email : str
|
|
332
473
|
|
|
474
|
+
phone : typing.Optional[str]
|
|
475
|
+
|
|
476
|
+
billing_address : typing.Optional[ContactBillingAddress]
|
|
477
|
+
|
|
333
478
|
external_id : typing.Optional[str]
|
|
334
479
|
|
|
335
|
-
|
|
480
|
+
request_options : typing.Optional[RequestOptions]
|
|
481
|
+
Request-specific configuration.
|
|
336
482
|
|
|
337
|
-
|
|
483
|
+
Returns
|
|
484
|
+
-------
|
|
485
|
+
Contact
|
|
486
|
+
201
|
|
487
|
+
|
|
488
|
+
Examples
|
|
489
|
+
--------
|
|
490
|
+
import asyncio
|
|
491
|
+
|
|
492
|
+
from paid import AsyncPaid
|
|
493
|
+
|
|
494
|
+
client = AsyncPaid(
|
|
495
|
+
token="YOUR_TOKEN",
|
|
496
|
+
)
|
|
338
497
|
|
|
339
|
-
phone : typing.Optional[str]
|
|
340
498
|
|
|
341
|
-
|
|
499
|
+
async def main() -> None:
|
|
500
|
+
await client.contacts.create_a_new_contact(
|
|
501
|
+
customer_id="customerId",
|
|
502
|
+
first_name="firstName",
|
|
503
|
+
last_name="lastName",
|
|
504
|
+
email="email",
|
|
505
|
+
)
|
|
342
506
|
|
|
343
|
-
billing_city : typing.Optional[str]
|
|
344
507
|
|
|
345
|
-
|
|
508
|
+
asyncio.run(main())
|
|
509
|
+
"""
|
|
510
|
+
_response = await self._raw_client.create_a_new_contact(
|
|
511
|
+
customer_id=customer_id,
|
|
512
|
+
first_name=first_name,
|
|
513
|
+
last_name=last_name,
|
|
514
|
+
email=email,
|
|
515
|
+
phone=phone,
|
|
516
|
+
billing_address=billing_address,
|
|
517
|
+
external_id=external_id,
|
|
518
|
+
request_options=request_options,
|
|
519
|
+
)
|
|
520
|
+
return _response.data
|
|
346
521
|
|
|
347
|
-
|
|
522
|
+
async def get_contact(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Contact:
|
|
523
|
+
"""
|
|
524
|
+
Get a contact by its ID
|
|
348
525
|
|
|
349
|
-
|
|
526
|
+
Parameters
|
|
527
|
+
----------
|
|
528
|
+
id : str
|
|
350
529
|
|
|
351
530
|
request_options : typing.Optional[RequestOptions]
|
|
352
531
|
Request-specific configuration.
|
|
@@ -354,7 +533,7 @@ class AsyncContactsClient:
|
|
|
354
533
|
Returns
|
|
355
534
|
-------
|
|
356
535
|
Contact
|
|
357
|
-
|
|
536
|
+
200
|
|
358
537
|
|
|
359
538
|
Examples
|
|
360
539
|
--------
|
|
@@ -368,48 +547,107 @@ class AsyncContactsClient:
|
|
|
368
547
|
|
|
369
548
|
|
|
370
549
|
async def main() -> None:
|
|
371
|
-
await client.contacts.
|
|
372
|
-
|
|
373
|
-
salutation="Mr.",
|
|
374
|
-
first_name="John",
|
|
375
|
-
last_name="Doe",
|
|
376
|
-
email="john.doe@example.com",
|
|
550
|
+
await client.contacts.get_contact(
|
|
551
|
+
id="id",
|
|
377
552
|
)
|
|
378
553
|
|
|
379
554
|
|
|
380
555
|
asyncio.run(main())
|
|
381
556
|
"""
|
|
382
|
-
_response = await self._raw_client.
|
|
383
|
-
|
|
557
|
+
_response = await self._raw_client.get_contact(id, request_options=request_options)
|
|
558
|
+
return _response.data
|
|
559
|
+
|
|
560
|
+
async def update_contact(
|
|
561
|
+
self,
|
|
562
|
+
id: str,
|
|
563
|
+
*,
|
|
564
|
+
customer_id: typing.Optional[str] = OMIT,
|
|
565
|
+
first_name: typing.Optional[str] = OMIT,
|
|
566
|
+
last_name: typing.Optional[str] = OMIT,
|
|
567
|
+
email: typing.Optional[str] = OMIT,
|
|
568
|
+
phone: typing.Optional[str] = OMIT,
|
|
569
|
+
billing_address: typing.Optional[ContactBillingAddress] = OMIT,
|
|
570
|
+
external_id: typing.Optional[str] = OMIT,
|
|
571
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
572
|
+
) -> Contact:
|
|
573
|
+
"""
|
|
574
|
+
Update a contact by its ID
|
|
575
|
+
|
|
576
|
+
Parameters
|
|
577
|
+
----------
|
|
578
|
+
id : str
|
|
579
|
+
|
|
580
|
+
customer_id : typing.Optional[str]
|
|
581
|
+
|
|
582
|
+
first_name : typing.Optional[str]
|
|
583
|
+
|
|
584
|
+
last_name : typing.Optional[str]
|
|
585
|
+
|
|
586
|
+
email : typing.Optional[str]
|
|
587
|
+
|
|
588
|
+
phone : typing.Optional[str]
|
|
589
|
+
|
|
590
|
+
billing_address : typing.Optional[ContactBillingAddress]
|
|
591
|
+
|
|
592
|
+
external_id : typing.Optional[str]
|
|
593
|
+
|
|
594
|
+
request_options : typing.Optional[RequestOptions]
|
|
595
|
+
Request-specific configuration.
|
|
596
|
+
|
|
597
|
+
Returns
|
|
598
|
+
-------
|
|
599
|
+
Contact
|
|
600
|
+
200
|
|
601
|
+
|
|
602
|
+
Examples
|
|
603
|
+
--------
|
|
604
|
+
import asyncio
|
|
605
|
+
|
|
606
|
+
from paid import AsyncPaid
|
|
607
|
+
|
|
608
|
+
client = AsyncPaid(
|
|
609
|
+
token="YOUR_TOKEN",
|
|
610
|
+
)
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
async def main() -> None:
|
|
614
|
+
await client.contacts.update_contact(
|
|
615
|
+
id="id",
|
|
616
|
+
)
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
asyncio.run(main())
|
|
620
|
+
"""
|
|
621
|
+
_response = await self._raw_client.update_contact(
|
|
622
|
+
id,
|
|
623
|
+
customer_id=customer_id,
|
|
384
624
|
first_name=first_name,
|
|
385
625
|
last_name=last_name,
|
|
386
626
|
email=email,
|
|
387
|
-
external_id=external_id,
|
|
388
|
-
customer_id=customer_id,
|
|
389
|
-
customer_external_id=customer_external_id,
|
|
390
627
|
phone=phone,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
billing_state_province=billing_state_province,
|
|
394
|
-
billing_country=billing_country,
|
|
395
|
-
billing_postal_code=billing_postal_code,
|
|
628
|
+
billing_address=billing_address,
|
|
629
|
+
external_id=external_id,
|
|
396
630
|
request_options=request_options,
|
|
397
631
|
)
|
|
398
632
|
return _response.data
|
|
399
633
|
|
|
400
|
-
async def
|
|
634
|
+
async def delete_contact(
|
|
635
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
636
|
+
) -> EmptyResponse:
|
|
401
637
|
"""
|
|
638
|
+
Delete a contact by its ID
|
|
639
|
+
|
|
402
640
|
Parameters
|
|
403
641
|
----------
|
|
404
|
-
|
|
642
|
+
id : str
|
|
405
643
|
|
|
406
644
|
request_options : typing.Optional[RequestOptions]
|
|
407
645
|
Request-specific configuration.
|
|
408
646
|
|
|
409
647
|
Returns
|
|
410
648
|
-------
|
|
411
|
-
|
|
412
|
-
|
|
649
|
+
EmptyResponse
|
|
650
|
+
200
|
|
413
651
|
|
|
414
652
|
Examples
|
|
415
653
|
--------
|
|
@@ -423,28 +661,33 @@ class AsyncContactsClient:
|
|
|
423
661
|
|
|
424
662
|
|
|
425
663
|
async def main() -> None:
|
|
426
|
-
await client.contacts.
|
|
427
|
-
|
|
664
|
+
await client.contacts.delete_contact(
|
|
665
|
+
id="id",
|
|
428
666
|
)
|
|
429
667
|
|
|
430
668
|
|
|
431
669
|
asyncio.run(main())
|
|
432
670
|
"""
|
|
433
|
-
_response = await self._raw_client.
|
|
671
|
+
_response = await self._raw_client.delete_contact(id, request_options=request_options)
|
|
434
672
|
return _response.data
|
|
435
673
|
|
|
436
|
-
async def
|
|
674
|
+
async def get_contact_by_external_id(
|
|
675
|
+
self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
676
|
+
) -> Contact:
|
|
437
677
|
"""
|
|
678
|
+
Get a contact by its externalId
|
|
679
|
+
|
|
438
680
|
Parameters
|
|
439
681
|
----------
|
|
440
|
-
|
|
682
|
+
external_id : str
|
|
441
683
|
|
|
442
684
|
request_options : typing.Optional[RequestOptions]
|
|
443
685
|
Request-specific configuration.
|
|
444
686
|
|
|
445
687
|
Returns
|
|
446
688
|
-------
|
|
447
|
-
|
|
689
|
+
Contact
|
|
690
|
+
200
|
|
448
691
|
|
|
449
692
|
Examples
|
|
450
693
|
--------
|
|
@@ -458,23 +701,49 @@ class AsyncContactsClient:
|
|
|
458
701
|
|
|
459
702
|
|
|
460
703
|
async def main() -> None:
|
|
461
|
-
await client.contacts.
|
|
462
|
-
|
|
704
|
+
await client.contacts.get_contact_by_external_id(
|
|
705
|
+
external_id="externalId",
|
|
463
706
|
)
|
|
464
707
|
|
|
465
708
|
|
|
466
709
|
asyncio.run(main())
|
|
467
710
|
"""
|
|
468
|
-
_response = await self._raw_client.
|
|
711
|
+
_response = await self._raw_client.get_contact_by_external_id(external_id, request_options=request_options)
|
|
469
712
|
return _response.data
|
|
470
713
|
|
|
471
|
-
async def
|
|
472
|
-
self,
|
|
714
|
+
async def update_contact_by_external_id(
|
|
715
|
+
self,
|
|
716
|
+
external_id_: str,
|
|
717
|
+
*,
|
|
718
|
+
customer_id: typing.Optional[str] = OMIT,
|
|
719
|
+
first_name: typing.Optional[str] = OMIT,
|
|
720
|
+
last_name: typing.Optional[str] = OMIT,
|
|
721
|
+
email: typing.Optional[str] = OMIT,
|
|
722
|
+
phone: typing.Optional[str] = OMIT,
|
|
723
|
+
billing_address: typing.Optional[ContactBillingAddress] = OMIT,
|
|
724
|
+
external_id: typing.Optional[str] = OMIT,
|
|
725
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
473
726
|
) -> Contact:
|
|
474
727
|
"""
|
|
728
|
+
Update a contact by its externalId
|
|
729
|
+
|
|
475
730
|
Parameters
|
|
476
731
|
----------
|
|
477
|
-
|
|
732
|
+
external_id_ : str
|
|
733
|
+
|
|
734
|
+
customer_id : typing.Optional[str]
|
|
735
|
+
|
|
736
|
+
first_name : typing.Optional[str]
|
|
737
|
+
|
|
738
|
+
last_name : typing.Optional[str]
|
|
739
|
+
|
|
740
|
+
email : typing.Optional[str]
|
|
741
|
+
|
|
742
|
+
phone : typing.Optional[str]
|
|
743
|
+
|
|
744
|
+
billing_address : typing.Optional[ContactBillingAddress]
|
|
745
|
+
|
|
746
|
+
external_id : typing.Optional[str]
|
|
478
747
|
|
|
479
748
|
request_options : typing.Optional[RequestOptions]
|
|
480
749
|
Request-specific configuration.
|
|
@@ -482,7 +751,7 @@ class AsyncContactsClient:
|
|
|
482
751
|
Returns
|
|
483
752
|
-------
|
|
484
753
|
Contact
|
|
485
|
-
|
|
754
|
+
200
|
|
486
755
|
|
|
487
756
|
Examples
|
|
488
757
|
--------
|
|
@@ -496,20 +765,32 @@ class AsyncContactsClient:
|
|
|
496
765
|
|
|
497
766
|
|
|
498
767
|
async def main() -> None:
|
|
499
|
-
await client.contacts.
|
|
500
|
-
|
|
768
|
+
await client.contacts.update_contact_by_external_id(
|
|
769
|
+
external_id_="externalId",
|
|
501
770
|
)
|
|
502
771
|
|
|
503
772
|
|
|
504
773
|
asyncio.run(main())
|
|
505
774
|
"""
|
|
506
|
-
_response = await self._raw_client.
|
|
775
|
+
_response = await self._raw_client.update_contact_by_external_id(
|
|
776
|
+
external_id_,
|
|
777
|
+
customer_id=customer_id,
|
|
778
|
+
first_name=first_name,
|
|
779
|
+
last_name=last_name,
|
|
780
|
+
email=email,
|
|
781
|
+
phone=phone,
|
|
782
|
+
billing_address=billing_address,
|
|
783
|
+
external_id=external_id,
|
|
784
|
+
request_options=request_options,
|
|
785
|
+
)
|
|
507
786
|
return _response.data
|
|
508
787
|
|
|
509
|
-
async def
|
|
788
|
+
async def delete_contact_by_external_id(
|
|
510
789
|
self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
511
|
-
) ->
|
|
790
|
+
) -> EmptyResponse:
|
|
512
791
|
"""
|
|
792
|
+
Delete a contact by its externalId
|
|
793
|
+
|
|
513
794
|
Parameters
|
|
514
795
|
----------
|
|
515
796
|
external_id : str
|
|
@@ -519,7 +800,8 @@ class AsyncContactsClient:
|
|
|
519
800
|
|
|
520
801
|
Returns
|
|
521
802
|
-------
|
|
522
|
-
|
|
803
|
+
EmptyResponse
|
|
804
|
+
200
|
|
523
805
|
|
|
524
806
|
Examples
|
|
525
807
|
--------
|
|
@@ -533,12 +815,12 @@ class AsyncContactsClient:
|
|
|
533
815
|
|
|
534
816
|
|
|
535
817
|
async def main() -> None:
|
|
536
|
-
await client.contacts.
|
|
818
|
+
await client.contacts.delete_contact_by_external_id(
|
|
537
819
|
external_id="externalId",
|
|
538
820
|
)
|
|
539
821
|
|
|
540
822
|
|
|
541
823
|
asyncio.run(main())
|
|
542
824
|
"""
|
|
543
|
-
_response = await self._raw_client.
|
|
825
|
+
_response = await self._raw_client.delete_contact_by_external_id(external_id, request_options=request_options)
|
|
544
826
|
return _response.data
|