gmt-python-sdk 0.1.0__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.
- gmt/__init__.py +92 -0
- gmt/_base_client.py +1995 -0
- gmt/_client.py +418 -0
- gmt/_compat.py +219 -0
- gmt/_constants.py +14 -0
- gmt/_exceptions.py +108 -0
- gmt/_files.py +123 -0
- gmt/_models.py +857 -0
- gmt/_qs.py +150 -0
- gmt/_resource.py +43 -0
- gmt/_response.py +830 -0
- gmt/_streaming.py +333 -0
- gmt/_types.py +260 -0
- gmt/_utils/__init__.py +64 -0
- gmt/_utils/_compat.py +45 -0
- gmt/_utils/_datetime_parse.py +136 -0
- gmt/_utils/_logs.py +25 -0
- gmt/_utils/_proxy.py +65 -0
- gmt/_utils/_reflection.py +42 -0
- gmt/_utils/_resources_proxy.py +24 -0
- gmt/_utils/_streams.py +12 -0
- gmt/_utils/_sync.py +58 -0
- gmt/_utils/_transform.py +457 -0
- gmt/_utils/_typing.py +156 -0
- gmt/_utils/_utils.py +421 -0
- gmt/_version.py +4 -0
- gmt/lib/.keep +4 -0
- gmt/pagination.py +101 -0
- gmt/py.typed +0 -0
- gmt/resources/__init__.py +61 -0
- gmt/resources/accounts.py +423 -0
- gmt/resources/profile.py +141 -0
- gmt/resources/purchases.py +557 -0
- gmt/resources/service.py +186 -0
- gmt/types/__init__.py +20 -0
- gmt/types/account_list_countries_params.py +24 -0
- gmt/types/account_list_countries_response.py +36 -0
- gmt/types/account_list_params.py +24 -0
- gmt/types/account_list_response.py +33 -0
- gmt/types/account_retrieve_response.py +43 -0
- gmt/types/profile_retrieve_response.py +89 -0
- gmt/types/purchase_create_params.py +12 -0
- gmt/types/purchase_create_response.py +108 -0
- gmt/types/purchase_list_params.py +31 -0
- gmt/types/purchase_list_response.py +108 -0
- gmt/types/purchase_request_verification_code_response.py +108 -0
- gmt/types/purchase_retrieve_response.py +108 -0
- gmt/types/service_get_server_time_response.py +18 -0
- gmt/types/service_health_check_response.py +32 -0
- gmt_python_sdk-0.1.0.dist-info/METADATA +473 -0
- gmt_python_sdk-0.1.0.dist-info/RECORD +53 -0
- gmt_python_sdk-0.1.0.dist-info/WHEEL +4 -0
- gmt_python_sdk-0.1.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
|
|
8
|
+
__all__ = ["PurchaseListResponse", "DisplayName", "Price", "Verification"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DisplayName(BaseModel):
|
|
12
|
+
en: str
|
|
13
|
+
"""Name in English."""
|
|
14
|
+
|
|
15
|
+
ru: str
|
|
16
|
+
"""Name in Russian."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Price(BaseModel):
|
|
20
|
+
amount: str
|
|
21
|
+
"""Monetary amount as a string with up to 2 decimal places."""
|
|
22
|
+
|
|
23
|
+
currency_code: str
|
|
24
|
+
"""ISO 4217 currency code."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Verification(BaseModel):
|
|
28
|
+
code: str
|
|
29
|
+
"""Verification code for account."""
|
|
30
|
+
|
|
31
|
+
password: str
|
|
32
|
+
"""Account password."""
|
|
33
|
+
|
|
34
|
+
received_at: str
|
|
35
|
+
"""
|
|
36
|
+
**Code Retrieval Timestamp.** Marks when verification code was successfully
|
|
37
|
+
fetched from the provider (not when purchase was created).
|
|
38
|
+
|
|
39
|
+
**Example timeline.**
|
|
40
|
+
|
|
41
|
+
- `created_at`: `2024-11-19T10:00:00Z` (purchase created)
|
|
42
|
+
- `received_at`: `2024-11-19T10:05:02Z` (code requested 5 minutes later)
|
|
43
|
+
|
|
44
|
+
**Note.** These timestamps may be identical if code is requested immediately
|
|
45
|
+
after purchase.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class PurchaseListResponse(BaseModel):
|
|
50
|
+
id: int
|
|
51
|
+
"""Unique purchase identifier."""
|
|
52
|
+
|
|
53
|
+
country_code: str
|
|
54
|
+
"""ISO 3166-1 alpha-2 country code."""
|
|
55
|
+
|
|
56
|
+
created_at: str
|
|
57
|
+
"""Purchase creation time in ISO 8601 format (UTC)."""
|
|
58
|
+
|
|
59
|
+
display_name: DisplayName
|
|
60
|
+
|
|
61
|
+
phone_number: str
|
|
62
|
+
"""
|
|
63
|
+
**E.164 International Format.** Phone number with country code prefix (e.g.,
|
|
64
|
+
`+12025550123` for US, `+79991234567` for Russia).
|
|
65
|
+
|
|
66
|
+
**Usage.** This is your Telegram account login. Use it with `verification.code`
|
|
67
|
+
and `verification.password` to access the account.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
price: Price
|
|
71
|
+
"""
|
|
72
|
+
**Final Price After Discount.** The actual amount deducted from your balance,
|
|
73
|
+
with your personal discount already applied.
|
|
74
|
+
|
|
75
|
+
**To see pricing breakdown before purchase.** Check
|
|
76
|
+
`GET /accounts/:country_code` which shows both discounted price and original
|
|
77
|
+
`base_price`.
|
|
78
|
+
|
|
79
|
+
**Discount eligibility.** Based on your total successful purchase count. Higher
|
|
80
|
+
volume = bigger discounts.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
status: Literal["PENDING", "SUCCESS", "ERROR", "REFUND"]
|
|
84
|
+
"""
|
|
85
|
+
**Purchase Status Lifecycle.** `PENDING` (initial) → `SUCCESS` (after code
|
|
86
|
+
request) or `ERROR` (provider failure). Any status can transition to `REFUND`
|
|
87
|
+
via admin action.
|
|
88
|
+
|
|
89
|
+
**Important.** Status is immutable once set to `SUCCESS`, `ERROR`, or `REFUND`.
|
|
90
|
+
|
|
91
|
+
**Filter options**
|
|
92
|
+
|
|
93
|
+
- `PENDING` - code not requested.
|
|
94
|
+
- `SUCCESS` - code ready.
|
|
95
|
+
- `ERROR` - provider failed.
|
|
96
|
+
- `REFUND` - money returned.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
verification: Optional[Verification] = None
|
|
100
|
+
"""
|
|
101
|
+
**Verification Credentials.** Login credentials for the purchased Telegram
|
|
102
|
+
account. Initially `null` after purchase creation.
|
|
103
|
+
|
|
104
|
+
**Availability.** Populated after calling `POST /purchases/:id/request-code`.
|
|
105
|
+
Once received, credentials are permanent and cannot be re-requested.
|
|
106
|
+
|
|
107
|
+
**Security.** Verification data is only visible to the purchase owner.
|
|
108
|
+
"""
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
|
|
8
|
+
__all__ = ["PurchaseRequestVerificationCodeResponse", "DisplayName", "Price", "Verification"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DisplayName(BaseModel):
|
|
12
|
+
en: str
|
|
13
|
+
"""Name in English."""
|
|
14
|
+
|
|
15
|
+
ru: str
|
|
16
|
+
"""Name in Russian."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Price(BaseModel):
|
|
20
|
+
amount: str
|
|
21
|
+
"""Monetary amount as a string with up to 2 decimal places."""
|
|
22
|
+
|
|
23
|
+
currency_code: str
|
|
24
|
+
"""ISO 4217 currency code."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Verification(BaseModel):
|
|
28
|
+
code: str
|
|
29
|
+
"""Verification code for account."""
|
|
30
|
+
|
|
31
|
+
password: str
|
|
32
|
+
"""Account password."""
|
|
33
|
+
|
|
34
|
+
received_at: str
|
|
35
|
+
"""
|
|
36
|
+
**Code Retrieval Timestamp.** Marks when verification code was successfully
|
|
37
|
+
fetched from the provider (not when purchase was created).
|
|
38
|
+
|
|
39
|
+
**Example timeline.**
|
|
40
|
+
|
|
41
|
+
- `created_at`: `2024-11-19T10:00:00Z` (purchase created)
|
|
42
|
+
- `received_at`: `2024-11-19T10:05:02Z` (code requested 5 minutes later)
|
|
43
|
+
|
|
44
|
+
**Note.** These timestamps may be identical if code is requested immediately
|
|
45
|
+
after purchase.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class PurchaseRequestVerificationCodeResponse(BaseModel):
|
|
50
|
+
id: int
|
|
51
|
+
"""Unique purchase identifier."""
|
|
52
|
+
|
|
53
|
+
country_code: str
|
|
54
|
+
"""ISO 3166-1 alpha-2 country code."""
|
|
55
|
+
|
|
56
|
+
created_at: str
|
|
57
|
+
"""Purchase creation time in ISO 8601 format (UTC)."""
|
|
58
|
+
|
|
59
|
+
display_name: DisplayName
|
|
60
|
+
|
|
61
|
+
phone_number: str
|
|
62
|
+
"""
|
|
63
|
+
**E.164 International Format.** Phone number with country code prefix (e.g.,
|
|
64
|
+
`+12025550123` for US, `+79991234567` for Russia).
|
|
65
|
+
|
|
66
|
+
**Usage.** This is your Telegram account login. Use it with `verification.code`
|
|
67
|
+
and `verification.password` to access the account.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
price: Price
|
|
71
|
+
"""
|
|
72
|
+
**Final Price After Discount.** The actual amount deducted from your balance,
|
|
73
|
+
with your personal discount already applied.
|
|
74
|
+
|
|
75
|
+
**To see pricing breakdown before purchase.** Check
|
|
76
|
+
`GET /accounts/:country_code` which shows both discounted price and original
|
|
77
|
+
`base_price`.
|
|
78
|
+
|
|
79
|
+
**Discount eligibility.** Based on your total successful purchase count. Higher
|
|
80
|
+
volume = bigger discounts.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
status: Literal["PENDING", "SUCCESS", "ERROR", "REFUND"]
|
|
84
|
+
"""
|
|
85
|
+
**Purchase Status Lifecycle.** `PENDING` (initial) → `SUCCESS` (after code
|
|
86
|
+
request) or `ERROR` (provider failure). Any status can transition to `REFUND`
|
|
87
|
+
via admin action.
|
|
88
|
+
|
|
89
|
+
**Important.** Status is immutable once set to `SUCCESS`, `ERROR`, or `REFUND`.
|
|
90
|
+
|
|
91
|
+
**Filter options**
|
|
92
|
+
|
|
93
|
+
- `PENDING` - code not requested.
|
|
94
|
+
- `SUCCESS` - code ready.
|
|
95
|
+
- `ERROR` - provider failed.
|
|
96
|
+
- `REFUND` - money returned.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
verification: Optional[Verification] = None
|
|
100
|
+
"""
|
|
101
|
+
**Verification Credentials.** Login credentials for the purchased Telegram
|
|
102
|
+
account. Initially `null` after purchase creation.
|
|
103
|
+
|
|
104
|
+
**Availability.** Populated after calling `POST /purchases/:id/request-code`.
|
|
105
|
+
Once received, credentials are permanent and cannot be re-requested.
|
|
106
|
+
|
|
107
|
+
**Security.** Verification data is only visible to the purchase owner.
|
|
108
|
+
"""
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
|
|
8
|
+
__all__ = ["PurchaseRetrieveResponse", "DisplayName", "Price", "Verification"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DisplayName(BaseModel):
|
|
12
|
+
en: str
|
|
13
|
+
"""Name in English."""
|
|
14
|
+
|
|
15
|
+
ru: str
|
|
16
|
+
"""Name in Russian."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Price(BaseModel):
|
|
20
|
+
amount: str
|
|
21
|
+
"""Monetary amount as a string with up to 2 decimal places."""
|
|
22
|
+
|
|
23
|
+
currency_code: str
|
|
24
|
+
"""ISO 4217 currency code."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Verification(BaseModel):
|
|
28
|
+
code: str
|
|
29
|
+
"""Verification code for account."""
|
|
30
|
+
|
|
31
|
+
password: str
|
|
32
|
+
"""Account password."""
|
|
33
|
+
|
|
34
|
+
received_at: str
|
|
35
|
+
"""
|
|
36
|
+
**Code Retrieval Timestamp.** Marks when verification code was successfully
|
|
37
|
+
fetched from the provider (not when purchase was created).
|
|
38
|
+
|
|
39
|
+
**Example timeline.**
|
|
40
|
+
|
|
41
|
+
- `created_at`: `2024-11-19T10:00:00Z` (purchase created)
|
|
42
|
+
- `received_at`: `2024-11-19T10:05:02Z` (code requested 5 minutes later)
|
|
43
|
+
|
|
44
|
+
**Note.** These timestamps may be identical if code is requested immediately
|
|
45
|
+
after purchase.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class PurchaseRetrieveResponse(BaseModel):
|
|
50
|
+
id: int
|
|
51
|
+
"""Unique purchase identifier."""
|
|
52
|
+
|
|
53
|
+
country_code: str
|
|
54
|
+
"""ISO 3166-1 alpha-2 country code."""
|
|
55
|
+
|
|
56
|
+
created_at: str
|
|
57
|
+
"""Purchase creation time in ISO 8601 format (UTC)."""
|
|
58
|
+
|
|
59
|
+
display_name: DisplayName
|
|
60
|
+
|
|
61
|
+
phone_number: str
|
|
62
|
+
"""
|
|
63
|
+
**E.164 International Format.** Phone number with country code prefix (e.g.,
|
|
64
|
+
`+12025550123` for US, `+79991234567` for Russia).
|
|
65
|
+
|
|
66
|
+
**Usage.** This is your Telegram account login. Use it with `verification.code`
|
|
67
|
+
and `verification.password` to access the account.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
price: Price
|
|
71
|
+
"""
|
|
72
|
+
**Final Price After Discount.** The actual amount deducted from your balance,
|
|
73
|
+
with your personal discount already applied.
|
|
74
|
+
|
|
75
|
+
**To see pricing breakdown before purchase.** Check
|
|
76
|
+
`GET /accounts/:country_code` which shows both discounted price and original
|
|
77
|
+
`base_price`.
|
|
78
|
+
|
|
79
|
+
**Discount eligibility.** Based on your total successful purchase count. Higher
|
|
80
|
+
volume = bigger discounts.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
status: Literal["PENDING", "SUCCESS", "ERROR", "REFUND"]
|
|
84
|
+
"""
|
|
85
|
+
**Purchase Status Lifecycle.** `PENDING` (initial) → `SUCCESS` (after code
|
|
86
|
+
request) or `ERROR` (provider failure). Any status can transition to `REFUND`
|
|
87
|
+
via admin action.
|
|
88
|
+
|
|
89
|
+
**Important.** Status is immutable once set to `SUCCESS`, `ERROR`, or `REFUND`.
|
|
90
|
+
|
|
91
|
+
**Filter options**
|
|
92
|
+
|
|
93
|
+
- `PENDING` - code not requested.
|
|
94
|
+
- `SUCCESS` - code ready.
|
|
95
|
+
- `ERROR` - provider failed.
|
|
96
|
+
- `REFUND` - money returned.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
verification: Optional[Verification] = None
|
|
100
|
+
"""
|
|
101
|
+
**Verification Credentials.** Login credentials for the purchased Telegram
|
|
102
|
+
account. Initially `null` after purchase creation.
|
|
103
|
+
|
|
104
|
+
**Availability.** Populated after calling `POST /purchases/:id/request-code`.
|
|
105
|
+
Once received, credentials are permanent and cannot be re-requested.
|
|
106
|
+
|
|
107
|
+
**Security.** Verification data is only visible to the purchase owner.
|
|
108
|
+
"""
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from pydantic import Field as FieldInfo
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["ServiceGetServerTimeResponse"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ServiceGetServerTimeResponse(BaseModel):
|
|
11
|
+
epoch_ms: int = FieldInfo(alias="epochMs")
|
|
12
|
+
"""Current server time in milliseconds since Unix epoch."""
|
|
13
|
+
|
|
14
|
+
iso: str
|
|
15
|
+
"""Current server time in ISO 8601 format."""
|
|
16
|
+
|
|
17
|
+
timezone: str
|
|
18
|
+
"""Server timezone."""
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["ServiceHealthCheckResponse", "Checks"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Checks(BaseModel):
|
|
14
|
+
database: bool
|
|
15
|
+
"""Database connection status."""
|
|
16
|
+
|
|
17
|
+
redis: bool
|
|
18
|
+
"""Redis connection status."""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ServiceHealthCheckResponse(BaseModel):
|
|
22
|
+
now: str
|
|
23
|
+
"""Current server time in ISO 8601 format."""
|
|
24
|
+
|
|
25
|
+
status: Literal["ok", "degraded"]
|
|
26
|
+
"""Service status."""
|
|
27
|
+
|
|
28
|
+
uptime_seconds: int = FieldInfo(alias="uptimeSeconds")
|
|
29
|
+
"""API uptime in seconds."""
|
|
30
|
+
|
|
31
|
+
checks: Optional[Checks] = None
|
|
32
|
+
"""Detailed information about dependencies state."""
|