gmt-python-sdk 0.43.1__tar.gz → 0.44.1__tar.gz

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 (142) hide show
  1. gmt_python_sdk-0.44.1/.gitignore +13 -0
  2. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/PKG-INFO +5 -7
  3. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/README.md +3 -5
  4. gmt_python_sdk-0.44.1/pyproject.toml +51 -0
  5. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/__init__.py +0 -2
  6. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_base_client.py +9 -0
  7. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_client.py +0 -2
  8. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_constants.py +0 -2
  9. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_exceptions.py +0 -2
  10. gmt_python_sdk-0.44.1/src/gmt/_operations.py +30 -0
  11. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_resource.py +0 -2
  12. gmt_python_sdk-0.44.1/src/gmt/_version.py +2 -0
  13. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/pagination.py +0 -2
  14. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/__init__.py +0 -2
  15. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/accounts.py +7 -8
  16. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/profile/__init__.py +0 -2
  17. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/profile/discount.py +3 -4
  18. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/profile/profile.py +11 -12
  19. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/profile/referral/__init__.py +0 -2
  20. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/profile/referral/referral.py +5 -6
  21. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/profile/referral/transaction.py +3 -4
  22. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/purchases/__init__.py +0 -2
  23. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/purchases/bulk.py +36 -8
  24. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/purchases/purchases.py +40 -12
  25. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/purchases_by_hash.py +5 -6
  26. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/service.py +5 -6
  27. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/resources/webhooks.py +3 -4
  28. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/__init__.py +0 -2
  29. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/account_list_countries_params.py +0 -2
  30. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/account_list_countries_response.py +0 -2
  31. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/account_list_params.py +0 -2
  32. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/account_list_response.py +0 -2
  33. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/account_retrieve_response.py +0 -2
  34. gmt_python_sdk-0.44.1/src/gmt/types/code_page.py +10 -0
  35. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile/__init__.py +0 -2
  36. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile/discount_retrieve_response.py +0 -2
  37. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile/referral/__init__.py +0 -2
  38. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile/referral/transaction_list_params.py +0 -2
  39. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile/referral/transaction_list_response.py +0 -2
  40. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile/referral_retrieve_response.py +0 -2
  41. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile/referral_transfer_balance_params.py +0 -2
  42. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile/referral_transfer_balance_response.py +0 -2
  43. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile_change_language_params.py +0 -2
  44. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile_change_language_response.py +0 -2
  45. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile_change_login_params.py +0 -2
  46. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile_change_login_response.py +0 -2
  47. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile_change_password_params.py +0 -2
  48. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile_change_password_response.py +0 -2
  49. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile_retrieve_response.py +0 -2
  50. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/profile_unbind_telegram_response.py +0 -2
  51. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchase_create_params.py +0 -2
  52. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchase_create_response.py +3 -2
  53. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchase_list_params.py +0 -2
  54. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchase_list_response.py +3 -2
  55. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchase_refund_response.py +3 -2
  56. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchase_request_verification_code_params.py +0 -2
  57. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchase_request_verification_code_response.py +3 -2
  58. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchase_retrieve_response.py +3 -2
  59. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchases/__init__.py +0 -2
  60. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchases/bulk_create_params.py +0 -2
  61. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchases/bulk_create_response.py +0 -2
  62. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchases/bulk_retrieve_response.py +1 -2
  63. gmt_python_sdk-0.44.1/src/gmt/types/purchases/list_responses.py +51 -0
  64. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchases_by_hash_request_verification_code_params.py +0 -2
  65. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchases_by_hash_request_verification_code_response.py +3 -2
  66. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/purchases_by_hash_retrieve_response.py +3 -2
  67. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/service_get_server_time_response.py +0 -2
  68. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/service_health_check_response.py +0 -2
  69. gmt_python_sdk-0.44.1/src/gmt/types/telegram/__init__.py +1 -0
  70. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/webhook_test_params.py +0 -2
  71. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/types/webhook_test_response.py +0 -2
  72. gmt_python_sdk-0.43.1/.gitignore +0 -16
  73. gmt_python_sdk-0.43.1/.release-please-manifest.json +0 -3
  74. gmt_python_sdk-0.43.1/CHANGELOG.md +0 -543
  75. gmt_python_sdk-0.43.1/CONTRIBUTING.md +0 -121
  76. gmt_python_sdk-0.43.1/SECURITY.md +0 -23
  77. gmt_python_sdk-0.43.1/api.md +0 -149
  78. gmt_python_sdk-0.43.1/bin/check-release-environment +0 -21
  79. gmt_python_sdk-0.43.1/bin/publish-pypi +0 -7
  80. gmt_python_sdk-0.43.1/examples/.keep +0 -4
  81. gmt_python_sdk-0.43.1/pyproject.toml +0 -255
  82. gmt_python_sdk-0.43.1/release-please-config.json +0 -66
  83. gmt_python_sdk-0.43.1/requirements-dev.lock +0 -110
  84. gmt_python_sdk-0.43.1/src/gmt/_version.py +0 -4
  85. gmt_python_sdk-0.43.1/src/gmt/types/telegram/__init__.py +0 -3
  86. gmt_python_sdk-0.43.1/tests/__init__.py +0 -1
  87. gmt_python_sdk-0.43.1/tests/api_resources/__init__.py +0 -1
  88. gmt_python_sdk-0.43.1/tests/api_resources/profile/__init__.py +0 -1
  89. gmt_python_sdk-0.43.1/tests/api_resources/profile/referral/__init__.py +0 -1
  90. gmt_python_sdk-0.43.1/tests/api_resources/profile/referral/test_transaction.py +0 -99
  91. gmt_python_sdk-0.43.1/tests/api_resources/profile/test_discount.py +0 -80
  92. gmt_python_sdk-0.43.1/tests/api_resources/profile/test_referral.py +0 -151
  93. gmt_python_sdk-0.43.1/tests/api_resources/purchases/__init__.py +0 -1
  94. gmt_python_sdk-0.43.1/tests/api_resources/purchases/test_bulk.py +0 -254
  95. gmt_python_sdk-0.43.1/tests/api_resources/test_accounts.py +0 -317
  96. gmt_python_sdk-0.43.1/tests/api_resources/test_profile.py +0 -346
  97. gmt_python_sdk-0.43.1/tests/api_resources/test_purchases.py +0 -425
  98. gmt_python_sdk-0.43.1/tests/api_resources/test_purchases_by_hash.py +0 -213
  99. gmt_python_sdk-0.43.1/tests/api_resources/test_service.py +0 -136
  100. gmt_python_sdk-0.43.1/tests/api_resources/test_webhooks.py +0 -98
  101. gmt_python_sdk-0.43.1/tests/conftest.py +0 -84
  102. gmt_python_sdk-0.43.1/tests/sample_file.txt +0 -1
  103. gmt_python_sdk-0.43.1/tests/test_client.py +0 -1940
  104. gmt_python_sdk-0.43.1/tests/test_extract_files.py +0 -91
  105. gmt_python_sdk-0.43.1/tests/test_files.py +0 -148
  106. gmt_python_sdk-0.43.1/tests/test_models.py +0 -1017
  107. gmt_python_sdk-0.43.1/tests/test_qs.py +0 -78
  108. gmt_python_sdk-0.43.1/tests/test_required_args.py +0 -111
  109. gmt_python_sdk-0.43.1/tests/test_response.py +0 -277
  110. gmt_python_sdk-0.43.1/tests/test_streaming.py +0 -248
  111. gmt_python_sdk-0.43.1/tests/test_transform.py +0 -460
  112. gmt_python_sdk-0.43.1/tests/test_utils/test_datetime_parse.py +0 -110
  113. gmt_python_sdk-0.43.1/tests/test_utils/test_json.py +0 -126
  114. gmt_python_sdk-0.43.1/tests/test_utils/test_path.py +0 -89
  115. gmt_python_sdk-0.43.1/tests/test_utils/test_proxy.py +0 -34
  116. gmt_python_sdk-0.43.1/tests/test_utils/test_typing.py +0 -73
  117. gmt_python_sdk-0.43.1/tests/utils.py +0 -167
  118. gmt_python_sdk-0.43.1/uv.lock +0 -1829
  119. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/LICENSE +0 -0
  120. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_compat.py +0 -0
  121. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_files.py +0 -0
  122. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_models.py +0 -0
  123. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_qs.py +0 -0
  124. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_response.py +0 -0
  125. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_streaming.py +0 -0
  126. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_types.py +0 -0
  127. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/__init__.py +0 -0
  128. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_compat.py +0 -0
  129. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_datetime_parse.py +0 -0
  130. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_json.py +0 -0
  131. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_logs.py +0 -0
  132. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_path.py +0 -0
  133. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_proxy.py +0 -0
  134. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_reflection.py +0 -0
  135. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_resources_proxy.py +0 -0
  136. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_streams.py +0 -0
  137. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_sync.py +0 -0
  138. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_transform.py +0 -0
  139. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_typing.py +0 -0
  140. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/_utils/_utils.py +0 -0
  141. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/lib/.keep +0 -0
  142. {gmt_python_sdk-0.43.1 → gmt_python_sdk-0.44.1}/src/gmt/py.typed +0 -0
