From 8d67d3cf7b00b9f892782ff9fce4d7efe87381b3 Mon Sep 17 00:00:00 2001 From: Jonxslays <51417989+Jonxslays@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:15:28 -0700 Subject: [PATCH] Update error codes to match changes in the unkey API (#5) * Update error code enum * Bump project version * Update changelog --- CHANGELOG.md | 10 ++++++++++ pyproject.toml | 2 +- unkey/__init__.py | 2 +- unkey/models/http.py | 4 +++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71f0e0d..f3b2d1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## v0.4.3 (Sep 2023) + +### Additions + +- Add `NotUnique` and `InvalidKeyType` variants to `ErrorCode`. + +### Changes + +- Rename `UsageExceeded` error code to `KeyUsageExceeded`. + ## v0.4.2 (Aug 2023) ### Additions diff --git a/pyproject.toml b/pyproject.toml index f493c8c..a54b581 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "unkey.py" -version = "0.4.2" +version = "0.4.3" description = "An asynchronous Python SDK for unkey.dev." authors = ["Jonxslays"] license = "GPL-3.0-only" diff --git a/unkey/__init__.py b/unkey/__init__.py index 46cd697..cae05d7 100644 --- a/unkey/__init__.py +++ b/unkey/__init__.py @@ -3,7 +3,7 @@ from typing import Final __packagename__: Final[str] = "unkey.py" -__version__: Final[str] = "0.4.2" +__version__: Final[str] = "0.4.3" __author__: Final[str] = "Jonxslays" __copyright__: Final[str] = "2023-present Jonxslays" __description__: Final[str] = "An asynchronous Python SDK for unkey.dev." diff --git a/unkey/models/http.py b/unkey/models/http.py index 6ae557f..43a2a9d 100644 --- a/unkey/models/http.py +++ b/unkey/models/http.py @@ -17,7 +17,9 @@ class ErrorCode(BaseEnum): InternalServerError = "INTERNAL_SERVER_ERROR" Ratelimited = "RATELIMITED" Forbidden = "FORBIDDEN" - UsageExceeded = "USAGE_EXCEEDED" + KeyUsageExceeded = "KEY_USAGE_EXCEEDED" + InvalidKeyType = "INVALID_KEY_TYPE" + NotUnique = "NOT_UNIQUE" Unknown = "UNKNOWN"