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/agents/client.py
DELETED
|
@@ -1,880 +0,0 @@
|
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
3
|
-
import typing
|
|
4
|
-
|
|
5
|
-
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
-
from ..core.request_options import RequestOptions
|
|
7
|
-
from ..types.agent import Agent
|
|
8
|
-
from ..types.agent_attribute import AgentAttribute
|
|
9
|
-
from .raw_client import AsyncRawAgentsClient, RawAgentsClient
|
|
10
|
-
|
|
11
|
-
# this is used as the default value for optional parameters
|
|
12
|
-
OMIT = typing.cast(typing.Any, ...)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class AgentsClient:
|
|
16
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
17
|
-
self._raw_client = RawAgentsClient(client_wrapper=client_wrapper)
|
|
18
|
-
|
|
19
|
-
@property
|
|
20
|
-
def with_raw_response(self) -> RawAgentsClient:
|
|
21
|
-
"""
|
|
22
|
-
Retrieves a raw implementation of this client that returns raw responses.
|
|
23
|
-
|
|
24
|
-
Returns
|
|
25
|
-
-------
|
|
26
|
-
RawAgentsClient
|
|
27
|
-
"""
|
|
28
|
-
return self._raw_client
|
|
29
|
-
|
|
30
|
-
def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Agent]:
|
|
31
|
-
"""
|
|
32
|
-
DEPRECATED: Use /products instead. Agents are now products with type='agent'.
|
|
33
|
-
|
|
34
|
-
Parameters
|
|
35
|
-
----------
|
|
36
|
-
request_options : typing.Optional[RequestOptions]
|
|
37
|
-
Request-specific configuration.
|
|
38
|
-
|
|
39
|
-
Returns
|
|
40
|
-
-------
|
|
41
|
-
typing.List[Agent]
|
|
42
|
-
Success response
|
|
43
|
-
|
|
44
|
-
Examples
|
|
45
|
-
--------
|
|
46
|
-
from paid import Paid
|
|
47
|
-
|
|
48
|
-
client = Paid(
|
|
49
|
-
token="YOUR_TOKEN",
|
|
50
|
-
)
|
|
51
|
-
client.agents.list()
|
|
52
|
-
"""
|
|
53
|
-
_response = self._raw_client.list(request_options=request_options)
|
|
54
|
-
return _response.data
|
|
55
|
-
|
|
56
|
-
def create(
|
|
57
|
-
self,
|
|
58
|
-
*,
|
|
59
|
-
name: str,
|
|
60
|
-
description: str,
|
|
61
|
-
agent_code: typing.Optional[str] = OMIT,
|
|
62
|
-
external_id: typing.Optional[str] = OMIT,
|
|
63
|
-
active: typing.Optional[bool] = OMIT,
|
|
64
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
65
|
-
) -> Agent:
|
|
66
|
-
"""
|
|
67
|
-
DEPRECATED: Use POST /products instead.
|
|
68
|
-
|
|
69
|
-
Parameters
|
|
70
|
-
----------
|
|
71
|
-
name : str
|
|
72
|
-
|
|
73
|
-
description : str
|
|
74
|
-
|
|
75
|
-
agent_code : typing.Optional[str]
|
|
76
|
-
|
|
77
|
-
external_id : typing.Optional[str]
|
|
78
|
-
|
|
79
|
-
active : typing.Optional[bool]
|
|
80
|
-
|
|
81
|
-
request_options : typing.Optional[RequestOptions]
|
|
82
|
-
Request-specific configuration.
|
|
83
|
-
|
|
84
|
-
Returns
|
|
85
|
-
-------
|
|
86
|
-
Agent
|
|
87
|
-
Success response
|
|
88
|
-
|
|
89
|
-
Examples
|
|
90
|
-
--------
|
|
91
|
-
from paid import Paid
|
|
92
|
-
|
|
93
|
-
client = Paid(
|
|
94
|
-
token="YOUR_TOKEN",
|
|
95
|
-
)
|
|
96
|
-
client.agents.create(
|
|
97
|
-
name="Acme Agent",
|
|
98
|
-
description="Acme Agent is an AI agent that does things.",
|
|
99
|
-
external_id="acme-agent",
|
|
100
|
-
)
|
|
101
|
-
"""
|
|
102
|
-
_response = self._raw_client.create(
|
|
103
|
-
name=name,
|
|
104
|
-
description=description,
|
|
105
|
-
agent_code=agent_code,
|
|
106
|
-
external_id=external_id,
|
|
107
|
-
active=active,
|
|
108
|
-
request_options=request_options,
|
|
109
|
-
)
|
|
110
|
-
return _response.data
|
|
111
|
-
|
|
112
|
-
def get(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Agent:
|
|
113
|
-
"""
|
|
114
|
-
DEPRECATED: Use GET /products/{productId} instead.
|
|
115
|
-
|
|
116
|
-
Parameters
|
|
117
|
-
----------
|
|
118
|
-
agent_id : str
|
|
119
|
-
|
|
120
|
-
request_options : typing.Optional[RequestOptions]
|
|
121
|
-
Request-specific configuration.
|
|
122
|
-
|
|
123
|
-
Returns
|
|
124
|
-
-------
|
|
125
|
-
Agent
|
|
126
|
-
Success response
|
|
127
|
-
|
|
128
|
-
Examples
|
|
129
|
-
--------
|
|
130
|
-
from paid import Paid
|
|
131
|
-
|
|
132
|
-
client = Paid(
|
|
133
|
-
token="YOUR_TOKEN",
|
|
134
|
-
)
|
|
135
|
-
client.agents.get(
|
|
136
|
-
agent_id="agentId",
|
|
137
|
-
)
|
|
138
|
-
"""
|
|
139
|
-
_response = self._raw_client.get(agent_id, request_options=request_options)
|
|
140
|
-
return _response.data
|
|
141
|
-
|
|
142
|
-
def update(
|
|
143
|
-
self,
|
|
144
|
-
agent_id: str,
|
|
145
|
-
*,
|
|
146
|
-
name: typing.Optional[str] = OMIT,
|
|
147
|
-
description: typing.Optional[str] = OMIT,
|
|
148
|
-
external_id: typing.Optional[str] = OMIT,
|
|
149
|
-
active: typing.Optional[bool] = OMIT,
|
|
150
|
-
agent_code: typing.Optional[str] = OMIT,
|
|
151
|
-
agent_attributes: typing.Optional[typing.Sequence[AgentAttribute]] = OMIT,
|
|
152
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
153
|
-
) -> Agent:
|
|
154
|
-
"""
|
|
155
|
-
DEPRECATED: Use PUT /products/{productId} instead.
|
|
156
|
-
|
|
157
|
-
Parameters
|
|
158
|
-
----------
|
|
159
|
-
agent_id : str
|
|
160
|
-
|
|
161
|
-
name : typing.Optional[str]
|
|
162
|
-
|
|
163
|
-
description : typing.Optional[str]
|
|
164
|
-
|
|
165
|
-
external_id : typing.Optional[str]
|
|
166
|
-
|
|
167
|
-
active : typing.Optional[bool]
|
|
168
|
-
|
|
169
|
-
agent_code : typing.Optional[str]
|
|
170
|
-
|
|
171
|
-
agent_attributes : typing.Optional[typing.Sequence[AgentAttribute]]
|
|
172
|
-
|
|
173
|
-
request_options : typing.Optional[RequestOptions]
|
|
174
|
-
Request-specific configuration.
|
|
175
|
-
|
|
176
|
-
Returns
|
|
177
|
-
-------
|
|
178
|
-
Agent
|
|
179
|
-
Success response
|
|
180
|
-
|
|
181
|
-
Examples
|
|
182
|
-
--------
|
|
183
|
-
from paid import (
|
|
184
|
-
AgentAttribute,
|
|
185
|
-
AgentPricePoint,
|
|
186
|
-
AgentPricePointTiers,
|
|
187
|
-
Paid,
|
|
188
|
-
Pricing,
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
client = Paid(
|
|
192
|
-
token="YOUR_TOKEN",
|
|
193
|
-
)
|
|
194
|
-
client.agents.update(
|
|
195
|
-
agent_id="agentId",
|
|
196
|
-
name="Acme Agent (Updated)",
|
|
197
|
-
agent_attributes=[
|
|
198
|
-
AgentAttribute(
|
|
199
|
-
name="Emails sent signal",
|
|
200
|
-
active=True,
|
|
201
|
-
pricing=Pricing(
|
|
202
|
-
event_name="emails_sent",
|
|
203
|
-
taxable=True,
|
|
204
|
-
charge_type="usage",
|
|
205
|
-
pricing_model="PerUnit",
|
|
206
|
-
billing_frequency="monthly",
|
|
207
|
-
price_points={
|
|
208
|
-
"USD": AgentPricePoint(
|
|
209
|
-
tiers=[
|
|
210
|
-
AgentPricePointTiers(
|
|
211
|
-
min_quantity=0.0,
|
|
212
|
-
max_quantity=10.0,
|
|
213
|
-
unit_price=100.0,
|
|
214
|
-
),
|
|
215
|
-
AgentPricePointTiers(
|
|
216
|
-
min_quantity=11.0,
|
|
217
|
-
max_quantity=100.0,
|
|
218
|
-
unit_price=90.0,
|
|
219
|
-
),
|
|
220
|
-
AgentPricePointTiers(
|
|
221
|
-
min_quantity=101.0,
|
|
222
|
-
unit_price=80.0,
|
|
223
|
-
),
|
|
224
|
-
],
|
|
225
|
-
)
|
|
226
|
-
},
|
|
227
|
-
),
|
|
228
|
-
)
|
|
229
|
-
],
|
|
230
|
-
)
|
|
231
|
-
"""
|
|
232
|
-
_response = self._raw_client.update(
|
|
233
|
-
agent_id,
|
|
234
|
-
name=name,
|
|
235
|
-
description=description,
|
|
236
|
-
external_id=external_id,
|
|
237
|
-
active=active,
|
|
238
|
-
agent_code=agent_code,
|
|
239
|
-
agent_attributes=agent_attributes,
|
|
240
|
-
request_options=request_options,
|
|
241
|
-
)
|
|
242
|
-
return _response.data
|
|
243
|
-
|
|
244
|
-
def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
245
|
-
"""
|
|
246
|
-
DEPRECATED: Use DELETE /products/{productId} instead.
|
|
247
|
-
|
|
248
|
-
Parameters
|
|
249
|
-
----------
|
|
250
|
-
agent_id : str
|
|
251
|
-
|
|
252
|
-
request_options : typing.Optional[RequestOptions]
|
|
253
|
-
Request-specific configuration.
|
|
254
|
-
|
|
255
|
-
Returns
|
|
256
|
-
-------
|
|
257
|
-
None
|
|
258
|
-
|
|
259
|
-
Examples
|
|
260
|
-
--------
|
|
261
|
-
from paid import Paid
|
|
262
|
-
|
|
263
|
-
client = Paid(
|
|
264
|
-
token="YOUR_TOKEN",
|
|
265
|
-
)
|
|
266
|
-
client.agents.delete(
|
|
267
|
-
agent_id="agentId",
|
|
268
|
-
)
|
|
269
|
-
"""
|
|
270
|
-
_response = self._raw_client.delete(agent_id, request_options=request_options)
|
|
271
|
-
return _response.data
|
|
272
|
-
|
|
273
|
-
def get_by_external_id(self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Agent:
|
|
274
|
-
"""
|
|
275
|
-
DEPRECATED: Use GET /products/external/{externalId} instead.
|
|
276
|
-
|
|
277
|
-
Parameters
|
|
278
|
-
----------
|
|
279
|
-
external_id : str
|
|
280
|
-
|
|
281
|
-
request_options : typing.Optional[RequestOptions]
|
|
282
|
-
Request-specific configuration.
|
|
283
|
-
|
|
284
|
-
Returns
|
|
285
|
-
-------
|
|
286
|
-
Agent
|
|
287
|
-
Success response
|
|
288
|
-
|
|
289
|
-
Examples
|
|
290
|
-
--------
|
|
291
|
-
from paid import Paid
|
|
292
|
-
|
|
293
|
-
client = Paid(
|
|
294
|
-
token="YOUR_TOKEN",
|
|
295
|
-
)
|
|
296
|
-
client.agents.get_by_external_id(
|
|
297
|
-
external_id="externalId",
|
|
298
|
-
)
|
|
299
|
-
"""
|
|
300
|
-
_response = self._raw_client.get_by_external_id(external_id, request_options=request_options)
|
|
301
|
-
return _response.data
|
|
302
|
-
|
|
303
|
-
def update_by_external_id(
|
|
304
|
-
self,
|
|
305
|
-
external_id_: str,
|
|
306
|
-
*,
|
|
307
|
-
name: typing.Optional[str] = OMIT,
|
|
308
|
-
description: typing.Optional[str] = OMIT,
|
|
309
|
-
external_id: typing.Optional[str] = OMIT,
|
|
310
|
-
active: typing.Optional[bool] = OMIT,
|
|
311
|
-
agent_code: typing.Optional[str] = OMIT,
|
|
312
|
-
agent_attributes: typing.Optional[typing.Sequence[AgentAttribute]] = OMIT,
|
|
313
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
314
|
-
) -> Agent:
|
|
315
|
-
"""
|
|
316
|
-
DEPRECATED: Use PUT /products/external/{externalId} instead.
|
|
317
|
-
|
|
318
|
-
Parameters
|
|
319
|
-
----------
|
|
320
|
-
external_id_ : str
|
|
321
|
-
|
|
322
|
-
name : typing.Optional[str]
|
|
323
|
-
|
|
324
|
-
description : typing.Optional[str]
|
|
325
|
-
|
|
326
|
-
external_id : typing.Optional[str]
|
|
327
|
-
|
|
328
|
-
active : typing.Optional[bool]
|
|
329
|
-
|
|
330
|
-
agent_code : typing.Optional[str]
|
|
331
|
-
|
|
332
|
-
agent_attributes : typing.Optional[typing.Sequence[AgentAttribute]]
|
|
333
|
-
|
|
334
|
-
request_options : typing.Optional[RequestOptions]
|
|
335
|
-
Request-specific configuration.
|
|
336
|
-
|
|
337
|
-
Returns
|
|
338
|
-
-------
|
|
339
|
-
Agent
|
|
340
|
-
Success response
|
|
341
|
-
|
|
342
|
-
Examples
|
|
343
|
-
--------
|
|
344
|
-
from paid import AgentAttribute, AgentPricePoint, Paid, Pricing
|
|
345
|
-
|
|
346
|
-
client = Paid(
|
|
347
|
-
token="YOUR_TOKEN",
|
|
348
|
-
)
|
|
349
|
-
client.agents.update_by_external_id(
|
|
350
|
-
external_id_="externalId",
|
|
351
|
-
name="Acme Agent (Updated)",
|
|
352
|
-
agent_attributes=[
|
|
353
|
-
AgentAttribute(
|
|
354
|
-
name="Emails sent signal",
|
|
355
|
-
active=True,
|
|
356
|
-
pricing=Pricing(
|
|
357
|
-
event_name="emails_sent",
|
|
358
|
-
taxable=True,
|
|
359
|
-
charge_type="usage",
|
|
360
|
-
pricing_model="PerUnit",
|
|
361
|
-
billing_frequency="monthly",
|
|
362
|
-
price_points={
|
|
363
|
-
"USD": AgentPricePoint(
|
|
364
|
-
unit_price=150.0,
|
|
365
|
-
)
|
|
366
|
-
},
|
|
367
|
-
),
|
|
368
|
-
)
|
|
369
|
-
],
|
|
370
|
-
)
|
|
371
|
-
"""
|
|
372
|
-
_response = self._raw_client.update_by_external_id(
|
|
373
|
-
external_id_,
|
|
374
|
-
name=name,
|
|
375
|
-
description=description,
|
|
376
|
-
external_id=external_id,
|
|
377
|
-
active=active,
|
|
378
|
-
agent_code=agent_code,
|
|
379
|
-
agent_attributes=agent_attributes,
|
|
380
|
-
request_options=request_options,
|
|
381
|
-
)
|
|
382
|
-
return _response.data
|
|
383
|
-
|
|
384
|
-
def delete_by_external_id(
|
|
385
|
-
self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
386
|
-
) -> None:
|
|
387
|
-
"""
|
|
388
|
-
DEPRECATED: Use DELETE /products/external/{externalId} instead.
|
|
389
|
-
|
|
390
|
-
Parameters
|
|
391
|
-
----------
|
|
392
|
-
external_id : str
|
|
393
|
-
|
|
394
|
-
request_options : typing.Optional[RequestOptions]
|
|
395
|
-
Request-specific configuration.
|
|
396
|
-
|
|
397
|
-
Returns
|
|
398
|
-
-------
|
|
399
|
-
None
|
|
400
|
-
|
|
401
|
-
Examples
|
|
402
|
-
--------
|
|
403
|
-
from paid import Paid
|
|
404
|
-
|
|
405
|
-
client = Paid(
|
|
406
|
-
token="YOUR_TOKEN",
|
|
407
|
-
)
|
|
408
|
-
client.agents.delete_by_external_id(
|
|
409
|
-
external_id="externalId",
|
|
410
|
-
)
|
|
411
|
-
"""
|
|
412
|
-
_response = self._raw_client.delete_by_external_id(external_id, request_options=request_options)
|
|
413
|
-
return _response.data
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
class AsyncAgentsClient:
|
|
417
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
418
|
-
self._raw_client = AsyncRawAgentsClient(client_wrapper=client_wrapper)
|
|
419
|
-
|
|
420
|
-
@property
|
|
421
|
-
def with_raw_response(self) -> AsyncRawAgentsClient:
|
|
422
|
-
"""
|
|
423
|
-
Retrieves a raw implementation of this client that returns raw responses.
|
|
424
|
-
|
|
425
|
-
Returns
|
|
426
|
-
-------
|
|
427
|
-
AsyncRawAgentsClient
|
|
428
|
-
"""
|
|
429
|
-
return self._raw_client
|
|
430
|
-
|
|
431
|
-
async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[Agent]:
|
|
432
|
-
"""
|
|
433
|
-
DEPRECATED: Use /products instead. Agents are now products with type='agent'.
|
|
434
|
-
|
|
435
|
-
Parameters
|
|
436
|
-
----------
|
|
437
|
-
request_options : typing.Optional[RequestOptions]
|
|
438
|
-
Request-specific configuration.
|
|
439
|
-
|
|
440
|
-
Returns
|
|
441
|
-
-------
|
|
442
|
-
typing.List[Agent]
|
|
443
|
-
Success response
|
|
444
|
-
|
|
445
|
-
Examples
|
|
446
|
-
--------
|
|
447
|
-
import asyncio
|
|
448
|
-
|
|
449
|
-
from paid import AsyncPaid
|
|
450
|
-
|
|
451
|
-
client = AsyncPaid(
|
|
452
|
-
token="YOUR_TOKEN",
|
|
453
|
-
)
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
async def main() -> None:
|
|
457
|
-
await client.agents.list()
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
asyncio.run(main())
|
|
461
|
-
"""
|
|
462
|
-
_response = await self._raw_client.list(request_options=request_options)
|
|
463
|
-
return _response.data
|
|
464
|
-
|
|
465
|
-
async def create(
|
|
466
|
-
self,
|
|
467
|
-
*,
|
|
468
|
-
name: str,
|
|
469
|
-
description: str,
|
|
470
|
-
agent_code: typing.Optional[str] = OMIT,
|
|
471
|
-
external_id: typing.Optional[str] = OMIT,
|
|
472
|
-
active: typing.Optional[bool] = OMIT,
|
|
473
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
474
|
-
) -> Agent:
|
|
475
|
-
"""
|
|
476
|
-
DEPRECATED: Use POST /products instead.
|
|
477
|
-
|
|
478
|
-
Parameters
|
|
479
|
-
----------
|
|
480
|
-
name : str
|
|
481
|
-
|
|
482
|
-
description : str
|
|
483
|
-
|
|
484
|
-
agent_code : typing.Optional[str]
|
|
485
|
-
|
|
486
|
-
external_id : typing.Optional[str]
|
|
487
|
-
|
|
488
|
-
active : typing.Optional[bool]
|
|
489
|
-
|
|
490
|
-
request_options : typing.Optional[RequestOptions]
|
|
491
|
-
Request-specific configuration.
|
|
492
|
-
|
|
493
|
-
Returns
|
|
494
|
-
-------
|
|
495
|
-
Agent
|
|
496
|
-
Success response
|
|
497
|
-
|
|
498
|
-
Examples
|
|
499
|
-
--------
|
|
500
|
-
import asyncio
|
|
501
|
-
|
|
502
|
-
from paid import AsyncPaid
|
|
503
|
-
|
|
504
|
-
client = AsyncPaid(
|
|
505
|
-
token="YOUR_TOKEN",
|
|
506
|
-
)
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
async def main() -> None:
|
|
510
|
-
await client.agents.create(
|
|
511
|
-
name="Acme Agent",
|
|
512
|
-
description="Acme Agent is an AI agent that does things.",
|
|
513
|
-
external_id="acme-agent",
|
|
514
|
-
)
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
asyncio.run(main())
|
|
518
|
-
"""
|
|
519
|
-
_response = await self._raw_client.create(
|
|
520
|
-
name=name,
|
|
521
|
-
description=description,
|
|
522
|
-
agent_code=agent_code,
|
|
523
|
-
external_id=external_id,
|
|
524
|
-
active=active,
|
|
525
|
-
request_options=request_options,
|
|
526
|
-
)
|
|
527
|
-
return _response.data
|
|
528
|
-
|
|
529
|
-
async def get(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Agent:
|
|
530
|
-
"""
|
|
531
|
-
DEPRECATED: Use GET /products/{productId} instead.
|
|
532
|
-
|
|
533
|
-
Parameters
|
|
534
|
-
----------
|
|
535
|
-
agent_id : str
|
|
536
|
-
|
|
537
|
-
request_options : typing.Optional[RequestOptions]
|
|
538
|
-
Request-specific configuration.
|
|
539
|
-
|
|
540
|
-
Returns
|
|
541
|
-
-------
|
|
542
|
-
Agent
|
|
543
|
-
Success response
|
|
544
|
-
|
|
545
|
-
Examples
|
|
546
|
-
--------
|
|
547
|
-
import asyncio
|
|
548
|
-
|
|
549
|
-
from paid import AsyncPaid
|
|
550
|
-
|
|
551
|
-
client = AsyncPaid(
|
|
552
|
-
token="YOUR_TOKEN",
|
|
553
|
-
)
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
async def main() -> None:
|
|
557
|
-
await client.agents.get(
|
|
558
|
-
agent_id="agentId",
|
|
559
|
-
)
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
asyncio.run(main())
|
|
563
|
-
"""
|
|
564
|
-
_response = await self._raw_client.get(agent_id, request_options=request_options)
|
|
565
|
-
return _response.data
|
|
566
|
-
|
|
567
|
-
async def update(
|
|
568
|
-
self,
|
|
569
|
-
agent_id: str,
|
|
570
|
-
*,
|
|
571
|
-
name: typing.Optional[str] = OMIT,
|
|
572
|
-
description: typing.Optional[str] = OMIT,
|
|
573
|
-
external_id: typing.Optional[str] = OMIT,
|
|
574
|
-
active: typing.Optional[bool] = OMIT,
|
|
575
|
-
agent_code: typing.Optional[str] = OMIT,
|
|
576
|
-
agent_attributes: typing.Optional[typing.Sequence[AgentAttribute]] = OMIT,
|
|
577
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
578
|
-
) -> Agent:
|
|
579
|
-
"""
|
|
580
|
-
DEPRECATED: Use PUT /products/{productId} instead.
|
|
581
|
-
|
|
582
|
-
Parameters
|
|
583
|
-
----------
|
|
584
|
-
agent_id : str
|
|
585
|
-
|
|
586
|
-
name : typing.Optional[str]
|
|
587
|
-
|
|
588
|
-
description : typing.Optional[str]
|
|
589
|
-
|
|
590
|
-
external_id : typing.Optional[str]
|
|
591
|
-
|
|
592
|
-
active : typing.Optional[bool]
|
|
593
|
-
|
|
594
|
-
agent_code : typing.Optional[str]
|
|
595
|
-
|
|
596
|
-
agent_attributes : typing.Optional[typing.Sequence[AgentAttribute]]
|
|
597
|
-
|
|
598
|
-
request_options : typing.Optional[RequestOptions]
|
|
599
|
-
Request-specific configuration.
|
|
600
|
-
|
|
601
|
-
Returns
|
|
602
|
-
-------
|
|
603
|
-
Agent
|
|
604
|
-
Success response
|
|
605
|
-
|
|
606
|
-
Examples
|
|
607
|
-
--------
|
|
608
|
-
import asyncio
|
|
609
|
-
|
|
610
|
-
from paid import (
|
|
611
|
-
AgentAttribute,
|
|
612
|
-
AgentPricePoint,
|
|
613
|
-
AgentPricePointTiers,
|
|
614
|
-
AsyncPaid,
|
|
615
|
-
Pricing,
|
|
616
|
-
)
|
|
617
|
-
|
|
618
|
-
client = AsyncPaid(
|
|
619
|
-
token="YOUR_TOKEN",
|
|
620
|
-
)
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
async def main() -> None:
|
|
624
|
-
await client.agents.update(
|
|
625
|
-
agent_id="agentId",
|
|
626
|
-
name="Acme Agent (Updated)",
|
|
627
|
-
agent_attributes=[
|
|
628
|
-
AgentAttribute(
|
|
629
|
-
name="Emails sent signal",
|
|
630
|
-
active=True,
|
|
631
|
-
pricing=Pricing(
|
|
632
|
-
event_name="emails_sent",
|
|
633
|
-
taxable=True,
|
|
634
|
-
charge_type="usage",
|
|
635
|
-
pricing_model="PerUnit",
|
|
636
|
-
billing_frequency="monthly",
|
|
637
|
-
price_points={
|
|
638
|
-
"USD": AgentPricePoint(
|
|
639
|
-
tiers=[
|
|
640
|
-
AgentPricePointTiers(
|
|
641
|
-
min_quantity=0.0,
|
|
642
|
-
max_quantity=10.0,
|
|
643
|
-
unit_price=100.0,
|
|
644
|
-
),
|
|
645
|
-
AgentPricePointTiers(
|
|
646
|
-
min_quantity=11.0,
|
|
647
|
-
max_quantity=100.0,
|
|
648
|
-
unit_price=90.0,
|
|
649
|
-
),
|
|
650
|
-
AgentPricePointTiers(
|
|
651
|
-
min_quantity=101.0,
|
|
652
|
-
unit_price=80.0,
|
|
653
|
-
),
|
|
654
|
-
],
|
|
655
|
-
)
|
|
656
|
-
},
|
|
657
|
-
),
|
|
658
|
-
)
|
|
659
|
-
],
|
|
660
|
-
)
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
asyncio.run(main())
|
|
664
|
-
"""
|
|
665
|
-
_response = await self._raw_client.update(
|
|
666
|
-
agent_id,
|
|
667
|
-
name=name,
|
|
668
|
-
description=description,
|
|
669
|
-
external_id=external_id,
|
|
670
|
-
active=active,
|
|
671
|
-
agent_code=agent_code,
|
|
672
|
-
agent_attributes=agent_attributes,
|
|
673
|
-
request_options=request_options,
|
|
674
|
-
)
|
|
675
|
-
return _response.data
|
|
676
|
-
|
|
677
|
-
async def delete(self, agent_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
678
|
-
"""
|
|
679
|
-
DEPRECATED: Use DELETE /products/{productId} instead.
|
|
680
|
-
|
|
681
|
-
Parameters
|
|
682
|
-
----------
|
|
683
|
-
agent_id : str
|
|
684
|
-
|
|
685
|
-
request_options : typing.Optional[RequestOptions]
|
|
686
|
-
Request-specific configuration.
|
|
687
|
-
|
|
688
|
-
Returns
|
|
689
|
-
-------
|
|
690
|
-
None
|
|
691
|
-
|
|
692
|
-
Examples
|
|
693
|
-
--------
|
|
694
|
-
import asyncio
|
|
695
|
-
|
|
696
|
-
from paid import AsyncPaid
|
|
697
|
-
|
|
698
|
-
client = AsyncPaid(
|
|
699
|
-
token="YOUR_TOKEN",
|
|
700
|
-
)
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
async def main() -> None:
|
|
704
|
-
await client.agents.delete(
|
|
705
|
-
agent_id="agentId",
|
|
706
|
-
)
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
asyncio.run(main())
|
|
710
|
-
"""
|
|
711
|
-
_response = await self._raw_client.delete(agent_id, request_options=request_options)
|
|
712
|
-
return _response.data
|
|
713
|
-
|
|
714
|
-
async def get_by_external_id(
|
|
715
|
-
self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
716
|
-
) -> Agent:
|
|
717
|
-
"""
|
|
718
|
-
DEPRECATED: Use GET /products/external/{externalId} instead.
|
|
719
|
-
|
|
720
|
-
Parameters
|
|
721
|
-
----------
|
|
722
|
-
external_id : str
|
|
723
|
-
|
|
724
|
-
request_options : typing.Optional[RequestOptions]
|
|
725
|
-
Request-specific configuration.
|
|
726
|
-
|
|
727
|
-
Returns
|
|
728
|
-
-------
|
|
729
|
-
Agent
|
|
730
|
-
Success response
|
|
731
|
-
|
|
732
|
-
Examples
|
|
733
|
-
--------
|
|
734
|
-
import asyncio
|
|
735
|
-
|
|
736
|
-
from paid import AsyncPaid
|
|
737
|
-
|
|
738
|
-
client = AsyncPaid(
|
|
739
|
-
token="YOUR_TOKEN",
|
|
740
|
-
)
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
async def main() -> None:
|
|
744
|
-
await client.agents.get_by_external_id(
|
|
745
|
-
external_id="externalId",
|
|
746
|
-
)
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
asyncio.run(main())
|
|
750
|
-
"""
|
|
751
|
-
_response = await self._raw_client.get_by_external_id(external_id, request_options=request_options)
|
|
752
|
-
return _response.data
|
|
753
|
-
|
|
754
|
-
async def update_by_external_id(
|
|
755
|
-
self,
|
|
756
|
-
external_id_: str,
|
|
757
|
-
*,
|
|
758
|
-
name: typing.Optional[str] = OMIT,
|
|
759
|
-
description: typing.Optional[str] = OMIT,
|
|
760
|
-
external_id: typing.Optional[str] = OMIT,
|
|
761
|
-
active: typing.Optional[bool] = OMIT,
|
|
762
|
-
agent_code: typing.Optional[str] = OMIT,
|
|
763
|
-
agent_attributes: typing.Optional[typing.Sequence[AgentAttribute]] = OMIT,
|
|
764
|
-
request_options: typing.Optional[RequestOptions] = None,
|
|
765
|
-
) -> Agent:
|
|
766
|
-
"""
|
|
767
|
-
DEPRECATED: Use PUT /products/external/{externalId} instead.
|
|
768
|
-
|
|
769
|
-
Parameters
|
|
770
|
-
----------
|
|
771
|
-
external_id_ : str
|
|
772
|
-
|
|
773
|
-
name : typing.Optional[str]
|
|
774
|
-
|
|
775
|
-
description : typing.Optional[str]
|
|
776
|
-
|
|
777
|
-
external_id : typing.Optional[str]
|
|
778
|
-
|
|
779
|
-
active : typing.Optional[bool]
|
|
780
|
-
|
|
781
|
-
agent_code : typing.Optional[str]
|
|
782
|
-
|
|
783
|
-
agent_attributes : typing.Optional[typing.Sequence[AgentAttribute]]
|
|
784
|
-
|
|
785
|
-
request_options : typing.Optional[RequestOptions]
|
|
786
|
-
Request-specific configuration.
|
|
787
|
-
|
|
788
|
-
Returns
|
|
789
|
-
-------
|
|
790
|
-
Agent
|
|
791
|
-
Success response
|
|
792
|
-
|
|
793
|
-
Examples
|
|
794
|
-
--------
|
|
795
|
-
import asyncio
|
|
796
|
-
|
|
797
|
-
from paid import AgentAttribute, AgentPricePoint, AsyncPaid, Pricing
|
|
798
|
-
|
|
799
|
-
client = AsyncPaid(
|
|
800
|
-
token="YOUR_TOKEN",
|
|
801
|
-
)
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
async def main() -> None:
|
|
805
|
-
await client.agents.update_by_external_id(
|
|
806
|
-
external_id_="externalId",
|
|
807
|
-
name="Acme Agent (Updated)",
|
|
808
|
-
agent_attributes=[
|
|
809
|
-
AgentAttribute(
|
|
810
|
-
name="Emails sent signal",
|
|
811
|
-
active=True,
|
|
812
|
-
pricing=Pricing(
|
|
813
|
-
event_name="emails_sent",
|
|
814
|
-
taxable=True,
|
|
815
|
-
charge_type="usage",
|
|
816
|
-
pricing_model="PerUnit",
|
|
817
|
-
billing_frequency="monthly",
|
|
818
|
-
price_points={
|
|
819
|
-
"USD": AgentPricePoint(
|
|
820
|
-
unit_price=150.0,
|
|
821
|
-
)
|
|
822
|
-
},
|
|
823
|
-
),
|
|
824
|
-
)
|
|
825
|
-
],
|
|
826
|
-
)
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
asyncio.run(main())
|
|
830
|
-
"""
|
|
831
|
-
_response = await self._raw_client.update_by_external_id(
|
|
832
|
-
external_id_,
|
|
833
|
-
name=name,
|
|
834
|
-
description=description,
|
|
835
|
-
external_id=external_id,
|
|
836
|
-
active=active,
|
|
837
|
-
agent_code=agent_code,
|
|
838
|
-
agent_attributes=agent_attributes,
|
|
839
|
-
request_options=request_options,
|
|
840
|
-
)
|
|
841
|
-
return _response.data
|
|
842
|
-
|
|
843
|
-
async def delete_by_external_id(
|
|
844
|
-
self, external_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
845
|
-
) -> None:
|
|
846
|
-
"""
|
|
847
|
-
DEPRECATED: Use DELETE /products/external/{externalId} instead.
|
|
848
|
-
|
|
849
|
-
Parameters
|
|
850
|
-
----------
|
|
851
|
-
external_id : str
|
|
852
|
-
|
|
853
|
-
request_options : typing.Optional[RequestOptions]
|
|
854
|
-
Request-specific configuration.
|
|
855
|
-
|
|
856
|
-
Returns
|
|
857
|
-
-------
|
|
858
|
-
None
|
|
859
|
-
|
|
860
|
-
Examples
|
|
861
|
-
--------
|
|
862
|
-
import asyncio
|
|
863
|
-
|
|
864
|
-
from paid import AsyncPaid
|
|
865
|
-
|
|
866
|
-
client = AsyncPaid(
|
|
867
|
-
token="YOUR_TOKEN",
|
|
868
|
-
)
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
async def main() -> None:
|
|
872
|
-
await client.agents.delete_by_external_id(
|
|
873
|
-
external_id="externalId",
|
|
874
|
-
)
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
asyncio.run(main())
|
|
878
|
-
"""
|
|
879
|
-
_response = await self._raw_client.delete_by_external_id(external_id, request_options=request_options)
|
|
880
|
-
return _response.data
|