Skip to content

Commit d79b6dc

Browse files
chore: update SDK to v0.4.3
1 parent 78dc1c5 commit d79b6dc

Some content is hidden

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

65 files changed

+9968
-8590
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.2"
25-
version = "0.4.2"
24+
release = "0.4.3"
25+
version = "0.4.3"
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.2"
17+
version = "0.4.3"
1818
description = "Python SDK for the X API"
1919
authors = [
2020
{name = "X Developer Platform", email = "[email protected]"},

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.2",
27+
"title": "X API SDK v0.4.3",
2828
"description": "Python SDK for the X API with comprehensive pagination, authentication, and streaming support.",
29-
"version": "0.4.2",
29+
"version": "0.4.3",
3030
"githubUrl": "https://github.com/xdevplatform/xdk",
3131
}
3232

tests/account_activity/test_contracts.py

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

tests/account_activity/test_structure.py

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -28,55 +28,6 @@ def setup_class(self):
2828
self.account_activity_client = getattr(self.client, "account_activity")
2929

3030

31-
def test_create_replay_job_exists(self):
32-
"""Test that create_replay_job method exists with correct signature."""
33-
# Check method exists
34-
method = getattr(AccountActivityClient, "create_replay_job", None)
35-
assert (
36-
method is not None
37-
), f"Method create_replay_job does not exist on AccountActivityClient"
38-
# Check method is callable
39-
assert callable(method), f"create_replay_job is not callable"
40-
# Check method signature
41-
sig = inspect.signature(method)
42-
params = list(sig.parameters.keys())
43-
# Should have 'self' as first parameter
44-
assert (
45-
len(params) >= 1
46-
), f"create_replay_job should have at least 'self' parameter"
47-
assert (
48-
params[0] == "self"
49-
), f"First parameter should be 'self', got '{params[0]}'"
50-
# Check required parameters exist (excluding 'self')
51-
required_params = [
52-
"webhook_id",
53-
"from_date",
54-
"to_date",
55-
]
56-
for required_param in required_params:
57-
assert (
58-
required_param in params
59-
), f"Required parameter '{required_param}' missing from create_replay_job"
60-
# Check optional parameters have defaults (excluding 'self')
61-
optional_params = []
62-
for optional_param in optional_params:
63-
if optional_param in params:
64-
param_obj = sig.parameters[optional_param]
65-
assert (
66-
param_obj.default is not inspect.Parameter.empty
67-
), f"Optional parameter '{optional_param}' should have a default value"
68-
69-
70-
def test_create_replay_job_return_annotation(self):
71-
"""Test that create_replay_job has proper return type annotation."""
72-
method = getattr(AccountActivityClient, "create_replay_job")
73-
sig = inspect.signature(method)
74-
# Check return annotation exists
75-
assert (
76-
sig.return_annotation is not inspect.Signature.empty
77-
), f"Method create_replay_job should have return type annotation"
78-
79-
8031
def test_validate_subscription_exists(self):
8132
"""Test that validate_subscription method exists with correct signature."""
8233
# Check method exists
@@ -218,31 +169,34 @@ def test_get_subscriptions_return_annotation(self):
218169
), f"Method get_subscriptions should have return type annotation"
219170

220171

221-
def test_get_subscription_count_exists(self):
222-
"""Test that get_subscription_count method exists with correct signature."""
172+
def test_delete_subscription_exists(self):
173+
"""Test that delete_subscription method exists with correct signature."""
223174
# Check method exists
224-
method = getattr(AccountActivityClient, "get_subscription_count", None)
175+
method = getattr(AccountActivityClient, "delete_subscription", None)
225176
assert (
226177
method is not None
227-
), f"Method get_subscription_count does not exist on AccountActivityClient"
178+
), f"Method delete_subscription does not exist on AccountActivityClient"
228179
# Check method is callable
229-
assert callable(method), f"get_subscription_count is not callable"
180+
assert callable(method), f"delete_subscription is not callable"
230181
# Check method signature
231182
sig = inspect.signature(method)
232183
params = list(sig.parameters.keys())
233184
# Should have 'self' as first parameter
234185
assert (
235186
len(params) >= 1
236-
), f"get_subscription_count should have at least 'self' parameter"
187+
), f"delete_subscription should have at least 'self' parameter"
237188
assert (
238189
params[0] == "self"
239190
), f"First parameter should be 'self', got '{params[0]}'"
240191
# Check required parameters exist (excluding 'self')
241-
required_params = []
192+
required_params = [
193+
"webhook_id",
194+
"user_id",
195+
]
242196
for required_param in required_params:
243197
assert (
244198
required_param in params
245-
), f"Required parameter '{required_param}' missing from get_subscription_count"
199+
), f"Required parameter '{required_param}' missing from delete_subscription"
246200
# Check optional parameters have defaults (excluding 'self')
247201
optional_params = []
248202
for optional_param in optional_params:
@@ -253,44 +207,45 @@ def test_get_subscription_count_exists(self):
253207
), f"Optional parameter '{optional_param}' should have a default value"
254208

255209

