Skip to content

Commit 6405676

Browse files
chore: update SDK to v0.2.5-beta
1 parent 30b15c0 commit 6405676

Some content is hidden

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

62 files changed

+8518
-8516
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.2.4-beta"
25-
version = "0.2.4-beta"
24+
release = "0.2.5-beta"
25+
version = "0.2.5-beta"
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.2.4-beta"
17+
version = "0.2.5-beta"
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.2.4-beta",
27+
"title": "X API SDK v0.2.5-beta",
2828
"description": "Python SDK for the X API with comprehensive pagination, authentication, and streaming support.",
29-
"version": "0.2.4-beta",
29+
"version": "0.2.5-beta",
3030
"githubUrl": "https://github.com/xdevplatform/xdk",
3131
}
3232

tests/account_activity/test_contracts.py

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

tests/account_activity/test_structure.py

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

3030

31-
def test_get_subscriptions_exists(self):
32-
"""Test that get_subscriptions method exists with correct signature."""
31+
def test_create_replay_job_exists(self):
32+
"""Test that create_replay_job method exists with correct signature."""
3333
# Check method exists
34-
method = getattr(AccountActivityClient, "get_subscriptions", None)
34+
method = getattr(AccountActivityClient, "create_replay_job", None)
3535
assert (
3636
method is not None
37-
), f"Method get_subscriptions does not exist on AccountActivityClient"
37+
), f"Method create_replay_job does not exist on AccountActivityClient"
3838
# Check method is callable
39-
assert callable(method), f"get_subscriptions is not callable"
39+
assert callable(method), f"create_replay_job is not callable"
4040
# Check method signature
4141
sig = inspect.signature(method)
4242
params = list(sig.parameters.keys())
4343
# Should have 'self' as first parameter
4444
assert (
4545
len(params) >= 1
46-
), f"get_subscriptions should have at least 'self' parameter"
46+
), f"create_replay_job should have at least 'self' parameter"
4747
assert (
4848
params[0] == "self"
4949
), f"First parameter should be 'self', got '{params[0]}'"
5050
# Check required parameters exist (excluding 'self')
5151
required_params = [
5252
"webhook_id",
53+
"from_date",
54+
"to_date",
5355
]
5456
for required_param in required_params:
5557
assert (
5658
required_param in params
57-
), f"Required parameter '{required_param}' missing from get_subscriptions"
59+
), f"Required parameter '{required_param}' missing from create_replay_job"
5860
# Check optional parameters have defaults (excluding 'self')
5961
optional_params = []
6062
for optional_param in optional_params:
@@ -65,45 +67,43 @@ def test_get_subscriptions_exists(self):
6567
), f"Optional parameter '{optional_param}' should have a default value"
6668

6769

68-
def test_get_subscriptions_return_annotation(self):
69-
"""Test that get_subscriptions has proper return type annotation."""
70-
method = getattr(AccountActivityClient, "get_subscriptions")
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")
7173
sig = inspect.signature(method)
7274
# Check return annotation exists
7375
assert (
7476
sig.return_annotation is not inspect.Signature.empty
75-
), f"Method get_subscriptions should have return type annotation"
77+
), f"Method create_replay_job should have return type annotation"
7678

7779

78-
def test_create_replay_job_exists(self):
79-
"""Test that create_replay_job method exists with correct signature."""
80+
def test_validate_subscription_exists(self):
81+
"""Test that validate_subscription method exists with correct signature."""
8082
# Check method exists
81-
method = getattr(AccountActivityClient, "create_replay_job", None)
83+
method = getattr(AccountActivityClient, "validate_subscription", None)
8284
assert (
8385
method is not None
84-
), f"Method create_replay_job does not exist on AccountActivityClient"
86+
), f"Method validate_subscription does not exist on AccountActivityClient"
8587
# Check method is callable
86-
assert callable(method), f"create_replay_job is not callable"
88+
assert callable(method), f"validate_subscription is not callable"
8789
# Check method signature
8890
sig = inspect.signature(method)
8991
params = list(sig.parameters.keys())
9092
# Should have 'self' as first parameter
9193
assert (
9294
len(params) >= 1
93-
), f"create_replay_job should have at least 'self' parameter"
95+
), f"validate_subscription should have at least 'self' parameter"
9496
assert (
9597
params[0] == "self"
9698
), f"First parameter should be 'self', got '{params[0]}'"
9799
# Check required parameters exist (excluding 'self')
98100
required_params = [
99101
"webhook_id",
100-
"from_date",
101-
"to_date",
102102
]
103103
for required_param in required_params:
104104
assert (
105105
required_param in params
106-
), f"Required parameter '{required_param}' missing from create_replay_job"
106+
), f"Required parameter '{required_param}' missing from validate_subscription"
107107
# Check optional parameters have defaults (excluding 'self')
108108
optional_params = []
109109
for optional_param in optional_params:
@@ -114,32 +114,32 @@ def test_create_replay_job_exists(self):
114114
), f"Optional parameter '{optional_param}' should have a default value"
115115

