diff --git a/README.md b/README.md index ade67e0..5883aba 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ export OUTPOST_API_TOKEN= import outpostkit print(outpostkit.__version__) ``` -`0.0.59` +`0.0.60` ## Create a client diff --git a/outpostkit/__init__.py b/outpostkit/__init__.py index 87c2982..fdb6610 100644 --- a/outpostkit/__init__.py +++ b/outpostkit/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.0.59" +__version__ = "0.0.60" from outpostkit.client import Client as Client from outpostkit.endpoints import Endpoint as Endpoint from outpostkit.endpoints import Endpoints as Endpoints diff --git a/outpostkit/client.py b/outpostkit/client.py index 1a27b19..b0499a0 100644 --- a/outpostkit/client.py +++ b/outpostkit/client.py @@ -225,7 +225,7 @@ def _build_httpx_client( **kwargs, ) -> Union[httpx.Client, httpx.AsyncClient]: headers = { - "User-Agent": "outpost-python/0.0.59", + "User-Agent": "outpost-python/0.0.60", } if ( diff --git a/outpostkit/endpoints.py b/outpostkit/endpoints.py index 6d6f586..a09775e 100644 --- a/outpostkit/endpoints.py +++ b/outpostkit/endpoints.py @@ -47,10 +47,26 @@ class EndpointDeployResponse: class Endpoint(Namespace): - def __init__(self, client: Client, entity: str, name: str) -> None: - self.entity = entity - self.name = name - self.fullName = f"{entity}/{name}" + def __init__( + self, + client: Client, + entity: Optional[str], + name: Optional[str], + full_name: Optional[str] = None, + ) -> None: + if name and entity: + self.entity = entity + self.name = name + self.fullName = f"{entity}/{name}" + if full_name: + _split = full_name.split("/", 1) + assert len(_split) == 2, "Invalid Full Name" + self.entity = _split[0] + self.name = _split[1] + self.fullName = self.fullName + else: + raise OutpostError("Please provide identifiable information.") + super().__init__(client) def get(self) -> EndpointResource: diff --git a/pyproject.toml b/pyproject.toml index e24a8c8..b6c6703 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "outpostkit" -version = "0.0.59" +version = "0.0.60" description = "Python client for Outpost" readme = "README.md" license = { file = "LICENSE" }