Skip to content

Commit 0af2417

Browse files
committed
Forgot these changes
1 parent af40d81 commit 0af2417

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/contiguity/base/async_base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from typing_extensions import deprecated
1414

1515
from contiguity._auth import get_data_key, get_project_id
16-
from contiguity._client import ApiError, AsyncApiClient
16+
from contiguity._client import ContiguityApiError, AsyncApiClient
1717

1818
from .common import (
1919
UNSET,
@@ -127,7 +127,7 @@ def _response_as_item_type(
127127
try:
128128
response.raise_for_status()
129129
except HTTPStatusError as exc:
130-
raise ApiError(exc.response.text) from exc
130+
raise ContiguityApiError(exc.response.text) from exc
131131
if self.item_type:
132132
return msgspec.json.decode(response.content, type=Sequence[self.item_type] if sequence else self.item_type)
133133
return response.json(cls=self.json_decoder)
@@ -194,7 +194,7 @@ async def delete(self: Self, key: str, /) -> None:
194194
try:
195195
response.raise_for_status()
196196
except HTTPStatusError as exc:
197-
raise ApiError(exc.response.text) from exc
197+
raise ContiguityApiError(exc.response.text) from exc
198198

199199
async def insert(
200200
self: Self,
@@ -212,7 +212,7 @@ async def insert(
212212

213213
if not (returned_item := self._response_as_item_type(response, sequence=True)):
214214
msg = "expected a single item, got an empty response"
215-
raise ApiError(msg)
215+
raise ContiguityApiError(msg)
216216
return returned_item[0]
217217

218218
async def put(
@@ -299,7 +299,7 @@ async def query(
299299
try:
300300
response.raise_for_status()
301301
except HTTPStatusError as exc:
302-
raise ApiError(exc.response.text) from exc
302+
raise ContiguityApiError(exc.response.text) from exc
303303
return msgspec.json.decode(response.content, type=QueryResponse[ItemT])
304304

305305
# query_response = QueryResponse[ItemT].model_validate_json(response.content)

src/contiguity/base/base.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from typing_extensions import deprecated
2323

2424
from contiguity._auth import get_data_key, get_project_id
25-
from contiguity._client import ApiClient, ApiError
25+
from contiguity._client import ApiClient, ContiguityApiError
2626

2727
from .common import (
2828
UNSET,
@@ -136,7 +136,7 @@ def _response_as_item_type(
136136
try:
137137
response.raise_for_status()
138138
except HTTPStatusError as exc:
139-
raise ApiError(exc.response.text) from exc
139+
raise ContiguityApiError(exc.response.text) from exc
140140
if self.item_type:
141141
return msgspec.json.decode(response.content, type=Sequence[self.item_type] if sequence else self.item_type)
142142
return response.json(cls=self.json_decoder)
@@ -203,7 +203,7 @@ def delete(self: Self, key: str, /) -> None:
203203
try:
204204
response.raise_for_status()
205205
except HTTPStatusError as exc:
206-
raise ApiError(exc.response.text) from exc
206+
raise ContiguityApiError(exc.response.text) from exc
207207

208208
def insert(
209209
self: Self,
@@ -221,7 +221,7 @@ def insert(
221221

222222
if not (returned_item := self._response_as_item_type(response, sequence=True)):
223223
msg = "expected a single item, got an empty response"
224-
raise ApiError(msg)
224+
raise ContiguityApiError(msg)
225225
return returned_item[0]
226226

227227
def put(
@@ -308,7 +308,7 @@ def query(
308308
try:
309309
response.raise_for_status()
310310
except HTTPStatusError as exc:
311-
raise ApiError(exc.response.text) from exc
311+
raise ContiguityApiError(exc.response.text) from exc
312312
return msgspec.json.decode(response.content, type=QueryResponse[ItemT])
313313

314314
# query_response = QueryResponse[ItemT].model_validate_json(response.content)

src/contiguity/base/exceptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from contiguity._client import ApiError
1+
from contiguity._client import ContiguityApiError
22

33

4-
class ItemConflictError(ApiError):
4+
class ItemConflictError(ContiguityApiError):
55
def __init__(self, key: str, *args: object) -> None:
66
super().__init__(f"item with key '{key}' already exists", *args)
77

88

9-
class ItemNotFoundError(ApiError):
9+
class ItemNotFoundError(ContiguityApiError):
1010
def __init__(self, key: str, *args: object) -> None:
1111
super().__init__(f"key '{key}' not found", *args)
1212

src/contiguity/domains.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import logging
22
from collections.abc import Sequence
33

4-
import msgspec
4+
from msgspec import Struct
55

66
from ._product import BaseProduct
77
from ._response import BaseResponse, decode_response
88

99
logger = logging.getLogger(__name__)
1010

1111

12-
class PartialDomain(msgspec.Struct):
12+
class PartialDomain(Struct):
1313
domain: str
1414
status: str
1515
id: str
@@ -18,14 +18,14 @@ class PartialDomain(msgspec.Struct):
1818
sending_allowed: bool
1919

2020

21-
class DnsRecord(msgspec.Struct):
21+
class DnsRecord(Struct):
2222
type: str
2323
name: str
2424
value: str
2525
purpose: str
2626

2727

28-
class DomainVerifications(msgspec.Struct):
28+
class DomainVerifications(Struct):
2929
dkim: str
3030
mail_from: str
3131
domain: str

0 commit comments

Comments
 (0)