Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
print(f"Key id: {created_key['id']} and token: {created_key['token']}")

update_params: resend.ApiKeys.UpdateParams = {
"api_key_id": created_key["id"],
"id": created_key["id"],
"name": "renamed-example",
}
updated_key: resend.ApiKeys.UpdateApiKeyResponse = resend.ApiKeys.update(update_params)
Expand Down
2 changes: 1 addition & 1 deletion examples/async/api_keys_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def main() -> None:
print(f"Key id: {key['id']} and token: {key['token']}")

update_params: resend.ApiKeys.UpdateParams = {
"api_key_id": key["id"],
"id": key["id"],
"name": "renamed-example",
}
updated_key = await resend.ApiKeys.update_async(update_params)
Expand Down
10 changes: 5 additions & 5 deletions resend/api_keys/_api_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class CreateParams(TypedDict):
"""

class UpdateParams(TypedDict):
api_key_id: str
id: str
"""
The API key ID.
"""
Expand Down Expand Up @@ -169,13 +169,13 @@ def update(cls, params: UpdateParams) -> UpdateApiKeyResponse:

Args:
params (UpdateParams): The API key update parameters
- api_key_id: The API key ID
- id: The API key ID
- name: The new API key name

Returns:
UpdateApiKeyResponse: The updated API key response with id
"""
api_key_id = params["api_key_id"]
api_key_id = params["id"]
path = f"/api-keys/{api_key_id}"
resp = request.Request[ApiKeys.UpdateApiKeyResponse](
path=path, params={"name": params["name"]}, verb="patch"
Expand Down Expand Up @@ -249,13 +249,13 @@ async def update_async(cls, params: UpdateParams) -> UpdateApiKeyResponse:

Args:
params (UpdateParams): The API key update parameters
- api_key_id: The API key ID
- id: The API key ID
- name: The new API key name

Returns:
UpdateApiKeyResponse: The updated API key response with id
"""
api_key_id = params["api_key_id"]
api_key_id = params["id"]
path = f"/api-keys/{api_key_id}"
resp = await AsyncRequest[ApiKeys.UpdateApiKeyResponse](
path=path, params={"name": params["name"]}, verb="patch"
Expand Down
2 changes: 1 addition & 1 deletion resend/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.40.1"
__version__ = "2.40.2"


def get_version() -> str:
Expand Down
4 changes: 2 additions & 2 deletions tests/api_keys_async_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def test_api_keys_update_async(self) -> None:
)

params: resend.ApiKeys.UpdateParams = {
"api_key_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
"id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
"name": "updated-name",
}
updated_key: resend.ApiKeys.UpdateApiKeyResponse = (
Expand All @@ -83,7 +83,7 @@ async def test_should_update_api_key_async_raise_exception_when_no_content(
) -> None:
self.set_mock_json(None)
params: resend.ApiKeys.UpdateParams = {
"api_key_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
"id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
"name": "updated-name",
}
with pytest.raises(NoContentError):
Expand Down
4 changes: 2 additions & 2 deletions tests/api_keys_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_api_keys_update(self) -> None:
)

params: resend.ApiKeys.UpdateParams = {
"api_key_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
"id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
"name": "updated-name",
}
updated_key: resend.ApiKeys.UpdateApiKeyResponse = resend.ApiKeys.update(params)
Expand All @@ -146,7 +146,7 @@ def test_api_keys_update(self) -> None:
def test_should_update_api_key_raise_exception_when_no_content(self) -> None:
self.set_mock_json(None)
params: resend.ApiKeys.UpdateParams = {
"api_key_id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
"id": "4ef9a417-02e9-4d39-ad75-9611e0fcc33c",
"name": "updated-name",
}
with self.assertRaises(NoContentError):
Expand Down
Loading