Skip to content

Commit b74a94c

Browse files
chore: update SDK to v0.4.5
1 parent d777564 commit b74a94c

Some content is hidden

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

67 files changed

+10644
-14919
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.4"
25-
version = "0.4.4"
24+
release = "0.4.5"
25+
version = "0.4.5"
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.4"
17+
version = "0.4.5"
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.4",
27+
"title": "X API SDK v0.4.5",
2828
"description": "Python SDK for the X API with comprehensive pagination, authentication, and streaming support.",
29-
"version": "0.4.4",
29+
"version": "0.4.5",
3030
"githubUrl": "https://github.com/xdevplatform/xdk",
3131
}
3232

tests/account_activity/test_contracts.py

Lines changed: 105 additions & 105 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
@@ -28,22 +28,22 @@ def setup_class(self):
2828
self.account_activity_client = getattr(self.client, "account_activity")
2929

3030

31-
def test_validate_subscription_exists(self):
32-
"""Test that validate_subscription method exists with correct signature."""
31+
def test_get_subscriptions_exists(self):
32+
"""Test that get_subscriptions method exists with correct signature."""
3333
# Check method exists
34-
method = getattr(AccountActivityClient, "validate_subscription", None)
34+
method = getattr(AccountActivityClient, "get_subscriptions", None)
3535
assert (
3636
method is not None
37-
), f"Method validate_subscription does not exist on AccountActivityClient"
37+
), f"Method get_subscriptions does not exist on AccountActivityClient"
3838
# Check method is callable
39-
assert callable(method), f"validate_subscription is not callable"
39+
assert callable(method), f"get_subscriptions 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"validate_subscription should have at least 'self' parameter"
46+
), f"get_subscriptions should have at least 'self' parameter"
4747
assert (
4848
params[0] == "self"
4949
), f"First parameter should be 'self', got '{params[0]}'"
@@ -54,7 +54,7 @@ def test_validate_subscription_exists(self):
5454
for required_param in required_params:
5555
assert (
5656
required_param in params
57-
), f"Required parameter '{required_param}' missing from validate_subscription"
57+
), f"Required parameter '{required_param}' missing from get_subscriptions"
5858
# Check optional parameters have defaults (excluding 'self')
5959
optional_params = []
6060
for optional_param in optional_params:
@@ -65,43 +65,45 @@ def test_validate_subscription_exists(self):
6565
), f"Optional parameter '{optional_param}' should have a default value"
6666

6767

68-
def test_validate_subscription_return_annotation(self):
69-
"""Test that validate_subscription has proper return type annotation."""
70-
method = getattr(AccountActivityClient, "validate_subscription")
68+
def test_get_subscriptions_return_annotation(self):
69+
"""Test that get_subscriptions has proper return type annotation."""
70+
method = getattr(AccountActivityClient, "get_subscriptions")
7171
sig = inspect.signature(method)
7272
# Check return annotation exists
7373
assert (
7474
sig.return_annotation is not inspect.Signature.empty
75-
), f"Method validate_subscription should have return type annotation"
75+
), f"Method get_subscriptions should have return type annotation"
7676

7777

78-
def test_create_subscription_exists(self):
79-
"""Test that create_subscription method exists with correct signature."""
78+
def test_create_replay_job_exists(self):
79+
"""Test that create_replay_job method exists with correct signature."""
8080
# Check method exists
81-
method = getattr(AccountActivityClient, "create_subscription", None)
81+
method = getattr(AccountActivityClient, "create_replay_job", None)
8282
assert (
8383
method is not None
84-
), f"Method create_subscription does not exist on AccountActivityClient"
84+
), f"Method create_replay_job does not exist on AccountActivityClient"
8585
# Check method is callable
86-
assert callable(method), f"create_subscription is not callable"
86+
assert callable(method), f"create_replay_job 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_subscription should have at least 'self' parameter"
93+
), f"create_replay_job 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",
100102
]
101103
for required_param in required_params:
102104
assert (
103105
required_param in params
104-
), f"Required parameter '{required_param}' missing from create_subscription"
106+
), f"Required parameter '{required_param}' missing from create_replay_job"
105107
# Check optional parameters have defaults (excluding 'self')
106108
optional_params = []
107109
for optional_param in optional_params:
@@ -112,45 +114,41 @@ def test_create_subscription_exists(self):
112114
), f"Optional parameter '{optional_param}' should have a default value"
113115

