xdataapi 0.3.1__tar.gz → 0.3.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.
- {xdataapi-0.3.1 → xdataapi-0.3.2}/PKG-INFO +1 -1
- {xdataapi-0.3.1 → xdataapi-0.3.2}/pyproject.toml +1 -1
- xdataapi-0.3.2/xdataapi/api/users/get_user_by_id.py +222 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/users/get_users.py +36 -24
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/error_body.py +11 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/error_body_code.py +1 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/get_users_body.py +24 -10
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/list_packs_response_200.py +1 -3
- {xdataapi-0.3.1 → xdataapi-0.3.2}/README.md +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/__init__.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/__init__.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/account/__init__.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/account/get_me.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/billing/__init__.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/billing/create_checkout.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/billing/list_packs.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/tweets/__init__.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/tweets/get_quotes.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/tweets/get_replies.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/tweets/get_retweeters.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/tweets/get_thread.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/tweets/get_tweet.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/tweets/get_tweets.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/tweets/search_tweets.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/users/__init__.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/users/get_follower_ids.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/users/get_followers.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/users/get_following.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/users/get_user.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/api/users/get_user_tweets.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/client.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/errors.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/__init__.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/batch_error.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/batch_error_code.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/batch_meta.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/batch_meta_cache.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/create_checkout_body.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/create_checkout_body_pack.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/create_checkout_response_200.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/error.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/get_me_response_200.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/get_tweets_body.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/id_page.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/list_packs_response_200_data_item.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/list_packs_response_200_rate_limits_item.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/media.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/media_type.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/meta.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/meta_cache.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/problem.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/search_tweets_product.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/tweet.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/tweet_batch.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/tweet_page.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/tweet_response.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/user.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/user_batch.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/user_page.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/user_response.py +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/py.typed +0 -0
- {xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/types.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xdataapi
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Python client for the xdataapi.io API: read-only X (Twitter) profiles, tweets, threads, search.
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: twitter,x,api,tweets,sdk,xdataapi,twitter-api,x-api,mcp,agent,llm
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error import Error
|
|
10
|
+
from ...models.user_response import UserResponse
|
|
11
|
+
from ...types import UNSET, Response, Unset
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
id: str,
|
|
16
|
+
*,
|
|
17
|
+
fresh: bool | Unset = False,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
|
|
20
|
+
params: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
params["fresh"] = fresh
|
|
23
|
+
|
|
24
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
25
|
+
|
|
26
|
+
_kwargs: dict[str, Any] = {
|
|
27
|
+
"method": "get",
|
|
28
|
+
"url": "/v1/users/id/{id}".format(
|
|
29
|
+
id=quote(str(id), safe=""),
|
|
30
|
+
),
|
|
31
|
+
"params": params,
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return _kwargs
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Error | UserResponse | None:
|
|
38
|
+
if response.status_code == 200:
|
|
39
|
+
response_200 = UserResponse.from_dict(response.json())
|
|
40
|
+
|
|
41
|
+
return response_200
|
|
42
|
+
|
|
43
|
+
if response.status_code == 400:
|
|
44
|
+
response_400 = Error.from_dict(response.json())
|
|
45
|
+
|
|
46
|
+
return response_400
|
|
47
|
+
|
|
48
|
+
if response.status_code == 401:
|
|
49
|
+
response_401 = Error.from_dict(response.json())
|
|
50
|
+
|
|
51
|
+
return response_401
|
|
52
|
+
|
|
53
|
+
if response.status_code == 402:
|
|
54
|
+
response_402 = Error.from_dict(response.json())
|
|
55
|
+
|
|
56
|
+
return response_402
|
|
57
|
+
|
|
58
|
+
if response.status_code == 404:
|
|
59
|
+
response_404 = Error.from_dict(response.json())
|
|
60
|
+
|
|
61
|
+
return response_404
|
|
62
|
+
|
|
63
|
+
if response.status_code == 429:
|
|
64
|
+
response_429 = Error.from_dict(response.json())
|
|
65
|
+
|
|
66
|
+
return response_429
|
|
67
|
+
|
|
68
|
+
if response.status_code == 500:
|
|
69
|
+
response_500 = Error.from_dict(response.json())
|
|
70
|
+
|
|
71
|
+
return response_500
|
|
72
|
+
|
|
73
|
+
if response.status_code == 503:
|
|
74
|
+
response_503 = Error.from_dict(response.json())
|
|
75
|
+
|
|
76
|
+
return response_503
|
|
77
|
+
|
|
78
|
+
if client.raise_on_unexpected_status:
|
|
79
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
80
|
+
else:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _build_response(
|
|
85
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
86
|
+
) -> Response[Error | UserResponse]:
|
|
87
|
+
return Response(
|
|
88
|
+
status_code=HTTPStatus(response.status_code),
|
|
89
|
+
content=response.content,
|
|
90
|
+
headers=response.headers,
|
|
91
|
+
parsed=_parse_response(client=client, response=response),
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def sync_detailed(
|
|
96
|
+
id: str,
|
|
97
|
+
*,
|
|
98
|
+
client: AuthenticatedClient | Client,
|
|
99
|
+
fresh: bool | Unset = False,
|
|
100
|
+
) -> Response[Error | UserResponse]:
|
|
101
|
+
"""Profile by user id
|
|
102
|
+
|
|
103
|
+
The same profile as `/v1/users/{handle}`, found by the numeric user id. The id stays the same when a
|
|
104
|
+
user changes the handle, so it is the key to store. 1 credit per profile.
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
id (str):
|
|
108
|
+
fresh (bool | Unset): Default: False.
|
|
109
|
+
|
|
110
|
+
Raises:
|
|
111
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
112
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
Response[Error | UserResponse]
|
|
116
|
+
"""
|
|
117
|
+
|
|
118
|
+
kwargs = _get_kwargs(
|
|
119
|
+
id=id,
|
|
120
|
+
fresh=fresh,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
response = client.get_httpx_client().request(
|
|
124
|
+
**kwargs,
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
return _build_response(client=client, response=response)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
def sync(
|
|
131
|
+
id: str,
|
|
132
|
+
*,
|
|
133
|
+
client: AuthenticatedClient | Client,
|
|
134
|
+
fresh: bool | Unset = False,
|
|
135
|
+
) -> Error | UserResponse | None:
|
|
136
|
+
"""Profile by user id
|
|
137
|
+
|
|
138
|
+
The same profile as `/v1/users/{handle}`, found by the numeric user id. The id stays the same when a
|
|
139
|
+
user changes the handle, so it is the key to store. 1 credit per profile.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
id (str):
|
|
143
|
+
fresh (bool | Unset): Default: False.
|
|
144
|
+
|
|
145
|
+
Raises:
|
|
146
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
147
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
148
|
+
|
|
149
|
+
Returns:
|
|
150
|
+
Error | UserResponse
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
return sync_detailed(
|
|
154
|
+
id=id,
|
|
155
|
+
client=client,
|
|
156
|
+
fresh=fresh,
|
|
157
|
+
).parsed
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
async def asyncio_detailed(
|
|
161
|
+
id: str,
|
|
162
|
+
*,
|
|
163
|
+
client: AuthenticatedClient | Client,
|
|
164
|
+
fresh: bool | Unset = False,
|
|
165
|
+
) -> Response[Error | UserResponse]:
|
|
166
|
+
"""Profile by user id
|
|
167
|
+
|
|
168
|
+
The same profile as `/v1/users/{handle}`, found by the numeric user id. The id stays the same when a
|
|
169
|
+
user changes the handle, so it is the key to store. 1 credit per profile.
|
|
170
|
+
|
|
171
|
+
Args:
|
|
172
|
+
id (str):
|
|
173
|
+
fresh (bool | Unset): Default: False.
|
|
174
|
+
|
|
175
|
+
Raises:
|
|
176
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
177
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
Response[Error | UserResponse]
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
kwargs = _get_kwargs(
|
|
184
|
+
id=id,
|
|
185
|
+
fresh=fresh,
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
189
|
+
|
|
190
|
+
return _build_response(client=client, response=response)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
async def asyncio(
|
|
194
|
+
id: str,
|
|
195
|
+
*,
|
|
196
|
+
client: AuthenticatedClient | Client,
|
|
197
|
+
fresh: bool | Unset = False,
|
|
198
|
+
) -> Error | UserResponse | None:
|
|
199
|
+
"""Profile by user id
|
|
200
|
+
|
|
201
|
+
The same profile as `/v1/users/{handle}`, found by the numeric user id. The id stays the same when a
|
|
202
|
+
user changes the handle, so it is the key to store. 1 credit per profile.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
id (str):
|
|
206
|
+
fresh (bool | Unset): Default: False.
|
|
207
|
+
|
|
208
|
+
Raises:
|
|
209
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
210
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
211
|
+
|
|
212
|
+
Returns:
|
|
213
|
+
Error | UserResponse
|
|
214
|
+
"""
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
await asyncio_detailed(
|
|
218
|
+
id=id,
|
|
219
|
+
client=client,
|
|
220
|
+
fresh=fresh,
|
|
221
|
+
)
|
|
222
|
+
).parsed
|
|
@@ -95,17 +95,20 @@ def sync_detailed(
|
|
|
95
95
|
body: GetUsersBody,
|
|
96
96
|
fresh: bool | Unset = False,
|
|
97
97
|
) -> Response[Error | UserBatch]:
|
|
98
|
-
"""Profiles by handle, batch
|
|
99
|
-
|
|
100
|
-
Up to 100 profiles in one call
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
"""Profiles by handle or by user id, batch
|
|
99
|
+
|
|
100
|
+
Up to 100 profiles in one call, by handle (`handles`) or by numeric user id (`ids`). Send one of the
|
|
101
|
+
two
|
|
102
|
+
lists. The id stays the same when a user changes the handle. 1 credit per profile found; inputs that
|
|
103
|
+
do
|
|
104
|
+
not exist are listed in `errors` and cost nothing. Duplicates are folded. Results in input order.
|
|
105
|
+
Also `GET /v1/users/batch?handles=a,b,c` and `GET /v1/users/batch?ids=783214,13334762`.
|
|
103
106
|
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
104
107
|
fetched.
|
|
105
108
|
|
|
106
109
|
Args:
|
|
107
110
|
fresh (bool | Unset): Default: False.
|
|
108
|
-
body (GetUsersBody):
|
|
111
|
+
body (GetUsersBody): Exactly one of `handles` and `ids`.
|
|
109
112
|
|
|
110
113
|
Raises:
|
|
111
114
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -133,17 +136,20 @@ def sync(
|
|
|
133
136
|
body: GetUsersBody,
|
|
134
137
|
fresh: bool | Unset = False,
|
|
135
138
|
) -> Error | UserBatch | None:
|
|
136
|
-
"""Profiles by handle, batch
|
|
137
|
-
|
|
138
|
-
Up to 100 profiles in one call
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
"""Profiles by handle or by user id, batch
|
|
140
|
+
|
|
141
|
+
Up to 100 profiles in one call, by handle (`handles`) or by numeric user id (`ids`). Send one of the
|
|
142
|
+
two
|
|
143
|
+
lists. The id stays the same when a user changes the handle. 1 credit per profile found; inputs that
|
|
144
|
+
do
|
|
145
|
+
not exist are listed in `errors` and cost nothing. Duplicates are folded. Results in input order.
|
|
146
|
+
Also `GET /v1/users/batch?handles=a,b,c` and `GET /v1/users/batch?ids=783214,13334762`.
|
|
141
147
|
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
142
148
|
fetched.
|
|
143
149
|
|
|
144
150
|
Args:
|
|
145
151
|
fresh (bool | Unset): Default: False.
|
|
146
|
-
body (GetUsersBody):
|
|
152
|
+
body (GetUsersBody): Exactly one of `handles` and `ids`.
|
|
147
153
|
|
|
148
154
|
Raises:
|
|
149
155
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -166,17 +172,20 @@ async def asyncio_detailed(
|
|
|
166
172
|
body: GetUsersBody,
|
|
167
173
|
fresh: bool | Unset = False,
|
|
168
174
|
) -> Response[Error | UserBatch]:
|
|
169
|
-
"""Profiles by handle, batch
|
|
170
|
-
|
|
171
|
-
Up to 100 profiles in one call
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
"""Profiles by handle or by user id, batch
|
|
176
|
+
|
|
177
|
+
Up to 100 profiles in one call, by handle (`handles`) or by numeric user id (`ids`). Send one of the
|
|
178
|
+
two
|
|
179
|
+
lists. The id stays the same when a user changes the handle. 1 credit per profile found; inputs that
|
|
180
|
+
do
|
|
181
|
+
not exist are listed in `errors` and cost nothing. Duplicates are folded. Results in input order.
|
|
182
|
+
Also `GET /v1/users/batch?handles=a,b,c` and `GET /v1/users/batch?ids=783214,13334762`.
|
|
174
183
|
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
175
184
|
fetched.
|
|
176
185
|
|
|
177
186
|
Args:
|
|
178
187
|
fresh (bool | Unset): Default: False.
|
|
179
|
-
body (GetUsersBody):
|
|
188
|
+
body (GetUsersBody): Exactly one of `handles` and `ids`.
|
|
180
189
|
|
|
181
190
|
Raises:
|
|
182
191
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -202,17 +211,20 @@ async def asyncio(
|
|
|
202
211
|
body: GetUsersBody,
|
|
203
212
|
fresh: bool | Unset = False,
|
|
204
213
|
) -> Error | UserBatch | None:
|
|
205
|
-
"""Profiles by handle, batch
|
|
206
|
-
|
|
207
|
-
Up to 100 profiles in one call
|
|
208
|
-
|
|
209
|
-
|
|
214
|
+
"""Profiles by handle or by user id, batch
|
|
215
|
+
|
|
216
|
+
Up to 100 profiles in one call, by handle (`handles`) or by numeric user id (`ids`). Send one of the
|
|
217
|
+
two
|
|
218
|
+
lists. The id stays the same when a user changes the handle. 1 credit per profile found; inputs that
|
|
219
|
+
do
|
|
220
|
+
not exist are listed in `errors` and cost nothing. Duplicates are folded. Results in input order.
|
|
221
|
+
Also `GET /v1/users/batch?handles=a,b,c` and `GET /v1/users/batch?ids=783214,13334762`.
|
|
210
222
|
When the balance covers only part of the list, the tail comes back as `no_credits` and is not
|
|
211
223
|
fetched.
|
|
212
224
|
|
|
213
225
|
Args:
|
|
214
226
|
fresh (bool | Unset): Default: False.
|
|
215
|
-
body (GetUsersBody):
|
|
227
|
+
body (GetUsersBody): Exactly one of `handles` and `ids`.
|
|
216
228
|
|
|
217
229
|
Raises:
|
|
218
230
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
@@ -7,6 +7,7 @@ from attrs import define as _attrs_define
|
|
|
7
7
|
from attrs import field as _attrs_field
|
|
8
8
|
|
|
9
9
|
from ..models.error_body_code import ErrorBodyCode
|
|
10
|
+
from ..types import UNSET, Unset
|
|
10
11
|
|
|
11
12
|
T = TypeVar("T", bound="ErrorBody")
|
|
12
13
|
|
|
@@ -18,10 +19,13 @@ class ErrorBody:
|
|
|
18
19
|
Attributes:
|
|
19
20
|
code (ErrorBodyCode):
|
|
20
21
|
message (str):
|
|
22
|
+
top_up_url (str | Unset): Only on `no_credits`. The page where a pack is bought. Example:
|
|
23
|
+
https://xdataapi.io/dashboard/billing.
|
|
21
24
|
"""
|
|
22
25
|
|
|
23
26
|
code: ErrorBodyCode
|
|
24
27
|
message: str
|
|
28
|
+
top_up_url: str | Unset = UNSET
|
|
25
29
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
30
|
|
|
27
31
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -29,6 +33,8 @@ class ErrorBody:
|
|
|
29
33
|
|
|
30
34
|
message = self.message
|
|
31
35
|
|
|
36
|
+
top_up_url = self.top_up_url
|
|
37
|
+
|
|
32
38
|
field_dict: dict[str, Any] = {}
|
|
33
39
|
field_dict.update(self.additional_properties)
|
|
34
40
|
field_dict.update(
|
|
@@ -37,6 +43,8 @@ class ErrorBody:
|
|
|
37
43
|
"message": message,
|
|
38
44
|
}
|
|
39
45
|
)
|
|
46
|
+
if top_up_url is not UNSET:
|
|
47
|
+
field_dict["top_up_url"] = top_up_url
|
|
40
48
|
|
|
41
49
|
return field_dict
|
|
42
50
|
|
|
@@ -47,9 +55,12 @@ class ErrorBody:
|
|
|
47
55
|
|
|
48
56
|
message = d.pop("message")
|
|
49
57
|
|
|
58
|
+
top_up_url = d.pop("top_up_url", UNSET)
|
|
59
|
+
|
|
50
60
|
error_body = cls(
|
|
51
61
|
code=code,
|
|
52
62
|
message=message,
|
|
63
|
+
top_up_url=top_up_url,
|
|
53
64
|
)
|
|
54
65
|
|
|
55
66
|
error_body.additional_properties = d
|
|
@@ -6,39 +6,53 @@ from typing import Any, TypeVar, cast
|
|
|
6
6
|
from attrs import define as _attrs_define
|
|
7
7
|
from attrs import field as _attrs_field
|
|
8
8
|
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
9
11
|
T = TypeVar("T", bound="GetUsersBody")
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
@_attrs_define
|
|
13
15
|
class GetUsersBody:
|
|
14
|
-
"""
|
|
16
|
+
"""Exactly one of `handles` and `ids`.
|
|
17
|
+
|
|
15
18
|
Attributes:
|
|
16
|
-
handles (list[str]): Example: ['x', 'github', 'vercel'].
|
|
19
|
+
handles (list[str] | Unset): Example: ['x', 'github', 'vercel'].
|
|
20
|
+
ids (list[str] | Unset): Example: ['783214', '13334762'].
|
|
17
21
|
"""
|
|
18
22
|
|
|
19
|
-
handles: list[str]
|
|
23
|
+
handles: list[str] | Unset = UNSET
|
|
24
|
+
ids: list[str] | Unset = UNSET
|
|
20
25
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
21
26
|
|
|
22
27
|
def to_dict(self) -> dict[str, Any]:
|
|
23
|
-
handles =
|
|
28
|
+
handles: list[str] | Unset = UNSET
|
|
29
|
+
if not isinstance(self.handles, Unset):
|
|
30
|
+
handles = self.handles
|
|
31
|
+
|
|
32
|
+
ids: list[str] | Unset = UNSET
|
|
33
|
+
if not isinstance(self.ids, Unset):
|
|
34
|
+
ids = self.ids
|
|
24
35
|
|
|
25
36
|
field_dict: dict[str, Any] = {}
|
|
26
37
|
field_dict.update(self.additional_properties)
|
|
27
|
-
field_dict.update(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
field_dict.update({})
|
|
39
|
+
if handles is not UNSET:
|
|
40
|
+
field_dict["handles"] = handles
|
|
41
|
+
if ids is not UNSET:
|
|
42
|
+
field_dict["ids"] = ids
|
|
32
43
|
|
|
33
44
|
return field_dict
|
|
34
45
|
|
|
35
46
|
@classmethod
|
|
36
47
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
37
48
|
d = dict(src_dict)
|
|
38
|
-
handles = cast(list[str], d.pop("handles"))
|
|
49
|
+
handles = cast(list[str], d.pop("handles", UNSET))
|
|
50
|
+
|
|
51
|
+
ids = cast(list[str], d.pop("ids", UNSET))
|
|
39
52
|
|
|
40
53
|
get_users_body = cls(
|
|
41
54
|
handles=handles,
|
|
55
|
+
ids=ids,
|
|
42
56
|
)
|
|
43
57
|
|
|
44
58
|
get_users_body.additional_properties = d
|
|
@@ -57,9 +57,7 @@ class ListPacksResponse200:
|
|
|
57
57
|
@classmethod
|
|
58
58
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
59
59
|
from ..models.list_packs_response_200_data_item import ListPacksResponse200DataItem # noqa: PLC0415
|
|
60
|
-
from ..models.list_packs_response_200_rate_limits_item import
|
|
61
|
-
ListPacksResponse200RateLimitsItem, # noqa: PLC0415
|
|
62
|
-
)
|
|
60
|
+
from ..models.list_packs_response_200_rate_limits_item import ListPacksResponse200RateLimitsItem # noqa: PLC0415
|
|
63
61
|
|
|
64
62
|
d = dict(src_dict)
|
|
65
63
|
_data = d.pop("data", UNSET)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{xdataapi-0.3.1 → xdataapi-0.3.2}/xdataapi/models/list_packs_response_200_rate_limits_item.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|