gmt-python-sdk 0.24.0__tar.gz → 0.24.2__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 (109) hide show
  1. gmt_python_sdk-0.24.2/.release-please-manifest.json +3 -0
  2. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/CHANGELOG.md +26 -0
  3. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/PKG-INFO +2 -2
  4. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/pyproject.toml +2 -2
  5. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_client.py +222 -0
  6. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_compat.py +9 -2
  7. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_response.py +3 -0
  8. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_streaming.py +8 -3
  9. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_version.py +1 -1
  10. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/resources/accounts.py +20 -0
  11. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/resources/profile.py +4 -0
  12. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/resources/purchases/bulk.py +4 -0
  13. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/resources/purchases/purchases.py +10 -0
  14. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/resources/service.py +4 -0
  15. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/resources/webhooks.py +52 -0
  16. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_client.py +16 -0
  17. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/uv.lock +1 -1
  18. gmt_python_sdk-0.24.0/.release-please-manifest.json +0 -3
  19. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/.gitignore +0 -0
  20. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/CONTRIBUTING.md +0 -0
  21. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/LICENSE +0 -0
  22. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/README.md +0 -0
  23. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/SECURITY.md +0 -0
  24. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/api.md +0 -0
  25. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/bin/check-release-environment +0 -0
  26. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/bin/publish-pypi +0 -0
  27. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/examples/.keep +0 -0
  28. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/release-please-config.json +0 -0
  29. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/requirements-dev.lock +0 -0
  30. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/__init__.py +0 -0
  31. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_base_client.py +0 -0
  32. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_constants.py +0 -0
  33. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_exceptions.py +0 -0
  34. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_files.py +0 -0
  35. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_models.py +0 -0
  36. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_qs.py +0 -0
  37. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_resource.py +0 -0
  38. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_types.py +0 -0
  39. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/__init__.py +0 -0
  40. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_compat.py +0 -0
  41. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_datetime_parse.py +0 -0
  42. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_json.py +0 -0
  43. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_logs.py +0 -0
  44. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_proxy.py +0 -0
  45. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_reflection.py +0 -0
  46. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_resources_proxy.py +0 -0
  47. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_streams.py +0 -0
  48. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_sync.py +0 -0
  49. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_transform.py +0 -0
  50. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_typing.py +0 -0
  51. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/_utils/_utils.py +0 -0
  52. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/lib/.keep +0 -0
  53. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/pagination.py +0 -0
  54. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/py.typed +0 -0
  55. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/resources/__init__.py +0 -0
  56. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/resources/purchases/__init__.py +0 -0
  57. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/__init__.py +0 -0
  58. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/account_list_countries_params.py +0 -0
  59. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/account_list_countries_response.py +0 -0
  60. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/account_list_params.py +0 -0
  61. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/account_list_response.py +0 -0
  62. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/account_retrieve_response.py +0 -0
  63. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/profile_change_login_params.py +0 -0
  64. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/profile_change_login_response.py +0 -0
  65. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/profile_change_password_params.py +0 -0
  66. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/profile_change_password_response.py +0 -0
  67. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/profile_retrieve_response.py +0 -0
  68. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/profile_unbind_telegram_response.py +0 -0
  69. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchase_create_params.py +0 -0
  70. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchase_create_response.py +0 -0
  71. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchase_list_params.py +0 -0
  72. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchase_list_response.py +0 -0
  73. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchase_refund_response.py +0 -0
  74. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchase_request_verification_code_params.py +0 -0
  75. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchase_request_verification_code_response.py +0 -0
  76. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchase_retrieve_response.py +0 -0
  77. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchases/__init__.py +0 -0
  78. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchases/bulk_create_params.py +0 -0
  79. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchases/bulk_create_response.py +0 -0
  80. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/purchases/bulk_retrieve_response.py +0 -0
  81. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/service_get_server_time_response.py +0 -0
  82. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/service_health_check_response.py +0 -0
  83. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/webhook_test_params.py +0 -0
  84. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/src/gmt/types/webhook_test_response.py +0 -0
  85. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/__init__.py +0 -0
  86. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/api_resources/__init__.py +0 -0
  87. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/api_resources/purchases/__init__.py +0 -0
  88. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/api_resources/purchases/test_bulk.py +0 -0
  89. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/api_resources/test_accounts.py +0 -0
  90. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/api_resources/test_profile.py +0 -0
  91. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/api_resources/test_purchases.py +0 -0
  92. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/api_resources/test_service.py +0 -0
  93. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/api_resources/test_webhooks.py +0 -0
  94. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/conftest.py +0 -0
  95. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/sample_file.txt +0 -0
  96. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_deepcopy.py +0 -0
  97. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_extract_files.py +0 -0
  98. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_files.py +0 -0
  99. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_models.py +0 -0
  100. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_qs.py +0 -0
  101. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_required_args.py +0 -0
  102. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_response.py +0 -0
  103. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_streaming.py +0 -0
  104. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_transform.py +0 -0
  105. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_utils/test_datetime_parse.py +0 -0
  106. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_utils/test_json.py +0 -0
  107. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_utils/test_proxy.py +0 -0
  108. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/test_utils/test_typing.py +0 -0
  109. {gmt_python_sdk-0.24.0 → gmt_python_sdk-0.24.2}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.24.2"
