Skip to content

Commit e730c4f

Browse files
chore: update SDK to v0.4.6
1 parent b74a94c commit e730c4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+9838
-9938
lines changed

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
project = "X API SDK"
2222
copyright = "2024, X Developer Platform"
2323
author = "X Developer Platform"
24-
release = "0.4.5"
25-
version = "0.4.5"
24+
release = "0.4.6"
25+
version = "0.4.6"
2626

2727
# -- General configuration ----------------------------------------------------
2828

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ build-backend = "hatchling.build"
1414

1515
[project]
1616
name = "xdk"
17-
version = "0.4.5"
17+
version = "0.4.6"
1818
description = "Python SDK for the X API"
1919
authors = [
2020
{name = "X Developer Platform", email = "devs@x.com"},

scripts/process-for-mintlify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
MINTLIFY_CONFIG = {
2525
"outputDir": "mintlify-docs",
2626
"baseUrl": "https://docs.x.com",
27-
"title": "X API SDK v0.4.5",
27+
"title": "X API SDK v0.4.6",
2828
"description": "Python SDK for the X API with comprehensive pagination, authentication, and streaming support.",
29-
"version": "0.4.5",
29+
"version": "0.4.6",
3030
"githubUrl": "https://github.com/xdevplatform/xdk",
3131
}
3232

tests/account_activity/test_contracts.py

Lines changed: 127 additions & 127 deletions
Large diffs are not rendered by default.

tests/account_activity/test_structure.py

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -75,35 +75,33 @@ def test_get_subscriptions_return_annotation(self):
7575
), f"Method get_subscriptions should have return type annotation"
7676

7777

78-
def test_create_replay_job_exists(self):
79-
"""Test that create_replay_job method exists with correct signature."""
78+
def test_validate_subscription_exists(self):
79+
"""Test that validate_subscription method exists with correct signature."""
8080
# Check method exists
81-
method = getattr(AccountActivityClient, "create_replay_job", None)
81+
method = getattr(AccountActivityClient, "validate_subscription", None)
8282
assert (
8383
method is not None
84-
), f"Method create_replay_job does not exist on AccountActivityClient"
84+
), f"Method validate_subscription does not exist on AccountActivityClient"
8585
# Check method is callable
86-
assert callable(method), f"create_replay_job is not callable"
86+
assert callable(method), f"validate_subscription is not callable"
8787
# Check method signature
8888
sig = inspect.signature(method)
8989
params = list(sig.parameters.keys())
9090
# Should have 'self' as first parameter
9191
assert (
9292
len(params) >= 1
93-
), f"create_replay_job should have at least 'self' parameter"
93+
), f"validate_subscription should have at least 'self' parameter"
9494
assert (
9595
params[0] == "self"
9696
), f"First parameter should be 'self', got '{params[0]}'"
9797
# Check required parameters exist (excluding 'self')
9898
required_params = [
9999
"webhook_id",
100-
"from_date",
101-
"to_date",
102100
]
103101
for required_param in required_params:
104102
assert (
105103
required_param in params
106-
), f"Required parameter '{required_param}' missing from create_replay_job"
104+
), f"Required parameter '{required_param}' missing from validate_subscription"
107105
# Check optional parameters have defaults (excluding 'self')
108106
optional_params = []
109107
for optional_param in optional_params:
@@ -114,41 +112,43 @@ def test_create_replay_job_exists(self):
114112
), f"Optional parameter '{optional_param}' should have a default value"
115113

116114

117-
def test_create_replay_job_return_annotation(self):
118-
"""Test that create_replay_job has proper return type annotation."""
119-
method = getattr(AccountActivityClient, "create_replay_job")
115+
def test_validate_subscription_return_annotation(self):
116+
"""Test that validate_subscription has proper return type annotation."""
117+
method = getattr(AccountActivityClient, "validate_subscription")
120118
sig = inspect.signature(method)
121119
# Check return annotation exists
122120
assert (
123121
sig.return_annotation is not inspect.Signature.empty
124-
), f"Method create_replay_job should have return type annotation"
122+
), f"Method validate_subscription should have return type annotation"
125123

126124

