From 72b62ac524c125c9e73bee4eb706afa46233dbe7 Mon Sep 17 00:00:00 2001 From: tdstein Date: Mon, 28 Oct 2024 12:38:03 -0400 Subject: [PATCH] minor cleanup --- src/posit/connect/vanities.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/posit/connect/vanities.py b/src/posit/connect/vanities.py index 833c8e29..dab794e1 100644 --- a/src/posit/connect/vanities.py +++ b/src/posit/connect/vanities.py @@ -70,7 +70,6 @@ def __init__( super().__init__(params, **kwargs) self._after_destroy = after_destroy self._content_guid = kwargs["content_guid"] - self.__endpoint = self.params.url + f"v1/content/{self._content_guid}/vanity" def destroy(self) -> None: """Destroy the vanity. @@ -88,7 +87,8 @@ def destroy(self) -> None: ---- This action requires administrator privileges. """ - self.params.session.delete(self.__endpoint) + endpoint = self.params.url + f"v1/content/{self._content_guid}/vanity" + self.params.session.delete(endpoint) if self._after_destroy: self._after_destroy() @@ -125,7 +125,6 @@ class HasGuid(TypedDict): def __init__(self, params: ResourceParameters, **kwargs: Unpack[HasGuid]): super().__init__(params, **kwargs) self._content_guid = kwargs["guid"] - self.__endpoint = self.params.url + f"v1/content/{self._content_guid}/vanity" self._vanity: Optional[Vanity] = None @property @@ -214,8 +213,8 @@ def create_vanity(self, **kwargs: Unpack[CreateVanityRequest]) -> Vanity: -------- If setting force=True, the destroy operation performed on the other vanity is irreversible. """ - print(self.__endpoint) - response = self.params.session.put(self.__endpoint, json=kwargs) + endpoint = self.params.url + f"v1/content/{self._content_guid}/vanity" + response = self.params.session.put(endpoint, json=kwargs) result = response.json() return Vanity(self.params, **result) @@ -226,7 +225,7 @@ def find_vanity(self) -> Vanity: ------- Vanity """ - print(self.__endpoint) - response = self.params.session.get(self.__endpoint) + endpoint = self.params.url + f"v1/content/{self._content_guid}/vanity" + response = self.params.session.get(endpoint) result = response.json() return Vanity(self.params, **result)