116116

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")
117+
def test_validate_subscription_return_annotation(self):
118+
"""Test that validate_subscription has proper return type annotation."""
119+
method = getattr(AccountActivityClient, "validate_subscription")
120120
sig = inspect.signature(method)
121121
# Check return annotation exists
122122
assert (
123123
sig.return_annotation is not inspect.Signature.empty
124-
), f"Method create_replay_job should have return type annotation"
124+
), f"Method validate_subscription should have return type annotation"
125125

126126

127-
def test_validate_subscription_exists(self):
128-
"""Test that validate_subscription method exists with correct signature."""
127+
def test_create_subscription_exists(self):
128+
"""Test that create_subscription method exists with correct signature."""
129129
# Check method exists
130-
method = getattr(AccountActivityClient, "validate_subscription", None)
130+
method = getattr(AccountActivityClient, "create_subscription", None)
131131
assert (
132132
method is not None
133-
), f"Method validate_subscription does not exist on AccountActivityClient"
133+
), f"Method create_subscription does not exist on AccountActivityClient"
134134
# Check method is callable
135-
assert callable(method), f"validate_subscription is not callable"
135+
assert callable(method), f"create_subscription is not callable"
136136
# Check method signature
137137
sig = inspect.signature(method)
138138
params = list(sig.parameters.keys())
139139
# Should have 'self' as first parameter
140140
assert (
141141
len(params) >= 1
142-
), f"validate_subscription should have at least 'self' parameter"
142+
), f"create_subscription should have at least 'self' parameter"
143143
assert (
144144
params[0] == "self"
145145
), f"First parameter should be 'self', got '{params[0]}'"
@@ -150,7 +150,7 @@ def test_validate_subscription_exists(self):
150150
for required_param in required_params:
151151
assert (
152152
required_param in params
153-
), f"Required parameter '{required_param}' missing from validate_subscription"
153+
), f"Required parameter '{required_param}' missing from create_subscription"
154154
# Check optional parameters have defaults (excluding 'self')
155155
optional_params = []
156156
for optional_param in optional_params:
@@ -161,43 +161,44 @@ def test_validate_subscription_exists(self):
161161
), f"Optional parameter '{optional_param}' should have a default value"
162162

163163

164-
def test_validate_subscription_return_annotation(self):
165-
"""Test that validate_subscription has proper return type annotation."""
166-
method = getattr(AccountActivityClient, "validate_subscription")
164+
def test_create_subscription_return_annotation(self):
165+
"""Test that create_subscription has proper return type annotation."""
166+
method = getattr(AccountActivityClient, "create_subscription")
167167
sig = inspect.signature(method)
168168
# Check return annotation exists
169169
assert (
170170
sig.return_annotation is not inspect.Signature.empty
171-
), f"Method validate_subscription should have return type annotation"
171+
), f"Method create_subscription should have return type annotation"
172172

173173

