paid-python 1.0.0a0__py3-none-any.whl → 1.0.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. paid/__init__.py +61 -122
  2. paid/client.py +16 -22
  3. paid/contacts/client.py +415 -133
  4. paid/contacts/raw_client.py +1046 -118
  5. paid/core/client_wrapper.py +8 -10
  6. paid/customers/__init__.py +0 -3
  7. paid/customers/client.py +392 -1112
  8. paid/customers/raw_client.py +656 -1054
  9. paid/environment.py +1 -1
  10. paid/errors/bad_request_error.py +2 -2
  11. paid/errors/forbidden_error.py +2 -2
  12. paid/errors/internal_server_error.py +2 -2
  13. paid/errors/not_found_error.py +2 -2
  14. paid/invoices/client.py +369 -0
  15. paid/{plans → invoices}/raw_client.py +310 -201
  16. paid/orders/__init__.py +0 -3
  17. paid/orders/client.py +279 -471
  18. paid/orders/raw_client.py +551 -538
  19. paid/products/__init__.py +0 -3
  20. paid/products/client.py +129 -265
  21. paid/products/raw_client.py +563 -233
  22. paid/signals/client.py +130 -0
  23. paid/signals/raw_client.py +190 -0
  24. paid/tracing/autoinstrumentation.py +12 -6
  25. paid/tracing/context_manager.py +2 -6
  26. paid/tracing/distributed_tracing.py +3 -3
  27. paid/tracing/signal.py +3 -3
  28. paid/tracing/wrappers/openai_agents/openaiAgentsHook.py +1 -1
  29. paid/types/__init__.py +58 -110
  30. paid/types/attribution.py +8 -0
  31. paid/types/{agent_attribute.py → bulk_signals_response.py} +4 -5
  32. paid/types/contact.py +12 -20
  33. paid/types/{address.py → contact_billing_address.py} +6 -7
  34. paid/types/{traces_response.py → contact_list_response.py} +5 -9
  35. paid/types/customer.py +15 -22
  36. paid/types/customer_attribution.py +8 -0
  37. paid/types/customer_billing_address.py +26 -0
  38. paid/types/{usage_summary_order.py → customer_by_external_id.py} +3 -5
  39. paid/types/{usage_summary_order_line.py → customer_by_id.py} +3 -5
  40. paid/types/customer_creation_state.py +5 -0
  41. paid/types/customer_list_response.py +22 -0
  42. paid/types/empty_response.py +17 -0
  43. paid/types/{error.py → error_response.py} +4 -7
  44. paid/types/invoice.py +33 -51
  45. paid/types/invoice_line.py +42 -0
  46. paid/types/invoice_line_payment_status.py +7 -0
  47. paid/types/invoice_lines_response.py +22 -0
  48. paid/types/invoice_list_response.py +22 -0
  49. paid/types/invoice_payment_status.py +5 -0
  50. paid/types/invoice_source.py +5 -0
  51. paid/types/invoice_status.py +3 -1
  52. paid/types/invoice_tax_status.py +7 -0
  53. paid/types/order.py +30 -29
  54. paid/types/order_creation_state.py +5 -0
  55. paid/types/order_line.py +6 -24
  56. paid/types/order_lines_response.py +22 -0
  57. paid/types/order_list_response.py +22 -0
  58. paid/types/pagination.py +24 -0
  59. paid/types/product.py +4 -29
  60. paid/types/{tier.py → product_by_external_id.py} +5 -4
  61. paid/types/{cost_amount.py → product_by_id.py} +5 -12
  62. paid/types/product_list_response.py +22 -0
  63. paid/types/signal.py +8 -34
  64. paid/types/{agent_update.py → update_contact_request.py} +10 -9
  65. paid/types/update_customer_request.py +38 -0
  66. paid/types/{product_update.py → update_product_request.py} +2 -12
  67. {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a1.dist-info}/METADATA +22 -8
  68. paid_python-1.0.0a1.dist-info/RECORD +110 -0
  69. paid/agents/client.py +0 -880
  70. paid/agents/raw_client.py +0 -785
  71. paid/customers/types/__init__.py +0 -8
  72. paid/customers/types/customers_check_entitlement_request_view.py +0 -5
  73. paid/customers/types/customers_check_entitlement_response.py +0 -22
  74. paid/orders/lines/client.py +0 -144
  75. paid/orders/lines/raw_client.py +0 -129
  76. paid/plans/__init__.py +0 -4
  77. paid/plans/client.py +0 -403
  78. paid/products/types/__init__.py +0 -7
  79. paid/products/types/product_create_type.py +0 -5
  80. paid/traces/__init__.py +0 -4
  81. paid/traces/client.py +0 -218
  82. paid/traces/raw_client.py +0 -226
  83. paid/types/agent.py +0 -31
  84. paid/types/agent_price_point.py +0 -27
  85. paid/types/agent_price_point_tiers.py +0 -23
  86. paid/types/api_error.py +0 -29
  87. paid/types/billing_frequency.py +0 -5
  88. paid/types/cancel_renewal_response.py +0 -49
  89. paid/types/charge_type.py +0 -5
  90. paid/types/contact_create_for_customer.py +0 -37
  91. paid/types/cost_trace.py +0 -55
  92. paid/types/cost_traces_response.py +0 -26
  93. paid/types/creation_source.py +0 -5
  94. paid/types/creation_state.py +0 -5
  95. paid/types/customer_update.py +0 -40
  96. paid/types/entitlement_usage.py +0 -48
  97. paid/types/order_line_attribute.py +0 -27
  98. paid/types/order_line_attribute_create_one.py +0 -5
  99. paid/types/order_line_attribute_pricing.py +0 -33
  100. paid/types/order_line_create.py +0 -72
  101. paid/types/pagination_meta.py +0 -84
  102. paid/types/payment_method.py +0 -58
  103. paid/types/payment_method_card.py +0 -49
  104. paid/types/payment_method_type.py +0 -5
  105. paid/types/payment_method_us_bank_account.py +0 -36
  106. paid/types/payment_method_us_bank_account_account_type.py +0 -5
  107. paid/types/plan.py +0 -81
  108. paid/types/plan_group.py +0 -60
  109. paid/types/plan_plan_products_item.py +0 -41
  110. paid/types/plan_plan_products_item_plan_product_attribute_item.py +0 -34
  111. paid/types/plan_with_features.py +0 -69
  112. paid/types/plan_with_features_features_item.py +0 -34
  113. paid/types/price_point.py +0 -25
  114. paid/types/pricing.py +0 -31
  115. paid/types/pricing_model_type.py +0 -7
  116. paid/types/product_type.py +0 -5
  117. paid/types/product_update_type.py +0 -5
  118. paid/types/proration_attribute_update.py +0 -44
  119. paid/types/proration_detail.py +0 -49
  120. paid/types/proration_upgrade_response.py +0 -73
  121. paid/types/salutation.py +0 -5
  122. paid/types/signal_v_2.py +0 -56
  123. paid/types/tax_exempt_status.py +0 -5
  124. paid/types/trace.py +0 -69
  125. paid/types/usage_pagination_meta.py +0 -43
  126. paid/types/usage_summaries_response.py +0 -26
  127. paid/types/usage_summary.py +0 -121
  128. paid/usage/__init__.py +0 -7
  129. paid/usage/client.py +0 -321
  130. paid/usage/raw_client.py +0 -387
  131. paid/usage/types/__init__.py +0 -7
  132. paid/usage/types/usage_check_usage_response.py +0 -53
  133. paid_python-1.0.0a0.dist-info/RECORD +0 -152
  134. /paid/{agents → invoices}/__init__.py +0 -0
  135. /paid/{orders/lines → signals}/__init__.py +0 -0
  136. {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a1.dist-info}/LICENSE +0 -0
  137. {paid_python-1.0.0a0.dist-info → paid_python-1.0.0a1.dist-info}/WHEEL +0 -0