127-
def test_get_subscription_count_exists(self):
128-
"""Test that get_subscription_count method exists with correct signature."""
125+
def test_create_subscription_exists(self):
126+
"""Test that create_subscription method exists with correct signature."""
129127
# Check method exists
130-
method = getattr(AccountActivityClient, "get_subscription_count", None)
128+
method = getattr(AccountActivityClient, "create_subscription", None)
131129
assert (
132130
method is not None
133-
), f"Method get_subscription_count does not exist on AccountActivityClient"
131+
), f"Method create_subscription does not exist on AccountActivityClient"
134132
# Check method is callable
135-
assert callable(method), f"get_subscription_count is not callable"
133+
assert callable(method), f"create_subscription is not callable"
136134
# Check method signature
137135
sig = inspect.signature(method)
138136
params = list(sig.parameters.keys())
139137
# Should have 'self' as first parameter
140138
assert (
141139
len(params) >= 1
142-
), f"get_subscription_count should have at least 'self' parameter"
140+
), f"create_subscription should have at least 'self' parameter"
143141
assert (
144142
params[0] == "self"
145143
), f"First parameter should be 'self', got '{params[0]}'"
146144
# Check required parameters exist (excluding 'self')
147-
required_params = []
145+
required_params = [
146+
"webhook_id",
147+
]
148148
for required_param in required_params:
149149
assert (
150150
required_param in params
151-
), f"Required parameter '{required_param}' missing from get_subscription_count"
151+
), f"Required parameter '{required_param}' missing from create_subscription"
152152
# Check optional parameters have defaults (excluding 'self')
153153
optional_params = []
154154
for optional_param in optional_params:
@@ -159,43 +159,44 @@ def test_get_subscription_count_exists(self):
159159
), f"Optional parameter '{optional_param}' should have a default value"
160160

161161

162-
def test_get_subscription_count_return_annotation(self):
163-
"""Test that get_subscription_count has proper return type annotation."""
164-
method = getattr(AccountActivityClient, "get_subscription_count")
162+
def test_create_subscription_return_annotation(self):
163+
"""Test that create_subscription has proper return type annotation."""
164+
method = getattr(AccountActivityClient, "create_subscription")
165165
sig = inspect.signature(method)
166166
# Check return annotation exists
167167
assert (
168168
sig.return_annotation is not inspect.Signature.empty
169-
), f"Method get_subscription_count should have return type annotation"
169+
), f"Method create_subscription should have return type annotation"
170170

171171

172-
def test_validate_subscription_exists(self):
173-
"""Test that validate_subscription method exists with correct signature."""
172+
def test_delete_subscription_exists(self):
173+
"""Test that delete_subscription method exists with correct signature."""
174174
# Check method exists
175-
method = getattr(AccountActivityClient, "validate_subscription", None)
175+
method = getattr(AccountActivityClient, "delete_subscription", None)
176176
assert (
177177
method is not None
178-
), f"Method validate_subscription does not exist on AccountActivityClient"
178+
), f"Method delete_subscription does not exist on AccountActivityClient"
179179
# Check method is callable
180-
assert callable(method), f"validate_subscription is not callable"
180+
assert callable(method), f"delete_subscription is not callable"
181181
# Check method signature
182182
sig = inspect.signature(method)
183183
params = list(sig.parameters.keys())
184184
# Should have 'self' as first parameter
185185
assert (
186186
len(params) >= 1
187-
), f"validate_subscription should have at least 'self' parameter"
187+
), f"delete_subscription should have at least 'self' parameter"
188188
assert (
189189
params[0] == "self"
190190
), f"First parameter should be 'self', got '{params[0]}'"
191191
# Check required parameters exist (excluding 'self')
192192
required_params = [
193193
"webhook_id",
194+
"user_id",
194195
]
195196
for required_param in required_params:
196197
assert (
197198
required_param in params
198-
), f"Required parameter '{required_param}' missing from validate_subscription"
199+
), f"Required parameter '{required_param}' missing from delete_subscription"
199200
# Check optional parameters have defaults (excluding 'self')
200201
optional_params = []
201202
for optional_param in optional_params:
@@ -206,43 +207,41 @@ def test_validate_subscription_exists(self):
206207
), f"Optional parameter '{optional_param}' should have a default value"
207208

208209

209-
def test_validate_subscription_return_annotation(self):
210-
"""Test that validate_subscription has proper return type annotation."""
211-
method = getattr(AccountActivityClient, "validate_subscription")
210+
def test_delete_subscription_return_annotation(self):
211+
"""Test that delete_subscription has proper return type annotation."""
212+
method = getattr(AccountActivityClient, "delete_subscription")
212213
sig = inspect.signature(method)
213214
# Check return annotation exists
214215
assert (
215216
sig.return_annotation is not inspect.Signature.empty
216-
), f"Method validate_subscription should have return type annotation"
217+
), f"Method delete_subscription should have return type annotation"
217218

218219

