Skip to content

Commit

Permalink
full name support
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-ya committed May 5, 2024
1 parent d13834f commit 2834bae
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export OUTPOST_API_TOKEN=<your token>
import outpostkit
print(outpostkit.__version__)
```
`0.0.59`
`0.0.60`


## Create a client
Expand Down
2 changes: 1 addition & 1 deletion outpostkit/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion outpostkit/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
24 changes: 20 additions & 4 deletions outpostkit/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit 2834bae

Please sign in to comment.