paid/plans/client.py DELETED
@@ -1,403 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import datetime as dt
4
- import typing
5
-
6
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
- from ..core.request_options import RequestOptions
8
- from ..types.plan import Plan
9
- from ..types.plan_group import PlanGroup
10
- from ..types.plan_with_features import PlanWithFeatures
11
- from ..types.usage_summaries_response import UsageSummariesResponse
12
- from .raw_client import AsyncRawPlansClient, RawPlansClient
13
-
14
-
15
- class PlansClient:
16
- def __init__(self, *, client_wrapper: SyncClientWrapper):
17
- self._raw_client = RawPlansClient(client_wrapper=client_wrapper)
18
-
19
- @property
20
- def with_raw_response(self) -> RawPlansClient:
21
- """
22
- Retrieves a raw implementation of this client that returns raw responses.
23
-
24
- Returns
25
- -------
26
- RawPlansClient
27
- """
28
- return self._raw_client
29
-
30
- def get_by_id(self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Plan:
31
- """
32
- Parameters
33
- ----------
34
- plan_id : str
35
- The ID of the plan
36
-
37
- request_options : typing.Optional[RequestOptions]
38
- Request-specific configuration.
39
-
40
- Returns
41
- -------
42
- Plan
43
- Success response
44
-
45
- Examples
46
- --------
47
- from paid import Paid
48
-
49
- client = Paid(
50
- token="YOUR_TOKEN",
51
- )
52
- client.plans.get_by_id(
53
- plan_id="planId",
54
- )
55
- """
56
- _response = self._raw_client.get_by_id(plan_id, request_options=request_options)
57
- return _response.data
58
-
59
- def get_usage(
60
- self,
61
- plan_id: str,
62
- *,
63
- external_id: str,
64
- limit: typing.Optional[int] = None,
65
- offset: typing.Optional[int] = None,
66
- start_time: typing.Optional[dt.datetime] = None,
67
- end_time: typing.Optional[dt.datetime] = None,
68
- request_options: typing.Optional[RequestOptions] = None,
69
- ) -> UsageSummariesResponse:
70
- """
71
- Parameters
72
- ----------
73
- plan_id : str
74
- The ID of the plan
75
-
76
- external_id : str
77
- The external ID of the customer
78
-
79
- limit : typing.Optional[int]
80
- Maximum number of usage summaries to return (1-1000)
81
-
82
- offset : typing.Optional[int]
83
- Number of usage summaries to skip for pagination
84
-
85
- start_time : typing.Optional[dt.datetime]
86
- Filter usage summaries starting from this time (ISO 8601 format). Returns summaries that overlap with the time range.
87
-
88
- end_time : typing.Optional[dt.datetime]
89
- Filter usage summaries up to this time (ISO 8601 format). Returns summaries that overlap with the time range.
90
-
91
- request_options : typing.Optional[RequestOptions]
92
- Request-specific configuration.
93
-
94
- Returns
95
- -------
96
- UsageSummariesResponse
97
- Success response
98
-
99
- Examples
100
- --------
101
- import datetime
102
-
103
- from paid import Paid
104
-
105
- client = Paid(
106
- token="YOUR_TOKEN",
107
- )
108
- client.plans.get_usage(
109
- plan_id="planId",
110
- external_id="externalId",
111
- limit=1,
112
- offset=1,
113
- start_time=datetime.datetime.fromisoformat(
114
- "2024-01-15 09:30:00+00:00",
115
- ),
116
- end_time=datetime.datetime.fromisoformat(
117
- "2024-01-15 09:30:00+00:00",
118
- ),
119
- )
120
- """
121
- _response = self._raw_client.get_usage(
122
- plan_id,
123
- external_id=external_id,
124
- limit=limit,
125
- offset=offset,
126
- start_time=start_time,
127
- end_time=end_time,
128
- request_options=request_options,
129
- )
130
- return _response.data
131
-
132
- def get_group_by_id(
133
- self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
134
- ) -> PlanGroup:
135
- """
136
- Parameters
137
- ----------
138
- plan_group_id : str
139
- The ID of the plan group
140
-
141
- request_options : typing.Optional[RequestOptions]
142
- Request-specific configuration.
143
-
144
- Returns
145
- -------
146
- PlanGroup
147
- Success response
148
-
149
- Examples
150
- --------
151
- from paid import Paid
152
-
153
- client = Paid(
154
- token="YOUR_TOKEN",
155
- )
156
- client.plans.get_group_by_id(
157
- plan_group_id="planGroupId",
158
- )
159
- """
160
- _response = self._raw_client.get_group_by_id(plan_group_id, request_options=request_options)
161
- return _response.data
162
-
163
- def get_group_plans(
164
- self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
165
- ) -> typing.List[PlanWithFeatures]:
166
- """
167
- Parameters
168
- ----------
169
- plan_group_id : str
170
- The ID of the plan group
171
-
172
- request_options : typing.Optional[RequestOptions]
173
- Request-specific configuration.
174
-
175
- Returns
176
- -------
177
- typing.List[PlanWithFeatures]
178
- Success response
179
-
180
- Examples
181
- --------
182
- from paid import Paid
183
-
184
- client = Paid(
185
- token="YOUR_TOKEN",
186
- )
187
- client.plans.get_group_plans(
188
- plan_group_id="planGroupId",
189
- )
190
- """
191
- _response = self._raw_client.get_group_plans(plan_group_id, request_options=request_options)
192
- return _response.data
193
-
194
-
195
- class AsyncPlansClient:
196
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
197
- self._raw_client = AsyncRawPlansClient(client_wrapper=client_wrapper)
198
-
199
- @property
200
- def with_raw_response(self) -> AsyncRawPlansClient:
201
- """
202
- Retrieves a raw implementation of this client that returns raw responses.
203
-
204
- Returns
205
- -------
206
- AsyncRawPlansClient
207
- """
208
- return self._raw_client
209
-
210
- async def get_by_id(self, plan_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Plan:
211
- """
212
- Parameters
213
- ----------
214
- plan_id : str
215
- The ID of the plan
216
-
217
- request_options : typing.Optional[RequestOptions]
218
- Request-specific configuration.
219
-
220
- Returns
221
- -------
222
- Plan
223
- Success response
224
-
225
- Examples
226
- --------
227
- import asyncio
228
-
229
- from paid import AsyncPaid
230
-
231
- client = AsyncPaid(
232
- token="YOUR_TOKEN",
233
- )
234
-
235
-
236
- async def main() -> None:
237
- await client.plans.get_by_id(
238
- plan_id="planId",
239
- )
240
-
241
-
242
- asyncio.run(main())
243
- """
244
- _response = await self._raw_client.get_by_id(plan_id, request_options=request_options)
245
- return _response.data
246
-
247
- async def get_usage(
248
- self,
249
- plan_id: str,
250
- *,
251
- external_id: str,
252
- limit: typing.Optional[int] = None,
253
- offset: typing.Optional[int] = None,
254
- start_time: typing.Optional[dt.datetime] = None,
255
- end_time: typing.Optional[dt.datetime] = None,
256
- request_options: typing.Optional[RequestOptions] = None,
257
- ) -> UsageSummariesResponse:
258
- """
259
- Parameters
260
- ----------
261
- plan_id : str
262
- The ID of the plan
263
-
264
- external_id : str
265
- The external ID of the customer
266
-
267
- limit : typing.Optional[int]
268
- Maximum number of usage summaries to return (1-1000)
269
-
270
- offset : typing.Optional[int]
271
- Number of usage summaries to skip for pagination
272
-
273
- start_time : typing.Optional[dt.datetime]
274
- Filter usage summaries starting from this time (ISO 8601 format). Returns summaries that overlap with the time range.
275
-
276
- end_time : typing.Optional[dt.datetime]
277
- Filter usage summaries up to this time (ISO 8601 format). Returns summaries that overlap with the time range.
278
-
279
- request_options : typing.Optional[RequestOptions]
280
- Request-specific configuration.
281
-
282
- Returns
283
- -------
284
- UsageSummariesResponse
285
- Success response
286
-
287
- Examples
288
- --------
289
- import asyncio
290
- import datetime
291
-
292
- from paid import AsyncPaid
293
-
294
- client = AsyncPaid(
295
- token="YOUR_TOKEN",
296
- )
297
-
298
-
299
- async def main() -> None:
300
- await client.plans.get_usage(
301
- plan_id="planId",
302
- external_id="externalId",
303
- limit=1,
304
- offset=1,
305
- start_time=datetime.datetime.fromisoformat(
306
- "2024-01-15 09:30:00+00:00",
307
- ),
308
- end_time=datetime.datetime.fromisoformat(
309
- "2024-01-15 09:30:00+00:00",
310
- ),
311
- )
312
-
313
-
314
- asyncio.run(main())
315
- """
316
- _response = await self._raw_client.get_usage(
317
- plan_id,
318
- external_id=external_id,
319
- limit=limit,
320
- offset=offset,
321
- start_time=start_time,
322
- end_time=end_time,
323
- request_options=request_options,
324
- )
325
- return _response.data
326
-
327
- async def get_group_by_id(
328
- self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
329
- ) -> PlanGroup:
330
- """
331
- Parameters
332
- ----------
333
- plan_group_id : str
334
- The ID of the plan group
335
-
336
- request_options : typing.Optional[RequestOptions]
337
- Request-specific configuration.
338
-
339
- Returns
340
- -------
341
- PlanGroup
342
- Success response
343
-
344
- Examples
345
- --------
346
- import asyncio
347
-
348
- from paid import AsyncPaid
349
-
350
- client = AsyncPaid(
351
- token="YOUR_TOKEN",
352
- )
353
-
354
-
355
- async def main() -> None:
356
- await client.plans.get_group_by_id(
357
- plan_group_id="planGroupId",
358
- )
359
-
360
-
361
- asyncio.run(main())
362
- """
363
- _response = await self._raw_client.get_group_by_id(plan_group_id, request_options=request_options)
364
- return _response.data
365
-
366
- async def get_group_plans(
367
- self, plan_group_id: str, *, request_options: typing.Optional[RequestOptions] = None
368
- ) -> typing.List[PlanWithFeatures]:
369
- """
370
- Parameters
371
- ----------
372
- plan_group_id : str
373
- The ID of the plan group
374
-
375
- request_options : typing.Optional[RequestOptions]
376
- Request-specific configuration.
377
-
378
- Returns
379
- -------
380
- typing.List[PlanWithFeatures]
381
- Success response
382
-
383
- Examples
384
- --------
385
- import asyncio
386
-
387
- from paid import AsyncPaid
388
-
389
- client = AsyncPaid(
390
- token="YOUR_TOKEN",
391
- )
392
-
393
-
394
- async def main() -> None:
395
- await client.plans.get_group_plans(
396
- plan_group_id="planGroupId",
397
- )
398
-
399
-
400
- asyncio.run(main())
401
- """
402
- _response = await self._raw_client.get_group_plans(plan_group_id, request_options=request_options)
403
- return _response.data
@@ -1,7 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- # isort: skip_file
4
-
5
- from .product_create_type import ProductCreateType
6
-
7
- __all__ = ["ProductCreateType"]
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- ProductCreateType = typing.Union[typing.Literal["agent", "product", "prepaidCreditBundle"], typing.Any]
paid/traces/__init__.py DELETED
@@ -1,4 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- # isort: skip_file
4
-
paid/traces/client.py DELETED
@@ -1,218 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import datetime as dt
4
- import typing
5
-
6
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
7
- from ..core.request_options import RequestOptions
8
- from ..types.traces_response import TracesResponse
9
- from .raw_client import AsyncRawTracesClient, RawTracesClient
10
-
11
-
12
- class TracesClient:
13
- def __init__(self, *, client_wrapper: SyncClientWrapper):
14
- self._raw_client = RawTracesClient(client_wrapper=client_wrapper)
15
-
16
- @property
17
- def with_raw_response(self) -> RawTracesClient:
18
- """
19
- Retrieves a raw implementation of this client that returns raw responses.
20
-
21
- Returns
22
- -------
23
- RawTracesClient
24
- """
25
- return self._raw_client
26
-
27
- def get_traces(
28
- self,
29
- *,
30
- limit: typing.Optional[int] = None,
31
- offset: typing.Optional[int] = None,
32
- start_time: typing.Optional[dt.datetime] = None,
33
- end_time: typing.Optional[dt.datetime] = None,
34
- external_customer_id: typing.Optional[str] = None,
35
- external_product_id: typing.Optional[str] = None,
36
- external_agent_id: typing.Optional[str] = None,
37
- metadata: typing.Optional[str] = None,
38
- request_options: typing.Optional[RequestOptions] = None,
39
- ) -> TracesResponse:
40
- """
41
- Parameters
42
- ----------
43
- limit : typing.Optional[int]
44
- Maximum number of traces to return (1-1000)
45
-
46
- offset : typing.Optional[int]
47
- Number of traces to skip for pagination
48
-
49
- start_time : typing.Optional[dt.datetime]
50
- Filter traces starting from this time (ISO 8601 format)
51
-
52
- end_time : typing.Optional[dt.datetime]
53
- Filter traces up to this time (ISO 8601 format)
54
-
55
- external_customer_id : typing.Optional[str]
56
- Filter traces by external customer ID
57
-
58
- external_product_id : typing.Optional[str]
59
- Filter traces by external product ID
60
-
61
- external_agent_id : typing.Optional[str]
62
- DEPRECATED: Use externalProductId instead. Filter traces by external agent ID
63
-
64
- metadata : typing.Optional[str]
65
- Filter traces by metadata fields. Must be a valid JSON object (e.g., {"key1":"value1","key2":"value2"}). All specified fields must match (AND logic).
66
-
67
- request_options : typing.Optional[RequestOptions]
68
- Request-specific configuration.
69
-
70
- Returns
71
- -------
72
- TracesResponse
73
- Success response
74
-
75
- Examples
76
- --------
77
- import datetime
78
-
79
- from paid import Paid
80
-
81
- client = Paid(
82
- token="YOUR_TOKEN",
83
- )
84
- client.traces.get_traces(
85
- limit=1,
86
- offset=1,
87
- start_time=datetime.datetime.fromisoformat(
88
- "2024-01-15 09:30:00+00:00",
89
- ),
90
- end_time=datetime.datetime.fromisoformat(
91
- "2024-01-15 09:30:00+00:00",
92
- ),
93
- external_customer_id="externalCustomerId",
94
- external_product_id="externalProductId",
95
- external_agent_id="externalAgentId",
96
- metadata="metadata",
97
- )
98
- """
99
- _response = self._raw_client.get_traces(
100
- limit=limit,
101
- offset=offset,
102
- start_time=start_time,
103
- end_time=end_time,
104
- external_customer_id=external_customer_id,
105
- external_product_id=external_product_id,
106
- external_agent_id=external_agent_id,
107
- metadata=metadata,
108
- request_options=request_options,
109
- )
110
- return _response.data
111
-
112
-
113
- class AsyncTracesClient:
114
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
115
- self._raw_client = AsyncRawTracesClient(client_wrapper=client_wrapper)
116
-
117
- @property
118
- def with_raw_response(self) -> AsyncRawTracesClient:
119
- """
120
- Retrieves a raw implementation of this client that returns raw responses.
121
-
122
- Returns
123
- -------
124
- AsyncRawTracesClient
125
- """
126
- return self._raw_client
127
-
128
- async def get_traces(
129
- self,
130
- *,
131
- limit: typing.Optional[int] = None,
132
- offset: typing.Optional[int] = None,
133
- start_time: typing.Optional[dt.datetime] = None,
134
- end_time: typing.Optional[dt.datetime] = None,
135
- external_customer_id: typing.Optional[str] = None,
136
- external_product_id: typing.Optional[str] = None,
137
- external_agent_id: typing.Optional[str] = None,
138
- metadata: typing.Optional[str] = None,
139
- request_options: typing.Optional[RequestOptions] = None,
140
- ) -> TracesResponse:
141
- """
142
- Parameters
143
- ----------
144
- limit : typing.Optional[int]
145
- Maximum number of traces to return (1-1000)
146
-
147
- offset : typing.Optional[int]
148
- Number of traces to skip for pagination
149
-
150
- start_time : typing.Optional[dt.datetime]
151
- Filter traces starting from this time (ISO 8601 format)
152
-
153
- end_time : typing.Optional[dt.datetime]
154
- Filter traces up to this time (ISO 8601 format)
155
-
156
- external_customer_id : typing.Optional[str]
157
- Filter traces by external customer ID
158
-
159
- external_product_id : typing.Optional[str]
160
- Filter traces by external product ID
161
-
162
- external_agent_id : typing.Optional[str]
163
- DEPRECATED: Use externalProductId instead. Filter traces by external agent ID
164
-
165
- metadata : typing.Optional[str]
166
- Filter traces by metadata fields. Must be a valid JSON object (e.g., {"key1":"value1","key2":"value2"}). All specified fields must match (AND logic).
167
-
168
- request_options : typing.Optional[RequestOptions]
169
- Request-specific configuration.
170
-
171
- Returns
172
- -------
173
- TracesResponse
174
- Success response
175
-
176
- Examples
177
- --------
178
- import asyncio
179
- import datetime
180
-
181
- from paid import AsyncPaid
182
-
183
- client = AsyncPaid(
184
- token="YOUR_TOKEN",
185
- )
186
-
187
-
188
- async def main() -> None:
189
- await client.traces.get_traces(
190
- limit=1,
191
- offset=1,
192
- start_time=datetime.datetime.fromisoformat(
193
- "2024-01-15 09:30:00+00:00",
194
- ),
195
- end_time=datetime.datetime.fromisoformat(
196
- "2024-01-15 09:30:00+00:00",
197
- ),
198
- external_customer_id="externalCustomerId",
199
- external_product_id="externalProductId",
200
- external_agent_id="externalAgentId",
201
- metadata="metadata",
202
- )
203
-
204
-
205
- asyncio.run(main())
206
- """
207
- _response = await self._raw_client.get_traces(
208
- limit=limit,
209
- offset=offset,
210
- start_time=start_time,
211
- end_time=end_time,
212
- external_customer_id=external_customer_id,
213
- external_product_id=external_product_id,
214
- external_agent_id=external_agent_id,
215
- metadata=metadata,
216
- request_options=request_options,
217
- )
218
- return _response.data