gr4vy 1.9.0__py3-none-any.whl → 1.9.1__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.
gr4vy/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "gr4vy"
6
- __version__: str = "1.9.0"
6
+ __version__: str = "1.9.1"
7
7
  __openapi_doc_version__: str = "1.0.0"
8
8
  __gen_version__: str = "2.763.3"
9
- __user_agent__: str = "speakeasy-sdk/python 1.9.0 2.763.3 1.0.0 gr4vy"
9
+ __user_agent__: str = "speakeasy-sdk/python 1.9.1 2.763.3 1.0.0 gr4vy"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
gr4vy/events.py CHANGED
@@ -6,7 +6,8 @@ from gr4vy._hooks import HookContext
6
6
  from gr4vy.types import OptionalNullable, UNSET
7
7
  from gr4vy.utils import get_security_from_env
8
8
  from gr4vy.utils.unmarshal_json_response import unmarshal_json_response
9
- from typing import Any, Mapping, Optional
9
+ from jsonpath import JSONPath
10
+ from typing import Any, Dict, List, Mapping, Optional, Union
10
11
 
11
12
 
12
13
  class Events(BaseSDK):
@@ -21,7 +22,7 @@ class Events(BaseSDK):
21
22
  server_url: Optional[str] = None,
22
23
  timeout_ms: Optional[int] = None,
23
24
  http_headers: Optional[Mapping[str, str]] = None,
24
- ) -> models.TransactionEvents:
25
+ ) -> Optional[models.ListTransactionEventsResponse]:
25
26
  r"""List transaction events
26
27
 
27
28
  Retrieve a paginated list of events related to processing a transaction, including status changes, API requests, and webhook delivery attempts. Events are listed in chronological order, with the most recent events first.
@@ -113,9 +114,31 @@ class Events(BaseSDK):
113
114
  retry_config=retry_config,
114
115
  )
115
116
 
117
+ def next_func() -> Optional[models.ListTransactionEventsResponse]:
118
+ body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
119
+ next_cursor = JSONPath("$.next_cursor").parse(body)
120
+
121
+ if len(next_cursor) == 0:
122
+ return None
123
+
124
+ next_cursor = next_cursor[0]
125
+ if next_cursor is None or str(next_cursor).strip() == "":
126
+ return None
127
+
128
+ return self.list(
129
+ transaction_id=transaction_id,
130
+ cursor=next_cursor,
131
+ limit=limit,
132
+ merchant_account_id=merchant_account_id,
133
+ retries=retries,
134
+ )
135
+
116
136
  response_data: Any = None
117
137
  if utils.match_response(http_res, "200", "application/json"):
118
- return unmarshal_json_response(models.TransactionEvents, http_res)
138
+ return models.ListTransactionEventsResponse(
139
+ result=unmarshal_json_response(models.TransactionEvents, http_res),
140
+ next=next_func,
141
+ )
119
142
  if utils.match_response(http_res, "400", "application/json"):
120
143
  response_data = unmarshal_json_response(errors.Error400Data, http_res)
121
144
  raise errors.Error400(response_data, http_res)
@@ -174,7 +197,7 @@ class Events(BaseSDK):
174
197
  server_url: Optional[str] = None,
175
198
  timeout_ms: Optional[int] = None,
176
199
  http_headers: Optional[Mapping[str, str]] = None,
177
- ) -> models.TransactionEvents:
200
+ ) -> Optional[models.ListTransactionEventsResponse]:
178
201
  r"""List transaction events
179
202
 
180
203
  Retrieve a paginated list of events related to processing a transaction, including status changes, API requests, and webhook delivery attempts. Events are listed in chronological order, with the most recent events first.
@@ -266,9 +289,31 @@ class Events(BaseSDK):
266
289
  retry_config=retry_config,
267
290
  )
268
291
 
292
+ def next_func() -> Optional[models.ListTransactionEventsResponse]:
293
+ body = utils.unmarshal_json(http_res.text, Union[Dict[Any, Any], List[Any]])
294
+ next_cursor = JSONPath("$.next_cursor").parse(body)
295
+
296
+ if len(next_cursor) == 0:
297
+ return None
298
+
299
+ next_cursor = next_cursor[0]
300
+ if next_cursor is None or str(next_cursor).strip() == "":
301
+ return None
302
+
303
+ return self.list(
304
+ transaction_id=transaction_id,
305
+ cursor=next_cursor,
306
+ limit=limit,
307
+ merchant_account_id=merchant_account_id,
308
+ retries=retries,
309
+ )
310
+
269
311
  response_data: Any = None
270
312
  if utils.match_response(http_res, "200", "application/json"):
271
- return unmarshal_json_response(models.TransactionEvents, http_res)
313
+ return models.ListTransactionEventsResponse(
314
+ result=unmarshal_json_response(models.TransactionEvents, http_res),
315
+ next=next_func,
316
+ )
272
317
  if utils.match_response(http_res, "400", "application/json"):
273
318
  response_data = unmarshal_json_response(errors.Error400Data, http_res)
274
319
  raise errors.Error400(response_data, http_res)