219-
def test_create_subscription_exists(self):
220-
"""Test that create_subscription method exists with correct signature."""
220+
def test_get_subscription_count_exists(self):
221+
"""Test that get_subscription_count method exists with correct signature."""
221222
# Check method exists
222-
method = getattr(AccountActivityClient, "create_subscription", None)
223+
method = getattr(AccountActivityClient, "get_subscription_count", None)
223224
assert (
224225
method is not None
225-
), f"Method create_subscription does not exist on AccountActivityClient"
226+
), f"Method get_subscription_count does not exist on AccountActivityClient"
226227
# Check method is callable
227-
assert callable(method), f"create_subscription is not callable"
228+
assert callable(method), f"get_subscription_count is not callable"
228229
# Check method signature
229230
sig = inspect.signature(method)
230231
params = list(sig.parameters.keys())
231232
# Should have 'self' as first parameter
232233
assert (
233234
len(params) >= 1
234-
), f"create_subscription should have at least 'self' parameter"
235+
), f"get_subscription_count should have at least 'self' parameter"
235236
assert (
236237
params[0] == "self"
237238
), f"First parameter should be 'self', got '{params[0]}'"
238239
# Check required parameters exist (excluding 'self')
239-
required_params = [
240-
"webhook_id",
241-
]
240+
required_params = []
242241
for required_param in required_params:
243242
assert (
244243
required_param in params
245-
), f"Required parameter '{required_param}' missing from create_subscription"
244+
), f"Required parameter '{required_param}' missing from get_subscription_count"
246245
# Check optional parameters have defaults (excluding 'self')
247246
optional_params = []
248247
for optional_param in optional_params:
@@ -253,44 +252,45 @@ def test_create_subscription_exists(self):
253252
), f"Optional parameter '{optional_param}' should have a default value"
254253

255254

256-
def test_create_subscription_return_annotation(self):
257-
"""Test that create_subscription has proper return type annotation."""
258-
method = getattr(AccountActivityClient, "create_subscription")
255+
def test_get_subscription_count_return_annotation(self):
256+
"""Test that get_subscription_count has proper return type annotation."""
257+
method = getattr(AccountActivityClient, "get_subscription_count")
259258
sig = inspect.signature(method)
260259
# Check return annotation exists
261260
assert (
262261
sig.return_annotation is not inspect.Signature.empty
263-
), f"Method create_subscription should have return type annotation"
262+
), f"Method get_subscription_count should have return type annotation"
264263

265264

266-
def test_delete_subscription_exists(self):
267-
"""Test that delete_subscription method exists with correct signature."""
265+
def test_create_replay_job_exists(self):
266+
"""Test that create_replay_job method exists with correct signature."""
268267
# Check method exists
269-
method = getattr(AccountActivityClient, "delete_subscription", None)
268+
method = getattr(AccountActivityClient, "create_replay_job", None)
270269
assert (
271270
method is not None
272-
), f"Method delete_subscription does not exist on AccountActivityClient"
271+
), f"Method create_replay_job does not exist on AccountActivityClient"
273272
# Check method is callable
274-
assert callable(method), f"delete_subscription is not callable"
273+
assert callable(method), f"create_replay_job is not callable"
275274
# Check method signature
276275
sig = inspect.signature(method)
277276
params = list(sig.parameters.keys())
278277
# Should have 'self' as first parameter
279278
assert (
280279
len(params) >= 1
281-
), f"delete_subscription should have at least 'self' parameter"
280+
), f"create_replay_job should have at least 'self' parameter"
282281
assert (
283282
params[0] == "self"
284283
), f"First parameter should be 'self', got '{params[0]}'"
285284
# Check required parameters exist (excluding 'self')
286285
required_params = [
287286
"webhook_id",
288-
"user_id",
287+
"from_date",
288+
"to_date",
289289
]
290290
for required_param in required_params:
291291
assert (
292292
required_param in params
293-
), f"Required parameter '{required_param}' missing from delete_subscription"
293+
), f"Required parameter '{required_param}' missing from create_replay_job"
294294
# Check optional parameters have defaults (excluding 'self')
295295
optional_params = []
296296
for optional_param in optional_params:
@@ -301,25 +301,25 @@ def test_delete_subscription_exists(self):
301301
), f"Optional parameter '{optional_param}' should have a default value"
302302

303303

304-
def test_delete_subscription_return_annotation(self):
305-
"""Test that delete_subscription has proper return type annotation."""
306-
method = getattr(AccountActivityClient, "delete_subscription")
304+
def test_create_replay_job_return_annotation(self):
305+
"""Test that create_replay_job has proper return type annotation."""
306+
method = getattr(AccountActivityClient, "create_replay_job")
307307
sig = inspect.signature(method)
308308
# Check return annotation exists
309309
assert (
310310
sig.return_annotation is not inspect.Signature.empty
311-
), f"Method delete_subscription should have return type annotation"
311+
), f"Method create_replay_job should have return type annotation"
312312

313313

314314
def test_all_expected_methods_exist(self):
315315
"""Test that all expected methods exist on the client."""
316316
expected_methods = [
317317
"get_subscriptions",
318-
"create_replay_job",
319-
"get_subscription_count",
320318
"validate_subscription",
321319
"create_subscription",
322320
"delete_subscription",
321+
"get_subscription_count",
322+
"create_replay_job",
323323
]
324324
for expected_method in expected_methods:
325325
assert hasattr(

0 commit comments

Comments
 (0)