From 4826714e338eff384d9e96dce387101c2cb73614 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 18 Jan 2024 12:14:44 -0500 Subject: [PATCH] Add get_connection_string method to Branch class --- neon_client/client.py | 13 +++++++++++++ neon_client2/resources.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/neon_client/client.py b/neon_client/client.py index f9a4559..1edd736 100644 --- a/neon_client/client.py +++ b/neon_client/client.py @@ -234,6 +234,19 @@ class Branch(NeonResource): return cls(client=client, obj=r, data_model=schema.BranchResponse) + # @classmethod + # def get_connection_string(cls, client, project_id: str, branch_id: str): + # """Get a connection string for a branch.""" + + # # Construct the request path. + # r_path = client.url_join("projects", project_id, "branches", branch_id, "connection_string") + + # # Make the request. + # obj = client.request("GET", r_path, response_model=schema.BranchConnectionStringResponse) + + # # Deserialize the response. + # return obj.connection_string + class Operation(NeonResource): @classmethod diff --git a/neon_client2/resources.py b/neon_client2/resources.py index fbd08c4..1fe405e 100644 --- a/neon_client2/resources.py +++ b/neon_client2/resources.py @@ -85,7 +85,7 @@ class ProjectResource(Resource): *, cursor: int | None = None, limit: int | None = None, - shared: bool = False + shared: bool = False, ): """Get a list of projects."""