114116

115-
def test_create_subscription_return_annotation(self):
116-
"""Test that create_subscription has proper return type annotation."""
117-
method = getattr(AccountActivityClient, "create_subscription")
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")
118120
sig = inspect.signature(method)
119121
# Check return annotation exists
120122
assert (
121123
sig.return_annotation is not inspect.Signature.empty
122-
), f"Method create_subscription should have return type annotation"
124+
), f"Method create_replay_job should have return type annotation"
123125

124126

125-
def test_create_replay_job_exists(self):
126-
"""Test that create_replay_job method exists with correct signature."""
127+
def test_get_subscription_count_exists(self):
128+
"""Test that get_subscription_count method exists with correct signature."""
127129
# Check method exists
128-
method = getattr(AccountActivityClient, "create_replay_job", None)
130+
method = getattr(AccountActivityClient, "get_subscription_count", None)
129131
assert (
130132
method is not None
131-
), f"Method create_replay_job does not exist on AccountActivityClient"
133+
), f"Method get_subscription_count does not exist on AccountActivityClient"
132134
# Check method is callable
133-
assert callable(method), f"create_replay_job is not callable"
135+
assert callable(method), f"get_subscription_count is not callable"
134136
# Check method signature
135137
sig = inspect.signature(method)
136138
params = list(sig.parameters.keys())
137139
# Should have 'self' as first parameter
138140
assert (
139141
len(params) >= 1
140-
), f"create_replay_job should have at least 'self' parameter"
142+
), f"get_subscription_count should have at least 'self' parameter"
141143
assert (
142144
params[0] == "self"
143145
), f"First parameter should be 'self', got '{params[0]}'"
144146
# Check required parameters exist (excluding 'self')
145-
required_params = [
146-
"webhook_id",
147-
"from_date",
148-
"to_date",
149-
]
147+
required_params = []
150148
for required_param in required_params:
151149
assert (
152150
required_param in params
153-
), f"Required parameter '{required_param}' missing from create_replay_job"
151+
), f"Required parameter '{required_param}' missing from get_subscription_count"
154152
# Check optional parameters have defaults (excluding 'self')
155153
optional_params = []
156154
for optional_param in optional_params:
@@ -161,32 +159,32 @@ def test_create_replay_job_exists(self):
161159
), f"Optional parameter '{optional_param}' should have a default value"
162160

163161

164-
def test_create_replay_job_return_annotation(self):
165-
"""Test that create_replay_job has proper return type annotation."""
166-
method = getattr(AccountActivityClient, "create_replay_job")
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")
167165
sig = inspect.signature(method)
168166
# Check return annotation exists
169167
assert (
170168
sig.return_annotation is not inspect.Signature.empty
171-
), f"Method create_replay_job should have return type annotation"
169+
), f"Method get_subscription_count should have return type annotation"
172170

173171

174-
def test_get_subscriptions_exists(self):
175-
"""Test that get_subscriptions method exists with correct signature."""
172+
def test_validate_subscription_exists(self):
173+
"""Test that validate_subscription method exists with correct signature."""
176174
# Check method exists
177-
method = getattr(AccountActivityClient, "get_subscriptions", None)
175+
method = getattr(AccountActivityClient, "validate_subscription", None)
178176
assert (
179177
method is not None
180-
), f"Method get_subscriptions does not exist on AccountActivityClient"
178+
), f"Method validate_subscription does not exist on AccountActivityClient"
181179
# Check method is callable
182-
assert callable(method), f"get_subscriptions is not callable"
180+
assert callable(method), f"validate_subscription is not callable"
183181
# Check method signature
184182
sig = inspect.signature(method)
185183
params = list(sig.parameters.keys())
186184
# Should have 'self' as first parameter
187185
assert (
188186
len(params) >= 1
189-
), f"get_subscriptions should have at least 'self' parameter"
187+
), f"validate_subscription should have at least 'self' parameter"
190188
assert (
191189
params[0] == "self"
192190
), f"First parameter should be 'self', got '{params[0]}'"
@@ -197,7 +195,7 @@ def test_get_subscriptions_exists(self):
197195
for required_param in required_params:
198196
assert (
199197
required_param in params
200-
), f"Required parameter '{required_param}' missing from get_subscriptions"
198+
), f"Required parameter '{required_param}' missing from validate_subscription"
201199
# Check optional parameters have defaults (excluding 'self')
202200
optional_params = []
203201
for optional_param in optional_params:
@@ -208,41 +206,43 @@ def test_get_subscriptions_exists(self):
208206
), f"Optional parameter '{optional_param}' should have a default value"
209207