174-
def test_create_subscription_exists(self):
175-
"""Test that create_subscription method exists with correct signature."""
174+
def test_delete_subscription_exists(self):
175+
"""Test that delete_subscription method exists with correct signature."""
176176
# Check method exists
177-
method = getattr(AccountActivityClient, "create_subscription", None)
177+
method = getattr(AccountActivityClient, "delete_subscription", None)
178178
assert (
179179
method is not None
180-
), f"Method create_subscription does not exist on AccountActivityClient"
180+
), f"Method delete_subscription does not exist on AccountActivityClient"
181181
# Check method is callable
182-
assert callable(method), f"create_subscription is not callable"
182+
assert callable(method), f"delete_subscription is not callable"
183183
# Check method signature
184184
sig = inspect.signature(method)
185185
params = list(sig.parameters.keys())
186186
# Should have 'self' as first parameter
187187
assert (
188188
len(params) >= 1
189-
), f"create_subscription should have at least 'self' parameter"
189+
), f"delete_subscription should have at least 'self' parameter"
190190
assert (
191191
params[0] == "self"
192192
), f"First parameter should be 'self', got '{params[0]}'"
193193
# Check required parameters exist (excluding 'self')
194194
required_params = [
195195
"webhook_id",
196+
"user_id",
196197
]
197198
for required_param in required_params:
198199
assert (
199200
required_param in params
200-
), f"Required parameter '{required_param}' missing from create_subscription"
201+
), f"Required parameter '{required_param}' missing from delete_subscription"
201202
# Check optional parameters have defaults (excluding 'self')
202203
optional_params = []
203204
for optional_param in optional_params:
@@ -208,14 +209,14 @@ def test_create_subscription_exists(self):
208209
), f"Optional parameter '{optional_param}' should have a default value"
209210

210211

211-
def test_create_subscription_return_annotation(self):
212-
"""Test that create_subscription has proper return type annotation."""
213-
method = getattr(AccountActivityClient, "create_subscription")
212+
def test_delete_subscription_return_annotation(self):
213+
"""Test that delete_subscription has proper return type annotation."""
214+
method = getattr(AccountActivityClient, "delete_subscription")
214215
sig = inspect.signature(method)
215216
# Check return annotation exists
216217
assert (
217218
sig.return_annotation is not inspect.Signature.empty
218-
), f"Method create_subscription should have return type annotation"
219+
), f"Method delete_subscription should have return type annotation"
219220

220221

221222
def test_get_subscription_count_exists(self):
@@ -263,34 +264,33 @@ def test_get_subscription_count_return_annotation(self):
263264
), f"Method get_subscription_count should have return type annotation"
264265

265266

266-
def test_delete_subscription_exists(self):
267-
"""Test that delete_subscription method exists with correct signature."""
267+
def test_get_subscriptions_exists(self):
268+
"""Test that get_subscriptions method exists with correct signature."""
268269
# Check method exists
269-
method = getattr(AccountActivityClient, "delete_subscription", None)
270+
method = getattr(AccountActivityClient, "get_subscriptions", None)
270271
assert (
271272
method is not None
272-
), f"Method delete_subscription does not exist on AccountActivityClient"
273+
), f"Method get_subscriptions does not exist on AccountActivityClient"
273274
# Check method is callable
274-
assert callable(method), f"delete_subscription is not callable"
275+
assert callable(method), f"get_subscriptions is not callable"
275276
# Check method signature
276277
sig = inspect.signature(method)
277278
params = list(sig.parameters.keys())
278279
# Should have 'self' as first parameter
279280
assert (
280281
len(params) >= 1
281-
), f"delete_subscription should have at least 'self' parameter"
282+
), f"get_subscriptions should have at least 'self' parameter"
282283
assert (
283284
params[0] == "self"
284285
), f"First parameter should be 'self', got '{params[0]}'"
285286
# Check required parameters exist (excluding 'self')
286287
required_params = [
287288
"webhook_id",
288-
"user_id",
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 get_subscriptions"
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_get_subscriptions_return_annotation(self):
305+
"""Test that get_subscriptions has proper return type annotation."""
306+
method = getattr(AccountActivityClient, "get_subscriptions")
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 get_subscriptions 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-
"get_subscriptions",
318317
"create_replay_job",
319318
"validate_subscription",
320319
"create_subscription",
321-
"get_subscription_count",
322320
"delete_subscription",
321+
"get_subscription_count",
322+
"get_subscriptions",
323323
]
324324
for expected_method in expected_methods:
325325
assert hasattr(

0 commit comments

Comments
 (0)