@@ -0,0 +1,13 @@
1
+ node_modules/
2
+ .cache/
3
+ .bun-cache/
4
+ dist/
5
+ coverage/
6
+ .env
7
+ .env.local
8
+ .local-tenant-banners/
9
+ *.tsbuildinfo
10
+ .DS_Store
11
+ src/database/client/
12
+
13
+ __pycache__/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: gmt-python-sdk
3
- Version: 0.43.1
3
+ Version: 0.44.1
4
4
  Summary: The official Python library for the gmt API
5
5
  Project-URL: Homepage, https://github.com/cameo6/gmt-python-sdk
6
6
  Project-URL: Repository, https://github.com/cameo6/gmt-python-sdk
@@ -42,11 +42,11 @@ The Gmt Python library provides convenient access to the Gmt REST API from any P
42
42
  application. The library includes type definitions for all request params and response fields,
43
43
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
44
44
 
45
- It is generated with [Stainless](https://www.stainless.com/).
45
+ GMT maintains the public client and generates its internal routes from OpenAPI.
46
46
 
47
47
  ## Documentation
48
48
 
49
- The REST API documentation can be found on [api.getmytg.com](https://api.getmytg.com/docs). The full API of this library can be found in [api.md](https://github.com/cameo6/gmt-python-sdk/tree/main/api.md).
49
+ See the [GMT API reference](https://api.getmytg.com/docs) for endpoints and SDK examples.
50
50
 
51
51
  ## Installation
52
52
 
@@ -57,8 +57,6 @@ pip install gmt-python-sdk
57
57
 
58
58
  ## Usage
59
59
 
60
- The full API of this library can be found in [api.md](https://github.com/cameo6/gmt-python-sdk/tree/main/api.md).
61
-
62
60
  ```python
63
61
  from gmt import Gmt
64
62
 
@@ -299,7 +297,7 @@ client.with_options(timeout=5.0).service.health_check()
299
297
 
300
298
  On timeout, an `APITimeoutError` is thrown.
301
299
 
302
- Note that requests that time out are [retried twice by default](https://github.com/cameo6/gmt-python-sdk/tree/main/#retries).
300
+ Note that requests that time out are [retried twice by default](#retries).
303
301
 
304
302
  ## Advanced
305
303
 
@@ -467,4 +465,4 @@ Python 3.9 or higher.
467
465
 
468
466
  ## Contributing
469
467
 
470
- See [the contributing documentation](https://github.com/cameo6/gmt-python-sdk/tree/main/./CONTRIBUTING.md).
468
+ Use the SDK repository linked in the package metadata to report issues.
@@ -7,11 +7,11 @@ The Gmt Python library provides convenient access to the Gmt REST API from any P
7
7
  application. The library includes type definitions for all request params and response fields,
8
8
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
9
9
 
10
- It is generated with [Stainless](https://www.stainless.com/).
10
+ GMT maintains the public client and generates its internal routes from OpenAPI.
11
11
 
12
12
  ## Documentation
13
13
 
14
- The REST API documentation can be found on [api.getmytg.com](https://api.getmytg.com/docs). The full API of this library can be found in [api.md](api.md).
14
+ See the [GMT API reference](https://api.getmytg.com/docs) for endpoints and SDK examples.
15
15
 
16
16
  ## Installation
17
17
 
@@ -22,8 +22,6 @@ pip install gmt-python-sdk
22
22
 
23
23
  ## Usage
24
24
 
25
- The full API of this library can be found in [api.md](api.md).
26
-
27
25
  ```python
28
26
  from gmt import Gmt
29
27
 
@@ -432,4 +430,4 @@ Python 3.9 or higher.
432
430
 
433
431
  ## Contributing
434
432
 
435
- See [the contributing documentation](./CONTRIBUTING.md).
433
+ Use the SDK repository linked in the package metadata to report issues.
@@ -0,0 +1,51 @@
1
+ [project]
2
+ name = "gmt-python-sdk"
3
+ version = "0.44.1"
4
+ description = "The official Python library for the gmt API"
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ authors = [
8
+ { name = "Gmt", email = "contact@example.com" },
9
+ ]
10
+
11
+ dependencies = [
12
+ "httpx>=0.23.0, <1",
13
+ "pydantic>=1.9.0, <3",
14
+ "typing-extensions>=4.14, <5",
15
+ "anyio>=3.5.0, <5",
16
+ "distro>=1.7.0, <2",
17
+ "sniffio",
18
+ ]
19
+
20
+ requires-python = ">= 3.9"
21
+ classifiers = [
22
+ "Typing :: Typed",
23
+ "Intended Audience :: Developers",
24
+ "Programming Language :: Python :: 3.9",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: 3.14",
30
+ "Operating System :: OS Independent",
31
+ "Operating System :: POSIX",
32
+ "Operating System :: MacOS",
33
+ "Operating System :: POSIX :: Linux",
34
+ "Operating System :: Microsoft :: Windows",
35
+ "Topic :: Software Development :: Libraries :: Python Modules",
36
+ "License :: OSI Approved :: Apache Software License"
37
+ ]
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/cameo6/gmt-python-sdk"
41
+ Repository = "https://github.com/cameo6/gmt-python-sdk"
42
+
43
+ [project.optional-dependencies]
44
+ aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
45
+
46
+ [build-system]
47
+ requires = ["hatchling==1.26.3"]
48
+ build-backend = "hatchling.build"
49
+
50
+ [tool.hatch.build.targets.wheel]
51
+ packages = ["src/gmt"]
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  import typing as _t
4
2
 
5
3
  from . import types
@@ -40,6 +40,7 @@ from httpx import URL
40
40
  from pydantic import PrivateAttr
41
41
 
42
42
  from . import _exceptions
43
+ from ._operations import OPERATIONS
43
44
  from ._qs import Querystring
44
45
  from ._files import to_httpx_files, async_to_httpx_files
45
46
  from ._types import (
@@ -444,6 +445,14 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
444
445
  if idempotency_header and options.idempotency_key and idempotency_header not in headers:
445
446
  headers[idempotency_header] = options.idempotency_key
446
447
 
448
+ if (
449
+ options.method.lower() == "post"
450
+ and options.url in (OPERATIONS["postV1Purchases"], OPERATIONS["postV1PurchasesBulk"])
451
+ and options.idempotency_key
452
+ and not headers.get("Idempotency-Key")
453
+ ):
454
+ headers["Idempotency-Key"] = options.idempotency_key
455
+
447
456
  # Don't set these headers if they were already set or removed by the caller. We check
448
457
  # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
449
458
  lower_custom_headers = [header.lower() for header in custom_headers]
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from __future__ import annotations
4
2
 
5
3
  import os
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  import httpx
4
2
 
5
3
  RAW_RESPONSE_HEADER = "X-Stainless-Raw-Response"
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from __future__ import annotations
4
2
 
5
3
  from typing_extensions import Literal
@@ -0,0 +1,30 @@
1
+ # Generated by scripts/sdk/generate.py.
2
+ OPERATIONS = {
3
+ "getV1Accounts": "/v1/accounts/",
4
+ "getV1AccountsByCountry_code": "/v1/accounts/{country_code}",
5
+ "getV1AccountsCountries": "/v1/accounts/countries",
6
+ "getV1Profile": "/v1/profile/",
7
+ "getV1ProfileDiscount": "/v1/profile/discount",
8
+ "getV1ProfileReferral": "/v1/profile/referral",
9
+ "getV1ProfileReferralTransaction": "/v1/profile/referral/transaction",
10
+ "getV1Purchases": "/v1/purchases/",
11
+ "getV1Purchases-by-hashByHash": "/v1/purchases-by-hash/{hash}",
12
+ "getV1PurchasesBulk": "/v1/purchases/bulk",
13
+ "getV1PurchasesBulkByPurchase_id": "/v1/purchases/bulk/{purchase_id}",
14
+ "getV1PurchasesBulkByPurchase_idDownload": "/v1/purchases/bulk/{purchase_id}/download",
15
+ "getV1PurchasesByPurchase_id": "/v1/purchases/{purchase_id}",
16
+ "getV1PurchasesHistory": "/v1/purchases/history",
17
+ "getV1ServiceHealth": "/v1/service/health",
18
+ "getV1ServiceTime": "/v1/service/time",
19
+ "patchV1ProfileChange-login": "/v1/profile/change-login",
20
+ "patchV1ProfileChange-password": "/v1/profile/change-password",
21
+ "patchV1ProfileLanguage": "/v1/profile/language",
22
+ "patchV1ProfileUnbind-telegram": "/v1/profile/unbind-telegram",
23
+ "postV1ProfileReferralTransfer-balance": "/v1/profile/referral/transfer-balance",
24
+ "postV1Purchases": "/v1/purchases/",
25
+ "postV1Purchases-by-hashByHashRequest-code": "/v1/purchases-by-hash/{hash}/request-code",
26
+ "postV1PurchasesBulk": "/v1/purchases/bulk",
27
+ "postV1PurchasesByPurchase_idRefund": "/v1/purchases/{purchase_id}/refund",
28
+ "postV1PurchasesByPurchase_idRequest-code": "/v1/purchases/{purchase_id}/request-code",
29
+ "postV1WebhooksTest": "/v1/webhooks/test",
30
+ }
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from __future__ import annotations
4
2
 
5
3
  import time
@@ -0,0 +1,2 @@
1
+ __title__ = "gmt"
2
+ __version__ = "0.44.1" # x-release-please-version
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from typing import List, Generic, TypeVar, Optional
4
2
  from typing_extensions import override
5
3
 
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from .profile import (
4
2
  ProfileResource,
5
3
  AsyncProfileResource,
@@ -1,11 +1,10 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from __future__ import annotations
4
2
 
5
3
  from typing_extensions import Literal
6
4
 
7
5
  import httpx
8
6
 
7
+ from .._operations import OPERATIONS
9
8
  from ..types import account_list_params, account_list_countries_params
10
9
  from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
11
10
  from .._utils import path_template, maybe_transform
@@ -100,7 +99,7 @@ class AccountsResource(SyncAPIResource):
100
99
  if not country_code:
101
100
  raise ValueError(f"Expected a non-empty value for `country_code` but received {country_code!r}")
102
101
  return self._get(
103
- path_template("/v1/accounts/{country_code}", country_code=country_code),
102
+ path_template(OPERATIONS["getV1AccountsByCountry_code"], country_code=country_code),
104
103
  options=make_request_options(
105
104
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
106
105
  ),
@@ -158,7 +157,7 @@ class AccountsResource(SyncAPIResource):
158
157
  timeout: Override the client-level default timeout for this request, in seconds
159
158
  """
160
159
  return self._get_api_list(
161
- "/v1/accounts/",
160
+ OPERATIONS["getV1Accounts"],
162
161
  page=SyncPageNumber[AccountListResponse],
163
162
  options=make_request_options(
164
163
  extra_headers=extra_headers,
@@ -227,7 +226,7 @@ class AccountsResource(SyncAPIResource):
227
226
  timeout: Override the client-level default timeout for this request, in seconds
228
227
  """
229
228
  return self._get_api_list(
230
- "/v1/accounts/countries",
229
+ OPERATIONS["getV1AccountsCountries"],
231
230
  page=SyncPageNumber[AccountListCountriesResponse],
232
231
  options=make_request_options(
233
232
  extra_headers=extra_headers,
@@ -322,7 +321,7 @@ class AsyncAccountsResource(AsyncAPIResource):
322
321
  if not country_code:
323
322
  raise ValueError(f"Expected a non-empty value for `country_code` but received {country_code!r}")
324
323
  return await self._get(
325
- path_template("/v1/accounts/{country_code}", country_code=country_code),
324
+ path_template(OPERATIONS["getV1AccountsByCountry_code"], country_code=country_code),
326
325
  options=make_request_options(
327
326
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
328
327
  ),
@@ -380,7 +379,7 @@ class AsyncAccountsResource(AsyncAPIResource):
380
379
  timeout: Override the client-level default timeout for this request, in seconds
381
380
  """
382
381
  return self._get_api_list(
383
- "/v1/accounts/",
382
+ OPERATIONS["getV1Accounts"],
384
383
  page=AsyncPageNumber[AccountListResponse],
385
384
  options=make_request_options(
386
385
  extra_headers=extra_headers,
@@ -449,7 +448,7 @@ class AsyncAccountsResource(AsyncAPIResource):
449
448
  timeout: Override the client-level default timeout for this request, in seconds
450
449
  """
451
450
  return self._get_api_list(
452
- "/v1/accounts/countries",
451
+ OPERATIONS["getV1AccountsCountries"],
453
452
  page=AsyncPageNumber[AccountListCountriesResponse],
454
453
  options=make_request_options(
455
454
  extra_headers=extra_headers,
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from .profile import (
4
2
  ProfileResource,
5
3
  AsyncProfileResource,
@@ -1,9 +1,8 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from __future__ import annotations
4
2
 
5
3
  import httpx
6
4
 
5
+ from ..._operations import OPERATIONS
7
6
  from ..._types import Body, Query, Headers, NotGiven, not_given
8
7
  from ..._compat import cached_property
9
8
  from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -56,7 +55,7 @@ class DiscountResource(SyncAPIResource):
56
55
  history.
57
56
  """
58
57
  return self._get(
59
- "/v1/profile/discount",
58
+ OPERATIONS["getV1ProfileDiscount"],
60
59
  options=make_request_options(
61
60
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
62
61
  ),
@@ -101,7 +100,7 @@ class AsyncDiscountResource(AsyncAPIResource):
101
100
  history.
102
101
  """
103
102
  return await self._get(
104
- "/v1/profile/discount",
103
+ OPERATIONS["getV1ProfileDiscount"],
105
104
  options=make_request_options(
106
105
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
107
106
  ),
@@ -1,11 +1,10 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from __future__ import annotations
4
2
 
5
3
  from typing_extensions import Literal
6
4
 
7
5
  import httpx
8
6
 
7
+ from ..._operations import OPERATIONS
9
8
  from ...types import profile_change_login_params, profile_change_language_params, profile_change_password_params
10
9
  from ..._types import Body, Query, Headers, NotGiven, not_given
11
10
  from ..._utils import maybe_transform, async_maybe_transform
@@ -90,7 +89,7 @@ class ProfileResource(SyncAPIResource):
90
89
  program levels.
91
90
  """
92
91
  return self._get(
93
- "/v1/profile/",
92
+ OPERATIONS["getV1Profile"],
94
93
  options=make_request_options(
95
94
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
96
95
  ),
@@ -123,7 +122,7 @@ class ProfileResource(SyncAPIResource):
123
122
  timeout: Override the client-level default timeout for this request, in seconds
124
123
  """
125
124
  return self._patch(
126
- "/v1/profile/language",
125
+ OPERATIONS["patchV1ProfileLanguage"],
127
126
  body=maybe_transform({"language": language}, profile_change_language_params.ProfileChangeLanguageParams),
128
127
  options=make_request_options(
129
128
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -157,7 +156,7 @@ class ProfileResource(SyncAPIResource):
157
156
  timeout: Override the client-level default timeout for this request, in seconds
158
157
  """
159
158
  return self._patch(
160
- "/v1/profile/change-login",
159
+ OPERATIONS["patchV1ProfileChange-login"],
161
160
  body=maybe_transform({"new_login": new_login}, profile_change_login_params.ProfileChangeLoginParams),
162
161
  options=make_request_options(
163
162
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -192,7 +191,7 @@ class ProfileResource(SyncAPIResource):
192
191
  timeout: Override the client-level default timeout for this request, in seconds
193
192
  """
194
193
  return self._patch(
195
- "/v1/profile/change-password",
194
+ OPERATIONS["patchV1ProfileChange-password"],
196
195
  body=maybe_transform(
197
196
  {"new_password": new_password}, profile_change_password_params.ProfileChangePasswordParams
198
197
  ),
@@ -217,7 +216,7 @@ class ProfileResource(SyncAPIResource):
217
216
  remains on the web account.
218
217
  """
219
218
  return self._patch(
220
- "/v1/profile/unbind-telegram",
219
+ OPERATIONS["patchV1ProfileUnbind-telegram"],
221
220
  options=make_request_options(
222
221
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
223
222
  ),
@@ -272,7 +271,7 @@ class AsyncProfileResource(AsyncAPIResource):
272
271
  program levels.
273
272
  """
274
273
  return await self._get(
275
- "/v1/profile/",
274
+ OPERATIONS["getV1Profile"],
276
275
  options=make_request_options(
277
276
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
278
277
  ),
@@ -305,7 +304,7 @@ class AsyncProfileResource(AsyncAPIResource):
305
304
  timeout: Override the client-level default timeout for this request, in seconds
306
305
  """
307
306
  return await self._patch(
308
- "/v1/profile/language",
307
+ OPERATIONS["patchV1ProfileLanguage"],
309
308
  body=await async_maybe_transform(
310
309
  {"language": language}, profile_change_language_params.ProfileChangeLanguageParams
311
310
  ),
@@ -341,7 +340,7 @@ class AsyncProfileResource(AsyncAPIResource):
341
340
  timeout: Override the client-level default timeout for this request, in seconds
342
341
  """
343
342
  return await self._patch(
344
- "/v1/profile/change-login",
343
+ OPERATIONS["patchV1ProfileChange-login"],
345
344
  body=await async_maybe_transform(
346
345
  {"new_login": new_login}, profile_change_login_params.ProfileChangeLoginParams
347
346
  ),
@@ -378,7 +377,7 @@ class AsyncProfileResource(AsyncAPIResource):
378
377
  timeout: Override the client-level default timeout for this request, in seconds
379
378
  """
380
379
  return await self._patch(
381
- "/v1/profile/change-password",
380
+ OPERATIONS["patchV1ProfileChange-password"],
382
381
  body=await async_maybe_transform(
383
382
  {"new_password": new_password}, profile_change_password_params.ProfileChangePasswordParams
384
383
  ),
@@ -403,7 +402,7 @@ class AsyncProfileResource(AsyncAPIResource):
403
402
  remains on the web account.
404
403
  """
405
404
  return await self._patch(
406
- "/v1/profile/unbind-telegram",
405
+ OPERATIONS["patchV1ProfileUnbind-telegram"],
407
406
  options=make_request_options(
408
407
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
409
408
  ),
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from .referral import (
4
2
  ReferralResource,
5
3
  AsyncReferralResource,
@@ -1,9 +1,8 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from __future__ import annotations
4
2
 
5
3
  import httpx
6
4
 
5
+ from ...._operations import OPERATIONS
7
6
  from ...._types import Body, Query, Headers, NotGiven, not_given
8
7
  from ...._utils import maybe_transform, async_maybe_transform
9
8
  from ...._compat import cached_property
@@ -72,7 +71,7 @@ class ReferralResource(SyncAPIResource):
72
71
  percentage, referral count, and earnings.
73
72
  """
74
73
  return self._get(
75
- "/v1/profile/referral",
74
+ OPERATIONS["getV1ProfileReferral"],
76
75
  options=make_request_options(
77
76
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
78
77
  ),
@@ -106,7 +105,7 @@ class ReferralResource(SyncAPIResource):
106
105
  timeout: Override the client-level default timeout for this request, in seconds
107
106
  """
108
107
  return self._post(
109
- "/v1/profile/referral/transfer-balance",
108
+ OPERATIONS["postV1ProfileReferralTransfer-balance"],
110
109
  body=maybe_transform({"amount": amount}, referral_transfer_balance_params.ReferralTransferBalanceParams),
111
110
  options=make_request_options(
112
111
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
@@ -157,7 +156,7 @@ class AsyncReferralResource(AsyncAPIResource):
157
156
  percentage, referral count, and earnings.
158
157
  """
159
158
  return await self._get(
160
- "/v1/profile/referral",
159
+ OPERATIONS["getV1ProfileReferral"],
161
160
  options=make_request_options(
162
161
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
163
162
  ),
@@ -191,7 +190,7 @@ class AsyncReferralResource(AsyncAPIResource):
191
190
  timeout: Override the client-level default timeout for this request, in seconds
192
191
  """
193
192
  return await self._post(
194
- "/v1/profile/referral/transfer-balance",
193
+ OPERATIONS["postV1ProfileReferralTransfer-balance"],
195
194
  body=await async_maybe_transform(
196
195
  {"amount": amount}, referral_transfer_balance_params.ReferralTransferBalanceParams
197
196
  ),
@@ -1,9 +1,8 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from __future__ import annotations
4
2
 
5
3
  import httpx
6
4
 
5
+ from ...._operations import OPERATIONS
7
6
  from ...._types import Body, Query, Headers, NotGiven, not_given
8
7
  from ...._utils import maybe_transform
9
8
  from ...._compat import cached_property
@@ -74,7 +73,7 @@ class TransactionResource(SyncAPIResource):
74
73
  timeout: Override the client-level default timeout for this request, in seconds
75
74
  """
76
75
  return self._get_api_list(
77
- "/v1/profile/referral/transaction",
76
+ OPERATIONS["getV1ProfileReferralTransaction"],
78
77
  page=SyncPageNumber[TransactionListResponse],
79
78
  options=make_request_options(
80
79
  extra_headers=extra_headers,
@@ -145,7 +144,7 @@ class AsyncTransactionResource(AsyncAPIResource):
145
144
  timeout: Override the client-level default timeout for this request, in seconds
146
145
  """
147
146
  return self._get_api_list(
148
- "/v1/profile/referral/transaction",
147
+ OPERATIONS["getV1ProfileReferralTransaction"],
149
148
  page=AsyncPageNumber[TransactionListResponse],
150
149
  options=make_request_options(
151
150
  extra_headers=extra_headers,
@@ -1,5 +1,3 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from .bulk import (
4
2
  BulkResource,
5
3
  AsyncBulkResource,
@@ -1,9 +1,9 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
1
  from __future__ import annotations
4
2
 
5
3
  import httpx
6
4
 
5
+ from ..._operations import OPERATIONS
6
+ from ...types.purchases.list_responses import BulkListResponse, PurchaseSort, PurchaseStatus
7
7
  from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
8
8
  from ..._utils import path_template, maybe_transform, async_maybe_transform
9
9
  from ..._compat import cached_property
@@ -25,6 +25,20 @@ __all__ = ["BulkResource", "AsyncBulkResource"]
25
25
  class BulkResource(SyncAPIResource):
26
26
  """Purchase history and management."""
27
27
 
28
+ def list(
29
+ self, *, page: int | None = None, page_size: int | None = None,
30
+ sort: PurchaseSort | None = None, status: PurchaseStatus | None = None,
31
+ extra_headers: Headers | None = None,
32
+ ) -> BulkListResponse:
33
+ query = {"page": page, "page_size": page_size, "sort": sort, "status": status}
34
+ return self._get(
35
+ OPERATIONS["getV1PurchasesBulk"],
36
+ options=make_request_options(query={key: value for key, value in query.items() if value is not None},
37
+ extra_headers=extra_headers),
38
+ cast_to=BulkListResponse,
39
+ )
40
+
41
+
28
42
  @cached_property
29
43
  def with_raw_response(self) -> BulkResourceWithRawResponse:
30
44
  """
@@ -95,7 +109,7 @@ class BulkResource(SyncAPIResource):
95
109
  timeout: Override the client-level default timeout for this request, in seconds
96
110
  """
97
111
  return self._post(
98
- "/v1/purchases/bulk",
112
+ OPERATIONS["postV1PurchasesBulk"],
99
113
  body=maybe_transform(
100
114
  {
101
115
  "country_code": country_code,
@@ -137,7 +151,7 @@ class BulkResource(SyncAPIResource):
137
151
  timeout: Override the client-level default timeout for this request, in seconds
138
152
  """
139
153
  return self._get(
140
- path_template("/v1/purchases/bulk/{purchase_id}", purchase_id=purchase_id),
154
+ path_template(OPERATIONS["getV1PurchasesBulkByPurchase_id"], purchase_id=purchase_id),
141
155
  options=make_request_options(
142
156
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
143
157
  ),
@@ -172,7 +186,7 @@ class BulkResource(SyncAPIResource):
172
186
  """
173
187
  extra_headers = {"Accept": "*/*", **(extra_headers or {})}
174
188
  return self._get(
175
- path_template("/v1/purchases/bulk/{purchase_id}/download", purchase_id=purchase_id),
189
+ path_template(OPERATIONS["getV1PurchasesBulkByPurchase_idDownload"], purchase_id=purchase_id),
176
190
  options=make_request_options(
177
191
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
178
192
  ),
@@ -183,6 +197,20 @@ class BulkResource(SyncAPIResource):
183
197
  class AsyncBulkResource(AsyncAPIResource):
184
198
  """Purchase history and management."""
185
199
 
200
+ async def list(
201
+ self, *, page: int | None = None, page_size: int | None = None,
202
+ sort: PurchaseSort | None = None, status: PurchaseStatus | None = None,
203
+ extra_headers: Headers | None = None,
204
+ ) -> BulkListResponse:
205
+ query = {"page": page, "page_size": page_size, "sort": sort, "status": status}
206
+ return await self._get(
207
+ OPERATIONS["getV1PurchasesBulk"],
208
+ options=make_request_options(query={key: value for key, value in query.items() if value is not None},
209
+ extra_headers=extra_headers),
210
+ cast_to=BulkListResponse,
211
+ )
212
+
213
+
186
214
  @cached_property
187
215
  def with_raw_response(self) -> AsyncBulkResourceWithRawResponse:
188
216
  """
@@ -253,7 +281,7 @@ class AsyncBulkResource(AsyncAPIResource):
253
281
  timeout: Override the client-level default timeout for this request, in seconds
254
282
  """
255
283
  return await self._post(
256
- "/v1/purchases/bulk",
284
+ OPERATIONS["postV1PurchasesBulk"],
257
285
  body=await async_maybe_transform(
258
286
  {
259
287
  "country_code": country_code,
@@ -295,7 +323,7 @@ class AsyncBulkResource(AsyncAPIResource):
295
323
  timeout: Override the client-level default timeout for this request, in seconds
296
324
  """
297
325
  return await self._get(
298
- path_template("/v1/purchases/bulk/{purchase_id}", purchase_id=purchase_id),
326
+ path_template(OPERATIONS["getV1PurchasesBulkByPurchase_id"], purchase_id=purchase_id),
299
327
  options=make_request_options(
300
328
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
301
329
  ),
@@ -330,7 +358,7 @@ class AsyncBulkResource(AsyncAPIResource):
330
358
  """
331
359
  extra_headers = {"Accept": "*/*", **(extra_headers or {})}
332
360
  return await self._get(
333
- path_template("/v1/purchases/bulk/{purchase_id}/download", purchase_id=purchase_id),
361
+ path_template(OPERATIONS["getV1PurchasesBulkByPurchase_idDownload"], purchase_id=purchase_id),
334
362
  options=make_request_options(
335
363
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
336
364
  ),