gr4vy/models/__init__.py CHANGED
@@ -731,6 +731,8 @@ if TYPE_CHECKING:
731
731
  ListTransactionEventsGlobalsTypedDict,
732
732
  ListTransactionEventsRequest,
733
733
  ListTransactionEventsRequestTypedDict,
734
+ ListTransactionEventsResponse,
735
+ ListTransactionEventsResponseTypedDict,
734
736
  )
735
737
  from .list_transaction_refundsop import (
736
738
  ListTransactionRefundsGlobals,
@@ -1713,6 +1715,8 @@ __all__ = [
1713
1715
  "ListTransactionEventsGlobalsTypedDict",
1714
1716
  "ListTransactionEventsRequest",
1715
1717
  "ListTransactionEventsRequestTypedDict",
1718
+ "ListTransactionEventsResponse",
1719
+ "ListTransactionEventsResponseTypedDict",
1716
1720
  "ListTransactionRefundsGlobals",
1717
1721
  "ListTransactionRefundsGlobalsTypedDict",
1718
1722
  "ListTransactionRefundsRequest",
@@ -2629,6 +2633,8 @@ _dynamic_imports: dict[str, str] = {
2629
2633
  "ListTransactionEventsGlobalsTypedDict": ".list_transaction_eventsop",
2630
2634
  "ListTransactionEventsRequest": ".list_transaction_eventsop",
2631
2635
  "ListTransactionEventsRequestTypedDict": ".list_transaction_eventsop",
2636
+ "ListTransactionEventsResponse": ".list_transaction_eventsop",
2637
+ "ListTransactionEventsResponseTypedDict": ".list_transaction_eventsop",
2632
2638
  "ListTransactionRefundsGlobals": ".list_transaction_refundsop",
2633
2639
  "ListTransactionRefundsGlobalsTypedDict": ".list_transaction_refundsop",
2634
2640
  "ListTransactionRefundsRequest": ".list_transaction_refundsop",
@@ -1,6 +1,7 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
+ from .transactionevents import TransactionEvents, TransactionEventsTypedDict
4
5
  from gr4vy.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
6
  from gr4vy.utils import (
6
7
  FieldMetadata,
@@ -10,7 +11,7 @@ from gr4vy.utils import (
10
11
  )
11
12
  import pydantic
12
13
  from pydantic import model_serializer
13
- from typing import Optional
14
+ from typing import Callable, Optional
14
15
  from typing_extensions import Annotated, NotRequired, TypedDict
15
16
 
16
17
 
@@ -93,3 +94,13 @@ class ListTransactionEventsRequest(BaseModel):
93
94
  m[k] = val
94
95
 
95
96
  return m
97
+
98
+
99
+ class ListTransactionEventsResponseTypedDict(TypedDict):
100
+ result: TransactionEventsTypedDict
101
+
102
+
103
+ class ListTransactionEventsResponse(BaseModel):
104
+ next: Callable[[], Optional[ListTransactionEventsResponse]]
105
+
106
+ result: TransactionEvents
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gr4vy
3
- Version: 1.9.0
3
+ Version: 1.9.1
4
4
  Summary: Python Client SDK Generated by Speakeasy.
5
5
  Author: Gr4vy
6
6
  Requires-Python: >=3.9.2
@@ -2,7 +2,7 @@ gr4vy/__init__.py,sha256=w2u919V3Tzv4zEPQ-OYJ79gQ_4_SyW7GOFFoHtqXDFA,401
2
2
  gr4vy/_hooks/__init__.py,sha256=p5J13DeYuISQyQWirjJAObHIf2VtIlOtFqnIpvjjVwk,118
3
3
  gr4vy/_hooks/sdkhooks.py,sha256=3jKTs2B1lcAxBMJge9C-qL0RGbKGLcrHvikzi67Tbdo,2493
4
4
  gr4vy/_hooks/types.py,sha256=0O7dbbolkiFAnHkNULvwoLsiXJu0_Wmhev163bvZbW8,3039
5
- gr4vy/_version.py,sha256=s0bLCdk2BvwAcJNqZQVJj7fhYUbA0_8l9tAyKakbItg,452
5
+ gr4vy/_version.py,sha256=lcHig0JOjaUI84EEM6xfTMvFSbL6Fru0p4HRC3-5NmU,452
6
6
  gr4vy/account_updater.py,sha256=mmTd25Oap80PBqQ3p4MvZ_buT5VS0zWc8s8cqfI7iyA,607
7
7
  gr4vy/all.py,sha256=jZtRqz8D1xGrylI95KA2XNwWLVAID1o_AYxA9wpXTzs,15176
8
8
  gr4vy/audit_logs.py,sha256=U16uKNF7H514ZBM0cAeSz2U2JT4P-SPGIJU6d6KOH34,17087
@@ -34,13 +34,13 @@ gr4vy/errors/gr4vyerror.py,sha256=TQKXje0NIownDt_KO_v7fKS7SeC8_oeWzLlsvO_BYCY,95
34
34
  gr4vy/errors/httpvalidationerror.py,sha256=rFriemLuM5ku52059C5jbCTRebq8fmKp9WPdaAW9nvk,873
35
35
  gr4vy/errors/no_response_error.py,sha256=DaZukP5ManflzAN-11MtmBitfTIct37sRvfszvfM13o,467
36
36
  gr4vy/errors/responsevalidationerror.py,sha256=dmSlUtGff9vsv5N_nrAbn_bsppKhuI5nu9rpG456xPo,745
37
- gr4vy/events.py,sha256=wWcrHaeke9HDGjCGY3KbgcCPIgLAvOAGBMjug_i6f24,14739
37
+ gr4vy/events.py,sha256=vZDUUVStB0utFPQYaq_YzGNIdOkvjPlnLUiwrDOfTNA,16414
38
38
  gr4vy/executions.py,sha256=Z_ZjmcXjG3jD3tbbfKRHJsUZZJjnkrD8JKUGn6SCaUg,44148
39
39
  gr4vy/gift_cards_sdk.py,sha256=bVotXOI7TX5r32YIivU2_6eANtXdekxYbqeYK8MdzGA,57427
40
40
  gr4vy/httpclient.py,sha256=dqTPONDBpRn4ktXfcetQiRXnG93f0pJkFhqsYFhLUac,3945
41
41
  gr4vy/jobs.py,sha256=-UcByXMOnDc5cEiaBaXB_0S5eT2WdRWYcytE2p2j8WE,14569
42
42
  gr4vy/merchant_accounts_sdk.py,sha256=tGPWxXP7IOKeZ1Gh8LJ4yTpkSnsL-C56aXKfTCf4z9E,82263
43
- gr4vy/models/__init__.py,sha256=Sut0aPvwlhJK2KFA2YtUXbIlwAGCq7isQBGegTJQXfo,134565
43
+ gr4vy/models/__init__.py,sha256=6ngsdstyxrQ2IqHOxB40sNTZGBeMMR9jwCxqx22y_7E,134878
44
44
  gr4vy/models/accountsreceivablesreportspec.py,sha256=X4YKJ5TII4KFi1I47BYt1Egxsfs84EaqXsb7g90IpLw,1012
45
45
  gr4vy/models/accountupdaterinquirysummary.py,sha256=rOJn5uG7cNFUkd6BbsAve6ueUlAJzU5_d_zeDu6RBTg,1097
46
46
  gr4vy/models/accountupdaterjob.py,sha256=JKuRwrc5yYSAQ9lD5Ta4MALtfXBF7tn_37lllQsH2B0,1972
@@ -234,7 +234,7 @@ gr4vy/models/list_payment_servicesop.py,sha256=ZG0NLYVuJH3xpS_nIp_E-69MzdY6xW3Nq
234
234
  gr4vy/models/list_payoutsop.py,sha256=ODJKj2lqi1GGrjqeD4TVx-BeLwppyNqAsr_Dezj_poE,3168
235
235
  gr4vy/models/list_report_executionsop.py,sha256=h_YgQsNG8oBIm73SNIpGW0XP5wGJhzmifRyk9DKkoRQ,3524
236
236
  gr4vy/models/list_reportsop.py,sha256=hUA719v8VQ6OgNAzmF4ugIrwVfxnA7tOU3vXXp5oIoI,4566
237
- gr4vy/models/list_transaction_eventsop.py,sha256=vU6npR2P2YSNb2CObQNBzjzoTSdwzNMJL8GOXYFpKKE,3177
237
+ gr4vy/models/list_transaction_eventsop.py,sha256=wk83vRAbcBb8fUGbiQRv-PObaWhpsYvcjOvFqNUU134,3507
238
238
  gr4vy/models/list_transaction_refundsop.py,sha256=-JDjz-RkU744XcBZ3m7IN1ZIL0WqZMOyP9ld6dWkz3w,1531
239
239
  gr4vy/models/list_transaction_settlementsop.py,sha256=iS5odOFlm4uCMMmcrWDe5Sj6EQCLjubLpaw8zscx6-g,1579
240
240
  gr4vy/models/list_transactionsop.py,sha256=55Zgymc890E9lw8yQoF7ViPjdGRGOboPJwUMGox7mYs,23050
@@ -438,6 +438,6 @@ gr4vy/utils/unmarshal_json_response.py,sha256=G4h8gLOK09kjhPiUZjgIMm6zntcbxpvb_m
438
438
  gr4vy/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
439
439
  gr4vy/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
440
440
  gr4vy/webhooks.py,sha256=2L-ZhdK-XU2X0AkVqgZvhfRqDCKUVs7R4UNCmZJR78w,1359
441
- gr4vy-1.9.0.dist-info/METADATA,sha256=CHvbOYaJFx9KmkrLJ-a70ztW1fRV2glyKedyD1CESBc,44092
442
- gr4vy-1.9.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
443
- gr4vy-1.9.0.dist-info/RECORD,,
441
+ gr4vy-1.9.1.dist-info/METADATA,sha256=AWcGmW_NuPdxs3m02jSCS8kp8NoyPu1_j7WTSXEwAL8,44092
442
+ gr4vy-1.9.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
443
+ gr4vy-1.9.1.dist-info/RECORD,,
File without changes