Skip to content

Commit 5c6b536

Browse files
authored
chore: Prefix v2 in the endpoint methods. (#5)
1 parent 63ba2e4 commit 5c6b536

6 files changed

Lines changed: 399 additions & 377 deletions

File tree

autogen.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def _collect_handler_routes(resources: dict[str, Resource]) -> dict[str, list[tu
628628
for endpoint in resource.endpoints:
629629
if endpoint.response_handler:
630630
handler_routes.setdefault(endpoint.response_handler, []).append(
631-
(endpoint.method, endpoint.path)
631+
(endpoint.method, "/v2" + endpoint.path)
632632
)
633633
return handler_routes
634634

@@ -643,7 +643,7 @@ def _collect_boolean_status_prefixes(resources: dict[str, Resource]) -> list[tup
643643
for resource in resources.values():
644644
for endpoint in resource.endpoints:
645645
if endpoint.boolean_status:
646-
prefix = endpoint.path.split("{")[0]
646+
prefix = ("/v2" + endpoint.path).split("{")[0]
647647
result.append((endpoint.method, prefix))
648648
return result
649649

@@ -883,7 +883,7 @@ def generate_sync_method(endpoint: Endpoint, method_name: str) -> list[str]:
883883
lines.append(' """')
884884

885885
# Build path with parameters (URL-encode each path arg)
886-
path = endpoint.path
886+
path = "/v2" + endpoint.path
887887
for pp in path_params:
888888
path = path.replace(f"{{{pp.name}}}", f"{{quote(str({pp.python_name}), safe='')}}")
889889

@@ -1163,7 +1163,7 @@ def generate_async_method(endpoint: Endpoint, method_name: str) -> list[str]:
11631163
lines.append(' """')
11641164

11651165
# Build path with parameters (URL-encode each path arg)
1166-
path = endpoint.path
1166+
path = "/v2" + endpoint.path
11671167
for pp in path_params:
11681168
path = path.replace(f"{{{pp.name}}}", f"{{quote(str({pp.python_name}), safe='')}}")
11691169

pyproject.toml

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

55
[project]
66
name = "vantage-python"
7-
version = "0.3.3"
7+
version = "0.4.0"
88
description = "Python SDK for the Vantage API"
99
readme = "README.md"
1010
license = "MIT"

0 commit comments

Comments
 (0)