3
+ }
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.24.2 (2026-03-17)
4
+
5
+ Full Changelog: [v0.24.1...v0.24.2](https://github.com/cameo6/gmt-python-sdk/compare/v0.24.1...v0.24.2)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **deps:** bump minimum typing-extensions version ([410b34f](https://github.com/cameo6/gmt-python-sdk/commit/410b34ffd6285b8a671b284af7fa6df45de529bb))
10
+
11
+ ## 0.24.1 (2026-03-17)
12
+
13
+ Full Changelog: [v0.24.0...v0.24.1](https://github.com/cameo6/gmt-python-sdk/compare/v0.24.0...v0.24.1)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **pydantic:** do not pass `by_alias` unless set ([3d7f2bc](https://github.com/cameo6/gmt-python-sdk/commit/3d7f2bc45271fa41ecbe0b08cc82b3ab10b8a695))
18
+
19
+
20
+ ### Chores
21
+
22
+ * **ci:** bump uv version ([b3c966d](https://github.com/cameo6/gmt-python-sdk/commit/b3c966d2b7a95389877fd001e8ab7a3cdfc987ff))
23
+ * **ci:** skip uploading artifacts on stainless-internal branches ([08dc917](https://github.com/cameo6/gmt-python-sdk/commit/08dc91786204947990f392f73fc82bb4cfb3441c))
24
+ * **internal:** add request options to SSE classes ([8bfa3bd](https://github.com/cameo6/gmt-python-sdk/commit/8bfa3bd7fc05cb67e742b06e715b646a76b4d59a))
25
+ * **internal:** codegen related update ([c3fd234](https://github.com/cameo6/gmt-python-sdk/commit/c3fd2343921fad94a00198ca01f42e389c685d72))
26
+ * **internal:** make `test_proxy_environment_variables` more resilient ([1c0e14a](https://github.com/cameo6/gmt-python-sdk/commit/1c0e14a892b21ec457328c4bc9fd4395ef3994f8))
27
+ * **internal:** make `test_proxy_environment_variables` more resilient to env ([928ca24](https://github.com/cameo6/gmt-python-sdk/commit/928ca2483867abd28f3d9276270860ce979c837b))
28
+
3
29
  ## 0.24.0 (2026-02-20)
4
30
 
5
31
  Full Changelog: [v0.23.0...v0.24.0](https://github.com/cameo6/gmt-python-sdk/compare/v0.23.0...v0.24.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: gmt-python-sdk
3
- Version: 0.24.0
3
+ Version: 0.24.2
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
@@ -27,7 +27,7 @@ Requires-Dist: distro<2,>=1.7.0
27
27
  Requires-Dist: httpx<1,>=0.23.0
28
28
  Requires-Dist: pydantic<3,>=1.9.0
29
29
  Requires-Dist: sniffio
30
- Requires-Dist: typing-extensions<5,>=4.10
30
+ Requires-Dist: typing-extensions<5,>=4.14
31
31
  Provides-Extra: aiohttp
32
32
  Requires-Dist: aiohttp; extra == 'aiohttp'
33
33
  Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gmt-python-sdk"
3
- version = "0.24.0"
3
+ version = "0.24.2"
4
4
  description = "The official Python library for the gmt API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -11,7 +11,7 @@ authors = [
11
11
  dependencies = [
12
12
  "httpx>=0.23.0, <1",
13
13
  "pydantic>=1.9.0, <3",
14
- "typing-extensions>=4.10, <5",
14
+ "typing-extensions>=4.14, <5",
15
15
  "anyio>=3.5.0, <5",
16
16
  "distro>=1.7.0, <2",
17
17
  "sniffio",
@@ -94,30 +94,67 @@ class Gmt(SyncAPIClient):
94
94
 
95
95
  @cached_property
96
96
  def service(self) -> ServiceResource:
97
+ """Service endpoints for API health checks."""
97
98
  from .resources.service import ServiceResource
98
99
 
99
100
  return ServiceResource(self)
100
101
 
101
102
  @cached_property
102
103
  def accounts(self) -> AccountsResource:
104
+ """Browse and purchase Telegram accounts.
105
+
106
+ **Endpoints overview:**
107
+ - `GET /accounts/countries` — Public catalog with base prices (no auth required)
108
+ - `GET /accounts` — Personalized list with user's discounted prices (auth required)
109
+ - `GET /accounts/:country_code` — Detailed pricing breakdown with discount info (auth required)
110
+
111
+ **Pricing model.** Base prices are set per country. Authenticated users may receive a personal discount based on their purchase history (discount level). Use `/accounts/:country_code` to see the full price breakdown.
112
+ """
103
113
  from .resources.accounts import AccountsResource
104
114
 
105
115
  return AccountsResource(self)
106
116
 
107
117
  @cached_property
108
118
  def profile(self) -> ProfileResource:
119
+ """User profile management."""
109
120
  from .resources.profile import ProfileResource
110
121
 
111
122
  return ProfileResource(self)
112
123
 
113
124
  @cached_property
114
125
  def purchases(self) -> PurchasesResource:
126
+ """Purchase history and management."""
115
127
  from .resources.purchases import PurchasesResource
116
128
 
117
129
  return PurchasesResource(self)
118
130
 
119
131
  @cached_property
120
132
  def webhooks(self) -> WebhooksResource:
133
+ """Webhook testing and documentation.
134
+
135
+ ## Webhook Payload Types
136
+
137
+ When you provide `callback_url` in `POST /purchases/:id/request-code`, your endpoint will receive one of the following payloads:
138
+
139
+ - **WebhookSuccessPayload** — sent when verification code is successfully retrieved
140
+ - **WebhookFailedPayload** — sent when code retrieval fails after all retry attempts
141
+
142
+ When you provide `callback_url` in `POST /purchases/bulk`, your endpoint will receive:
143
+
144
+ - **WebhookBulkReadyPayload** — sent when bulk archive is ready
145
+
146
+ See the **Models** section below for detailed payload structure.
147
+
148
+ ## Requirements
149
+
150
+ - Your endpoint **must return HTTP 200** to acknowledge receipt
151
+ - Response timeout: **5 seconds**
152
+ - Failed deliveries are retried up to **3 times** (immediately, after 10s, after 30s)
153
+
154
+ ## Testing
155
+
156
+ Use `POST /v1/webhooks/test` to verify your endpoint. Get a temporary test URL at https://webhook.site
157
+ """
121
158
  from .resources.webhooks import WebhooksResource
122
159
 
123
160
  return WebhooksResource(self)
@@ -290,30 +327,67 @@ class AsyncGmt(AsyncAPIClient):
290
327
 
291
328
  @cached_property
292
329
  def service(self) -> AsyncServiceResource:
330
+ """Service endpoints for API health checks."""
293
331
  from .resources.service import AsyncServiceResource
294
332
 
295
333
  return AsyncServiceResource(self)
296
334
 
297
335
  @cached_property
298
336
  def accounts(self) -> AsyncAccountsResource:
337
+ """Browse and purchase Telegram accounts.
338
+
339
+ **Endpoints overview:**
340
+ - `GET /accounts/countries` — Public catalog with base prices (no auth required)
341
+ - `GET /accounts` — Personalized list with user's discounted prices (auth required)
342
+ - `GET /accounts/:country_code` — Detailed pricing breakdown with discount info (auth required)
343
+
344
+ **Pricing model.** Base prices are set per country. Authenticated users may receive a personal discount based on their purchase history (discount level). Use `/accounts/:country_code` to see the full price breakdown.
345
+ """
299
346
  from .resources.accounts import AsyncAccountsResource
300
347
 
301
348
  return AsyncAccountsResource(self)
302
349
 
303
350
  @cached_property
304
351
  def profile(self) -> AsyncProfileResource:
352
+ """User profile management."""
305
353
  from .resources.profile import AsyncProfileResource
306
354
 
307
355
  return AsyncProfileResource(self)
308
356
 
309
357
  @cached_property
310
358
  def purchases(self) -> AsyncPurchasesResource:
359
+ """Purchase history and management."""
311
360
  from .resources.purchases import AsyncPurchasesResource
312
361
 
313
362
  return AsyncPurchasesResource(self)
314
363
 
315
364
  @cached_property
316
365
  def webhooks(self) -> AsyncWebhooksResource:
366
+ """Webhook testing and documentation.
367
+
368
+ ## Webhook Payload Types
369
+
370
+ When you provide `callback_url` in `POST /purchases/:id/request-code`, your endpoint will receive one of the following payloads:
371
+
372
+ - **WebhookSuccessPayload** — sent when verification code is successfully retrieved
373
+ - **WebhookFailedPayload** — sent when code retrieval fails after all retry attempts
374
+
375
+ When you provide `callback_url` in `POST /purchases/bulk`, your endpoint will receive:
376
+
377
+ - **WebhookBulkReadyPayload** — sent when bulk archive is ready
378
+
379
+ See the **Models** section below for detailed payload structure.
380
+
381
+ ## Requirements
382
+
383
+ - Your endpoint **must return HTTP 200** to acknowledge receipt
384
+ - Response timeout: **5 seconds**
385
+ - Failed deliveries are retried up to **3 times** (immediately, after 10s, after 30s)
386
+
387
+ ## Testing
388
+
389
+ Use `POST /v1/webhooks/test` to verify your endpoint. Get a temporary test URL at https://webhook.site
390
+ """
317
391
  from .resources.webhooks import AsyncWebhooksResource
318
392
 
319
393
  return AsyncWebhooksResource(self)
@@ -441,30 +515,67 @@ class GmtWithRawResponse:
441
515
 
442
516
  @cached_property
443
517
  def service(self) -> service.ServiceResourceWithRawResponse:
518
+ """Service endpoints for API health checks."""
444
519
  from .resources.service import ServiceResourceWithRawResponse
445
520
 
446
521
  return ServiceResourceWithRawResponse(self._client.service)
447
522
 
448
523
  @cached_property
449
524
  def accounts(self) -> accounts.AccountsResourceWithRawResponse:
525
+ """Browse and purchase Telegram accounts.
526
+
527
+ **Endpoints overview:**
528
+ - `GET /accounts/countries` — Public catalog with base prices (no auth required)
529
+ - `GET /accounts` — Personalized list with user's discounted prices (auth required)
530
+ - `GET /accounts/:country_code` — Detailed pricing breakdown with discount info (auth required)
531
+
532
+ **Pricing model.** Base prices are set per country. Authenticated users may receive a personal discount based on their purchase history (discount level). Use `/accounts/:country_code` to see the full price breakdown.
533
+ """
450
534
  from .resources.accounts import AccountsResourceWithRawResponse
451
535
 
452
536
  return AccountsResourceWithRawResponse(self._client.accounts)
453
537
 
454
538
  @cached_property
455
539
  def profile(self) -> profile.ProfileResourceWithRawResponse:
540
+ """User profile management."""
456
541
  from .resources.profile import ProfileResourceWithRawResponse
457
542
 
458
543
  return ProfileResourceWithRawResponse(self._client.profile)
459
544
 
460
545
  @cached_property
461
546
  def purchases(self) -> purchases.PurchasesResourceWithRawResponse:
547
+ """Purchase history and management."""
462
548
  from .resources.purchases import PurchasesResourceWithRawResponse
463
549
 
464
550
  return PurchasesResourceWithRawResponse(self._client.purchases)
465
551
 
466
552
  @cached_property
467
553
  def webhooks(self) -> webhooks.WebhooksResourceWithRawResponse:
554
+ """Webhook testing and documentation.
555
+
556
+ ## Webhook Payload Types
557
+
558
+ When you provide `callback_url` in `POST /purchases/:id/request-code`, your endpoint will receive one of the following payloads:
559
+
560
+ - **WebhookSuccessPayload** — sent when verification code is successfully retrieved
561
+ - **WebhookFailedPayload** — sent when code retrieval fails after all retry attempts
562
+
563
+ When you provide `callback_url` in `POST /purchases/bulk`, your endpoint will receive:
564
+
565
+ - **WebhookBulkReadyPayload** — sent when bulk archive is ready
566
+
567
+ See the **Models** section below for detailed payload structure.
568
+
569
+ ## Requirements
570
+
571
+ - Your endpoint **must return HTTP 200** to acknowledge receipt
572
+ - Response timeout: **5 seconds**
573
+ - Failed deliveries are retried up to **3 times** (immediately, after 10s, after 30s)
574
+
575
+ ## Testing
576
+
577
+ Use `POST /v1/webhooks/test` to verify your endpoint. Get a temporary test URL at https://webhook.site
578
+ """
468
579
  from .resources.webhooks import WebhooksResourceWithRawResponse
469
580
 
470
581
  return WebhooksResourceWithRawResponse(self._client.webhooks)
@@ -478,30 +589,67 @@ class AsyncGmtWithRawResponse:
478
589
 
479
590
  @cached_property
480
591
  def service(self) -> service.AsyncServiceResourceWithRawResponse:
592
+ """Service endpoints for API health checks."""
481
593
  from .resources.service import AsyncServiceResourceWithRawResponse
482
594
 
483
595
  return AsyncServiceResourceWithRawResponse(self._client.service)
484
596
 
485
597
  @cached_property
486
598
  def accounts(self) -> accounts.AsyncAccountsResourceWithRawResponse:
599
+ """Browse and purchase Telegram accounts.
600
+
601
+ **Endpoints overview:**
602
+ - `GET /accounts/countries` — Public catalog with base prices (no auth required)
603
+ - `GET /accounts` — Personalized list with user's discounted prices (auth required)
604
+ - `GET /accounts/:country_code` — Detailed pricing breakdown with discount info (auth required)
605
+
606
+ **Pricing model.** Base prices are set per country. Authenticated users may receive a personal discount based on their purchase history (discount level). Use `/accounts/:country_code` to see the full price breakdown.
607
+ """
487
608
  from .resources.accounts import AsyncAccountsResourceWithRawResponse
488
609
 
489
610
  return AsyncAccountsResourceWithRawResponse(self._client.accounts)
490
611
 
491
612
  @cached_property
492
613
  def profile(self) -> profile.AsyncProfileResourceWithRawResponse:
614
+ """User profile management."""
493
615
  from .resources.profile import AsyncProfileResourceWithRawResponse
494
616
 
495
617
  return AsyncProfileResourceWithRawResponse(self._client.profile)
496
618
 
497
619
  @cached_property
498
620
  def purchases(self) -> purchases.AsyncPurchasesResourceWithRawResponse:
621
+ """Purchase history and management."""
499
622
  from .resources.purchases import AsyncPurchasesResourceWithRawResponse
500
623
 
501
624
  return AsyncPurchasesResourceWithRawResponse(self._client.purchases)
502
625
 
503
626
  @cached_property
504
627
  def webhooks(self) -> webhooks.AsyncWebhooksResourceWithRawResponse:
628
+ """Webhook testing and documentation.
629
+
630
+ ## Webhook Payload Types
631
+
632
+ When you provide `callback_url` in `POST /purchases/:id/request-code`, your endpoint will receive one of the following payloads:
633
+
634
+ - **WebhookSuccessPayload** — sent when verification code is successfully retrieved
635
+ - **WebhookFailedPayload** — sent when code retrieval fails after all retry attempts
636
+
637
+ When you provide `callback_url` in `POST /purchases/bulk`, your endpoint will receive:
638
+
639
+ - **WebhookBulkReadyPayload** — sent when bulk archive is ready
640
+
641
+ See the **Models** section below for detailed payload structure.
642
+
643
+ ## Requirements
644
+
645
+ - Your endpoint **must return HTTP 200** to acknowledge receipt
646
+ - Response timeout: **5 seconds**
647
+ - Failed deliveries are retried up to **3 times** (immediately, after 10s, after 30s)
648
+
649
+ ## Testing
650
+
651
+ Use `POST /v1/webhooks/test` to verify your endpoint. Get a temporary test URL at https://webhook.site
652
+ """
505
653
  from .resources.webhooks import AsyncWebhooksResourceWithRawResponse
506
654
 
507
655
  return AsyncWebhooksResourceWithRawResponse(self._client.webhooks)
@@ -515,30 +663,67 @@ class GmtWithStreamedResponse:
515
663
 
516
664
  @cached_property
517
665
  def service(self) -> service.ServiceResourceWithStreamingResponse:
666
+ """Service endpoints for API health checks."""
518
667
  from .resources.service import ServiceResourceWithStreamingResponse
519
668
 
520
669
  return ServiceResourceWithStreamingResponse(self._client.service)
521
670
 
522
671
  @cached_property
523
672
  def accounts(self) -> accounts.AccountsResourceWithStreamingResponse:
673
+ """Browse and purchase Telegram accounts.
674
+
675
+ **Endpoints overview:**
676
+ - `GET /accounts/countries` — Public catalog with base prices (no auth required)
677
+ - `GET /accounts` — Personalized list with user's discounted prices (auth required)
678
+ - `GET /accounts/:country_code` — Detailed pricing breakdown with discount info (auth required)
679
+
680
+ **Pricing model.** Base prices are set per country. Authenticated users may receive a personal discount based on their purchase history (discount level). Use `/accounts/:country_code` to see the full price breakdown.
681
+ """
524
682
  from .resources.accounts import AccountsResourceWithStreamingResponse
525
683
 
526
684
  return AccountsResourceWithStreamingResponse(self._client.accounts)
527
685
 
528
686
  @cached_property
529
687
  def profile(self) -> profile.ProfileResourceWithStreamingResponse:
688
+ """User profile management."""
530
689
  from .resources.profile import ProfileResourceWithStreamingResponse
531
690
 
532
691
  return ProfileResourceWithStreamingResponse(self._client.profile)
533
692
 
534
693
  @cached_property
535
694
  def purchases(self) -> purchases.PurchasesResourceWithStreamingResponse:
695
+ """Purchase history and management."""
536
696
  from .resources.purchases import PurchasesResourceWithStreamingResponse
537
697
 
538
698
  return PurchasesResourceWithStreamingResponse(self._client.purchases)
539
699
 
540
700
  @cached_property
541
701
  def webhooks(self) -> webhooks.WebhooksResourceWithStreamingResponse:
702
+ """Webhook testing and documentation.
703
+
704
+ ## Webhook Payload Types
705
+
706
+ When you provide `callback_url` in `POST /purchases/:id/request-code`, your endpoint will receive one of the following payloads:
707
+
708
+ - **WebhookSuccessPayload** — sent when verification code is successfully retrieved
709
+ - **WebhookFailedPayload** — sent when code retrieval fails after all retry attempts
710
+
711
+ When you provide `callback_url` in `POST /purchases/bulk`, your endpoint will receive:
712
+
713
+ - **WebhookBulkReadyPayload** — sent when bulk archive is ready
714
+
715
+ See the **Models** section below for detailed payload structure.
716
+
717
+ ## Requirements
718
+
719
+ - Your endpoint **must return HTTP 200** to acknowledge receipt
720
+ - Response timeout: **5 seconds**
721
+ - Failed deliveries are retried up to **3 times** (immediately, after 10s, after 30s)
722
+
723
+ ## Testing
724
+
725
+ Use `POST /v1/webhooks/test` to verify your endpoint. Get a temporary test URL at https://webhook.site
726
+ """
542
727
  from .resources.webhooks import WebhooksResourceWithStreamingResponse
543
728
 
544
729
  return WebhooksResourceWithStreamingResponse(self._client.webhooks)
@@ -552,30 +737,67 @@ class AsyncGmtWithStreamedResponse:
552
737
 
553
738
  @cached_property
554
739
  def service(self) -> service.AsyncServiceResourceWithStreamingResponse:
740
+ """Service endpoints for API health checks."""
555
741
  from .resources.service import AsyncServiceResourceWithStreamingResponse
556
742
 
557
743
  return AsyncServiceResourceWithStreamingResponse(self._client.service)
558
744
 
559
745
  @cached_property
560
746
  def accounts(self) -> accounts.AsyncAccountsResourceWithStreamingResponse:
747
+ """Browse and purchase Telegram accounts.
748
+
749
+ **Endpoints overview:**
750
+ - `GET /accounts/countries` — Public catalog with base prices (no auth required)
751
+ - `GET /accounts` — Personalized list with user's discounted prices (auth required)
752
+ - `GET /accounts/:country_code` — Detailed pricing breakdown with discount info (auth required)
753
+
754
+ **Pricing model.** Base prices are set per country. Authenticated users may receive a personal discount based on their purchase history (discount level). Use `/accounts/:country_code` to see the full price breakdown.
755
+ """
561
756
  from .resources.accounts import AsyncAccountsResourceWithStreamingResponse
562
757
 
563
758
  return AsyncAccountsResourceWithStreamingResponse(self._client.accounts)
564
759
 
565
760
  @cached_property
566
761
  def profile(self) -> profile.AsyncProfileResourceWithStreamingResponse:
762
+ """User profile management."""
567
763
  from .resources.profile import AsyncProfileResourceWithStreamingResponse
568
764
 
569
765
  return AsyncProfileResourceWithStreamingResponse(self._client.profile)
570
766
 
571
767
  @cached_property
572
768
  def purchases(self) -> purchases.AsyncPurchasesResourceWithStreamingResponse:
769
+ """Purchase history and management."""
573
770
  from .resources.purchases import AsyncPurchasesResourceWithStreamingResponse
574
771
 
575
772
  return AsyncPurchasesResourceWithStreamingResponse(self._client.purchases)
576
773
 
577
774
  @cached_property
578
775
  def webhooks(self) -> webhooks.AsyncWebhooksResourceWithStreamingResponse:
776
+ """Webhook testing and documentation.
777
+
778
+ ## Webhook Payload Types
779
+
780
+ When you provide `callback_url` in `POST /purchases/:id/request-code`, your endpoint will receive one of the following payloads:
781
+
782
+ - **WebhookSuccessPayload** — sent when verification code is successfully retrieved
783
+ - **WebhookFailedPayload** — sent when code retrieval fails after all retry attempts
784
+
785
+ When you provide `callback_url` in `POST /purchases/bulk`, your endpoint will receive:
786
+
787
+ - **WebhookBulkReadyPayload** — sent when bulk archive is ready
788
+
789
+ See the **Models** section below for detailed payload structure.
790
+
791
+ ## Requirements
792
+
793
+ - Your endpoint **must return HTTP 200** to acknowledge receipt
794
+ - Response timeout: **5 seconds**
795
+ - Failed deliveries are retried up to **3 times** (immediately, after 10s, after 30s)
796
+
797
+ ## Testing
798
+
799
+ Use `POST /v1/webhooks/test` to verify your endpoint. Get a temporary test URL at https://webhook.site
800
+ """
579
801
  from .resources.webhooks import AsyncWebhooksResourceWithStreamingResponse
580
802
 
581
803
  return AsyncWebhooksResourceWithStreamingResponse(self._client.webhooks)
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
4
4
  from datetime import date, datetime
5
- from typing_extensions import Self, Literal
5
+ from typing_extensions import Self, Literal, TypedDict
6
6
 
7
7
  import pydantic
8
8
  from pydantic.fields import FieldInfo
@@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
131
131
  return model.model_dump_json(indent=indent)
132
132
 
133
133
 
134
+ class _ModelDumpKwargs(TypedDict, total=False):
135
+ by_alias: bool
136
+
137
+
134
138
  def model_dump(
135
139
  model: pydantic.BaseModel,
136
140
  *,
@@ -142,6 +146,9 @@ def model_dump(
142
146
  by_alias: bool | None = None,
143
147
  ) -> dict[str, Any]:
144
148
  if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
149
+ kwargs: _ModelDumpKwargs = {}
150
+ if by_alias is not None:
151
+ kwargs["by_alias"] = by_alias
145
152
  return model.model_dump(
146
153
  mode=mode,
147
154
  exclude=exclude,
@@ -149,7 +156,7 @@ def model_dump(
149
156
  exclude_defaults=exclude_defaults,
150
157
  # warnings are not supported in Pydantic v1
151
158
  warnings=True if PYDANTIC_V1 else warnings,
152
- by_alias=by_alias,
159
+ **kwargs,
153
160
  )
154
161
  return cast(
155
162
  "dict[str, Any]",
@@ -152,6 +152,7 @@ class BaseAPIResponse(Generic[R]):
152
152
  ),
153
153
  response=self.http_response,
154
154
  client=cast(Any, self._client),
155
+ options=self._options,
155
156
  ),
156
157
  )
157
158
 
@@ -162,6 +163,7 @@ class BaseAPIResponse(Generic[R]):
162
163
  cast_to=extract_stream_chunk_type(self._stream_cls),
163
164
  response=self.http_response,
164
165
  client=cast(Any, self._client),
166
+ options=self._options,
165
167
  ),
166
168
  )
167
169
 
@@ -175,6 +177,7 @@ class BaseAPIResponse(Generic[R]):
175
177
  cast_to=cast_to,
176
178
  response=self.http_response,
177
179
  client=cast(Any, self._client),
180
+ options=self._options,
178
181
  ),
179
182
  )
180
183
 
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
  import json
5
5
  import inspect
6
6
  from types import TracebackType
7
- from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast
7
+ from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast
8
8
  from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable
9
9
 
10
10
  import httpx
@@ -13,6 +13,7 @@ from ._utils import extract_type_var_from_base
13
13
 
14
14
  if TYPE_CHECKING:
15
15
  from ._client import Gmt, AsyncGmt
16
+ from ._models import FinalRequestOptions
16
17
 
17
18
 
18
19
  _T = TypeVar("_T")
@@ -22,7 +23,7 @@ class Stream(Generic[_T]):
22
23
  """Provides the core interface to iterate over a synchronous stream response."""
23
24
 
24
25
  response: httpx.Response
25
-
26
+ _options: Optional[FinalRequestOptions] = None
26
27
  _decoder: SSEBytesDecoder
27
28
 
28
29
  def __init__(
@@ -31,10 +32,12 @@ class Stream(Generic[_T]):
31
32
  cast_to: type[_T],
32
33
  response: httpx.Response,
33
34
  client: Gmt,
35
+ options: Optional[FinalRequestOptions] = None,
34
36
  ) -> None:
35
37
  self.response = response
36
38
  self._cast_to = cast_to
37
39
  self._client = client
40
+ self._options = options
38
41
  self._decoder = client._make_sse_decoder()
39
42
  self._iterator = self.__stream__()
40
43
 
@@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]):
85
88
  """Provides the core interface to iterate over an asynchronous stream response."""
86
89
 
87
90
  response: httpx.Response
88
-
91
+ _options: Optional[FinalRequestOptions] = None
89
92
  _decoder: SSEDecoder | SSEBytesDecoder
90
93
 
91
94
  def __init__(
@@ -94,10 +97,12 @@ class AsyncStream(Generic[_T]):
94
97
  cast_to: type[_T],
95
98
  response: httpx.Response,
96
99
  client: AsyncGmt,
100
+ options: Optional[FinalRequestOptions] = None,
97
101
  ) -> None:
98
102
  self.response = response
99
103
  self._cast_to = cast_to
100
104
  self._client = client
105
+ self._options = options
101
106
  self._decoder = client._make_sse_decoder()
102
107
  self._iterator = self.__stream__()
103
108
 
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "gmt"
4
- __version__ = "0.24.0" # x-release-please-version
4
+ __version__ = "0.24.2" # x-release-please-version
@@ -27,6 +27,16 @@ __all__ = ["AccountsResource", "AsyncAccountsResource"]
27
27
 
28
28
 
29
29
  class AccountsResource(SyncAPIResource):
30
+ """Browse and purchase Telegram accounts.
31
+
32
+ **Endpoints overview:**
33
+ - `GET /accounts/countries` — Public catalog with base prices (no auth required)
34
+ - `GET /accounts` — Personalized list with user's discounted prices (auth required)
35
+ - `GET /accounts/:country_code` — Detailed pricing breakdown with discount info (auth required)
36
+
37
+ **Pricing model.** Base prices are set per country. Authenticated users may receive a personal discount based on their purchase history (discount level). Use `/accounts/:country_code` to see the full price breakdown.
38
+ """
39
+
30
40
  @cached_property
31
41
  def with_raw_response(self) -> AccountsResourceWithRawResponse:
32
42
  """
@@ -239,6 +249,16 @@ class AccountsResource(SyncAPIResource):
239
249
 
240
250
 
241
251
  class AsyncAccountsResource(AsyncAPIResource):
252
+ """Browse and purchase Telegram accounts.
253
+
254
+ **Endpoints overview:**
255
+ - `GET /accounts/countries` — Public catalog with base prices (no auth required)
256
+ - `GET /accounts` — Personalized list with user's discounted prices (auth required)
257
+ - `GET /accounts/:country_code` — Detailed pricing breakdown with discount info (auth required)
258
+
259
+ **Pricing model.** Base prices are set per country. Authenticated users may receive a personal discount based on their purchase history (discount level). Use `/accounts/:country_code` to see the full price breakdown.
260
+ """
261
+
242
262
  @cached_property
243
263
  def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse:
244
264
  """
@@ -25,6 +25,8 @@ __all__ = ["ProfileResource", "AsyncProfileResource"]
25
25
 
26
26
 
27
27
  class ProfileResource(SyncAPIResource):
28
+ """User profile management."""
29
+
28
30
  @cached_property
29
31
  def with_raw_response(self) -> ProfileResourceWithRawResponse:
30
32
  """
@@ -161,6 +163,8 @@ class ProfileResource(SyncAPIResource):
161
163
 
162
164
 
163
165
  class AsyncProfileResource(AsyncAPIResource):
166
+ """User profile management."""
167
+
164
168
  @cached_property
165
169
  def with_raw_response(self) -> AsyncProfileResourceWithRawResponse:
166
170
  """
@@ -31,6 +31,8 @@ __all__ = ["BulkResource", "AsyncBulkResource"]
31
31
 
32
32
 
33
33
  class BulkResource(SyncAPIResource):
34
+ """Purchase history and management."""
35
+
34
36
  @cached_property
35
37
  def with_raw_response(self) -> BulkResourceWithRawResponse:
36
38
  """
@@ -187,6 +189,8 @@ class BulkResource(SyncAPIResource):
187
189
 
188
190
 
189
191
  class AsyncBulkResource(AsyncAPIResource):
192
+ """Purchase history and management."""
193
+
190
194
  @cached_property
191
195
  def with_raw_response(self) -> AsyncBulkResourceWithRawResponse:
192
196
  """
@@ -37,8 +37,11 @@ __all__ = ["PurchasesResource", "AsyncPurchasesResource"]
37
37
 
38
38
 
39
39
  class PurchasesResource(SyncAPIResource):
40
+ """Purchase history and management."""
41
+
40
42
  @cached_property
41
43
  def bulk(self) -> BulkResource:
44
+ """Purchase history and management."""
42
45
  return BulkResource(self._client)
43
46
 
44
47
  @cached_property
@@ -324,8 +327,11 @@ class PurchasesResource(SyncAPIResource):
324
327
 
325
328
 
326
329
  class AsyncPurchasesResource(AsyncAPIResource):
330
+ """Purchase history and management."""
331
+
327
332
  @cached_property
328
333
  def bulk(self) -> AsyncBulkResource:
334
+ """Purchase history and management."""
329
335
  return AsyncBulkResource(self._client)
330
336
 
331
337
  @cached_property
@@ -634,6 +640,7 @@ class PurchasesResourceWithRawResponse:
634
640
 
635
641
  @cached_property
636
642
  def bulk(self) -> BulkResourceWithRawResponse:
643
+ """Purchase history and management."""
637
644
  return BulkResourceWithRawResponse(self._purchases.bulk)
638
645
 
639
646
 
@@ -659,6 +666,7 @@ class AsyncPurchasesResourceWithRawResponse:
659
666
 
660
667
  @cached_property
661
668
  def bulk(self) -> AsyncBulkResourceWithRawResponse:
669
+ """Purchase history and management."""
662
670
  return AsyncBulkResourceWithRawResponse(self._purchases.bulk)
663
671
 
664
672
 
@@ -684,6 +692,7 @@ class PurchasesResourceWithStreamingResponse:
684
692
 
685
693
  @cached_property
686
694
  def bulk(self) -> BulkResourceWithStreamingResponse:
695
+ """Purchase history and management."""
687
696
  return BulkResourceWithStreamingResponse(self._purchases.bulk)
688
697
 
689
698
 
@@ -709,4 +718,5 @@ class AsyncPurchasesResourceWithStreamingResponse:
709
718
 
710
719
  @cached_property
711
720
  def bulk(self) -> AsyncBulkResourceWithStreamingResponse:
721
+ """Purchase history and management."""
712
722
  return AsyncBulkResourceWithStreamingResponse(self._purchases.bulk)
@@ -21,6 +21,8 @@ __all__ = ["ServiceResource", "AsyncServiceResource"]
21
21
 
22
22
 
23
23
  class ServiceResource(SyncAPIResource):
24
+ """Service endpoints for API health checks."""
25
+
24
26
  @cached_property
25
27
  def with_raw_response(self) -> ServiceResourceWithRawResponse:
26
28
  """
@@ -80,6 +82,8 @@ class ServiceResource(SyncAPIResource):
80
82
 
81
83
 
82
84
  class AsyncServiceResource(AsyncAPIResource):
85
+ """Service endpoints for API health checks."""
86
+
83
87
  @cached_property
84
88
  def with_raw_response(self) -> AsyncServiceResourceWithRawResponse:
85
89
  """
@@ -24,6 +24,32 @@ __all__ = ["WebhooksResource", "AsyncWebhooksResource"]
24
24
 
25
25
 
26
26
  class WebhooksResource(SyncAPIResource):
27
+ """Webhook testing and documentation.
28
+
29
+ ## Webhook Payload Types
30
+
31
+ When you provide `callback_url` in `POST /purchases/:id/request-code`, your endpoint will receive one of the following payloads:
32
+
33
+ - **WebhookSuccessPayload** — sent when verification code is successfully retrieved
34
+ - **WebhookFailedPayload** — sent when code retrieval fails after all retry attempts
35
+
36
+ When you provide `callback_url` in `POST /purchases/bulk`, your endpoint will receive:
37
+
38
+ - **WebhookBulkReadyPayload** — sent when bulk archive is ready
39
+
40
+ See the **Models** section below for detailed payload structure.
41
+
42
+ ## Requirements
43
+
44
+ - Your endpoint **must return HTTP 200** to acknowledge receipt
45
+ - Response timeout: **5 seconds**
46
+ - Failed deliveries are retried up to **3 times** (immediately, after 10s, after 30s)
47
+
48
+ ## Testing
49
+
50
+ Use `POST /v1/webhooks/test` to verify your endpoint. Get a temporary test URL at https://webhook.site
51
+ """
52
+
27
53
  @cached_property
28
54
  def with_raw_response(self) -> WebhooksResourceWithRawResponse:
29
55
  """
@@ -102,6 +128,32 @@ class WebhooksResource(SyncAPIResource):
102
128
 
103
129
 
104
130
  class AsyncWebhooksResource(AsyncAPIResource):
131
+ """Webhook testing and documentation.
132
+
133
+ ## Webhook Payload Types
134
+
135
+ When you provide `callback_url` in `POST /purchases/:id/request-code`, your endpoint will receive one of the following payloads:
136
+
137
+ - **WebhookSuccessPayload** — sent when verification code is successfully retrieved
138
+ - **WebhookFailedPayload** — sent when code retrieval fails after all retry attempts
139
+
140
+ When you provide `callback_url` in `POST /purchases/bulk`, your endpoint will receive:
141
+
142
+ - **WebhookBulkReadyPayload** — sent when bulk archive is ready
143
+
144
+ See the **Models** section below for detailed payload structure.
145
+
146
+ ## Requirements
147
+
148
+ - Your endpoint **must return HTTP 200** to acknowledge receipt
149
+ - Response timeout: **5 seconds**
150
+ - Failed deliveries are retried up to **3 times** (immediately, after 10s, after 30s)
151
+
152
+ ## Testing
153
+
154
+ Use `POST /v1/webhooks/test` to verify your endpoint. Get a temporary test URL at https://webhook.site
155
+ """
156
+
105
157
  @cached_property
106
158
  def with_raw_response(self) -> AsyncWebhooksResourceWithRawResponse:
107
159
  """
@@ -935,6 +935,14 @@ class TestGmt:
935
935
  def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
936
936
  # Test that the proxy environment variables are set correctly
937
937
  monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
938
+ # Delete in case our environment has any proxy env vars set
939
+ monkeypatch.delenv("HTTP_PROXY", raising=False)
940
+ monkeypatch.delenv("ALL_PROXY", raising=False)
941
+ monkeypatch.delenv("NO_PROXY", raising=False)
942
+ monkeypatch.delenv("http_proxy", raising=False)
943
+ monkeypatch.delenv("https_proxy", raising=False)
944
+ monkeypatch.delenv("all_proxy", raising=False)
945
+ monkeypatch.delenv("no_proxy", raising=False)
938
946
 
939
947
  client = DefaultHttpxClient()
940
948
 
@@ -1829,6 +1837,14 @@ class TestAsyncGmt:
1829
1837
  async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
1830
1838
  # Test that the proxy environment variables are set correctly
1831
1839
  monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1840
+ # Delete in case our environment has any proxy env vars set
1841
+ monkeypatch.delenv("HTTP_PROXY", raising=False)
1842
+ monkeypatch.delenv("ALL_PROXY", raising=False)
1843
+ monkeypatch.delenv("NO_PROXY", raising=False)
1844
+ monkeypatch.delenv("http_proxy", raising=False)
1845
+ monkeypatch.delenv("https_proxy", raising=False)
1846
+ monkeypatch.delenv("all_proxy", raising=False)
1847
+ monkeypatch.delenv("no_proxy", raising=False)
1832
1848
 
1833
1849
  client = DefaultAsyncHttpxClient()
1834
1850
 
@@ -471,7 +471,7 @@ requires-dist = [
471
471
  { name = "httpx-aiohttp", marker = "extra == 'aiohttp'", specifier = ">=0.1.9" },
472
472
  { name = "pydantic", specifier = ">=1.9.0,<3" },
473
473
  { name = "sniffio" },
474
- { name = "typing-extensions", specifier = ">=4.10,<5" },
474
+ { name = "typing-extensions", specifier = ">=4.14,<5" },
475
475
  ]
476
476
  provides-extras = ["aiohttp"]
477
477
 
@@ -1,3 +0,0 @@
1
- {
2
- ".": "0.24.0"
3
- }
File without changes
File without changes