256-
def test_get_subscription_count_return_annotation(self):
257-
"""Test that get_subscription_count has proper return type annotation."""
258-
method = getattr(AccountActivityClient, "get_subscription_count")
210+
def test_delete_subscription_return_annotation(self):
211+
"""Test that delete_subscription has proper return type annotation."""
212+
method = getattr(AccountActivityClient, "delete_subscription")
259213
sig = inspect.signature(method)
260214
# Check return annotation exists
261215
assert (
262216
sig.return_annotation is not inspect.Signature.empty
263-
), f"Method get_subscription_count should have return type annotation"
217+
), f"Method delete_subscription should have return type annotation"
264218

265219

266-
def test_delete_subscription_exists(self):
267-
"""Test that delete_subscription method exists with correct signature."""
220+
def test_create_replay_job_exists(self):
221+
"""Test that create_replay_job method exists with correct signature."""
268222
# Check method exists
269-
method = getattr(AccountActivityClient, "delete_subscription", None)
223+
method = getattr(AccountActivityClient, "create_replay_job", None)
270224
assert (
271225
method is not None
272-
), f"Method delete_subscription does not exist on AccountActivityClient"
226+
), f"Method create_replay_job does not exist on AccountActivityClient"
273227
# Check method is callable
274-
assert callable(method), f"delete_subscription is not callable"
228+
assert callable(method), f"create_replay_job is not callable"
275229
# Check method signature
276230
sig = inspect.signature(method)
277231
params = list(sig.parameters.keys())
278232
# Should have 'self' as first parameter
279233
assert (
280234
len(params) >= 1
281-
), f"delete_subscription should have at least 'self' parameter"
235+
), f"create_replay_job should have at least 'self' parameter"
282236
assert (
283237
params[0] == "self"
284238
), f"First parameter should be 'self', got '{params[0]}'"
285239
# Check required parameters exist (excluding 'self')
286240
required_params = [
287241
"webhook_id",
288-
"user_id",
242+
"from_date",
243+
"to_date",
289244
]
290245
for required_param in required_params:
291246
assert (
292247
required_param in params
293-
), f"Required parameter '{required_param}' missing from delete_subscription"
248+
), f"Required parameter '{required_param}' missing from create_replay_job"
294249
# Check optional parameters have defaults (excluding 'self')
295250
optional_params = []
296251
for optional_param in optional_params:
@@ -301,25 +256,70 @@ def test_delete_subscription_exists(self):
301256
), f"Optional parameter '{optional_param}' should have a default value"
302257

303258

304-
def test_delete_subscription_return_annotation(self):
305-
"""Test that delete_subscription has proper return type annotation."""
306-
method = getattr(AccountActivityClient, "delete_subscription")
259+
def test_create_replay_job_return_annotation(self):
260+
"""Test that create_replay_job has proper return type annotation."""
261+
method = getattr(AccountActivityClient, "create_replay_job")
307262
sig = inspect.signature(method)
308263
# Check return annotation exists
309264
assert (
310265
sig.return_annotation is not inspect.Signature.empty
311-
), f"Method delete_subscription should have return type annotation"
266+
), f"Method create_replay_job should have return type annotation"
267+
268+
269+
def test_get_subscription_count_exists(self):
270+
"""Test that get_subscription_count method exists with correct signature."""
271+
# Check method exists
272+
method = getattr(AccountActivityClient, "get_subscription_count", None)
273+
assert (
274+
method is not None
275+
), f"Method get_subscription_count does not exist on AccountActivityClient"
276+
# Check method is callable
277+
assert callable(method), f"get_subscription_count is not callable"
278+
# Check method signature
279+
sig = inspect.signature(method)
280+
params = list(sig.parameters.keys())
281+
# Should have 'self' as first parameter
282+
assert (
283+
len(params) >= 1
284+
), f"get_subscription_count should have at least 'self' parameter"
285+
assert (
286+
params[0] == "self"
287+
), f"First parameter should be 'self', got '{params[0]}'"
288+
# Check required parameters exist (excluding 'self')
289+
required_params = []
290+
for required_param in required_params:
291+
assert (
292+
required_param in params
293+
), f"Required parameter '{required_param}' missing from get_subscription_count"
294+
# Check optional parameters have defaults (excluding 'self')
295+
optional_params = []
296+
for optional_param in optional_params:
297+
if optional_param in params:
298+
param_obj = sig.parameters[optional_param]
299+
assert (
300+
param_obj.default is not inspect.Parameter.empty
301+
), f"Optional parameter '{optional_param}' should have a default value"
302+
303+
304+
def test_get_subscription_count_return_annotation(self):
305+
"""Test that get_subscription_count has proper return type annotation."""
306+
method = getattr(AccountActivityClient, "get_subscription_count")
307+
sig = inspect.signature(method)
308+
# Check return annotation exists
309+
assert (
310+
sig.return_annotation is not inspect.Signature.empty
311+
), f"Method get_subscription_count 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 = [
317-
"create_replay_job",
318317
"validate_subscription",
319318
"create_subscription",
320319
"get_subscriptions",
321-
"get_subscription_count",
322320
"delete_subscription",
321+
"create_replay_job",
322+
"get_subscription_count",
323323
]
324324
for expected_method in expected_methods:
325325
assert hasattr(

0 commit comments

Comments
 (0)