210208

211-
def test_get_subscriptions_return_annotation(self):
212-
"""Test that get_subscriptions has proper return type annotation."""
213-
method = getattr(AccountActivityClient, "get_subscriptions")
209+
def test_validate_subscription_return_annotation(self):
210+
"""Test that validate_subscription has proper return type annotation."""
211+
method = getattr(AccountActivityClient, "validate_subscription")
214212
sig = inspect.signature(method)
215213
# Check return annotation exists
216214
assert (
217215
sig.return_annotation is not inspect.Signature.empty
218-
), f"Method get_subscriptions should have return type annotation"
216+
), f"Method validate_subscription should have return type annotation"
219217

220218

221-
def test_get_subscription_count_exists(self):
222-
"""Test that get_subscription_count method exists with correct signature."""
219+
def test_create_subscription_exists(self):
220+
"""Test that create_subscription method exists with correct signature."""
223221
# Check method exists
224-
method = getattr(AccountActivityClient, "get_subscription_count", None)
222+
method = getattr(AccountActivityClient, "create_subscription", None)
225223
assert (
226224
method is not None
227-
), f"Method get_subscription_count does not exist on AccountActivityClient"
225+
), f"Method create_subscription does not exist on AccountActivityClient"
228226
# Check method is callable
229-
assert callable(method), f"get_subscription_count is not callable"
227+
assert callable(method), f"create_subscription is not callable"
230228
# Check method signature
231229
sig = inspect.signature(method)
232230
params = list(sig.parameters.keys())
233231
# Should have 'self' as first parameter
234232
assert (
235233
len(params) >= 1
236-
), f"get_subscription_count should have at least 'self' parameter"
234+
), f"create_subscription should have at least 'self' parameter"
237235
assert (
238236
params[0] == "self"
239237
), f"First parameter should be 'self', got '{params[0]}'"
240238
# Check required parameters exist (excluding 'self')
241-
required_params = []
239+
required_params = [
240+
"webhook_id",
241+
]
242242
for required_param in required_params:
243243
assert (
244244
required_param in params
245-
), f"Required parameter '{required_param}' missing from get_subscription_count"
245+
), f"Required parameter '{required_param}' missing from create_subscription"
246246
# Check optional parameters have defaults (excluding 'self')
247247
optional_params = []
248248
for optional_param in optional_params:
@@ -253,14 +253,14 @@ def test_get_subscription_count_exists(self):
253253
), f"Optional parameter '{optional_param}' should have a default value"
254254

255255

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")
256+
def test_create_subscription_return_annotation(self):
257+
"""Test that create_subscription has proper return type annotation."""
258+
method = getattr(AccountActivityClient, "create_subscription")
259259
sig = inspect.signature(method)
260260
# Check return annotation exists
261261
assert (
262262
sig.return_annotation is not inspect.Signature.empty
263-
), f"Method get_subscription_count should have return type annotation"
263+
), f"Method create_subscription should have return type annotation"
264264

265265

266266
def test_delete_subscription_exists(self):
@@ -314,11 +314,11 @@ def test_delete_subscription_return_annotation(self):
314314
def test_all_expected_methods_exist(self):
315315
"""Test that all expected methods exist on the client."""
316316
expected_methods = [
317-
"validate_subscription",
318-
"create_subscription",
319-
"create_replay_job",
320317
"get_subscriptions",
318+
"create_replay_job",
321319
"get_subscription_count",
320+
"validate_subscription",
321+
"create_subscription",
322322
"delete_subscription",
323323
]
324324
for expected_method in expected_methods:

0 commit comments

Comments
 (0)