diff --git a/examples/api_keys.py b/examples/api_keys.py index 00af88a..9d33dde 100644 --- a/examples/api_keys.py +++ b/examples/api_keys.py @@ -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) diff --git a/examples/async/api_keys_async.py b/examples/async/api_keys_async.py index 5fffa08..733123a 100644 --- a/examples/async/api_keys_async.py +++ b/examples/async/api_keys_async.py @@ -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) diff --git a/resend/api_keys/_api_keys.py b/resend/api_keys/_api_keys.py index 79016cd..45b352d 100644 --- a/resend/api_keys/_api_keys.py +++ b/resend/api_keys/_api_keys.py @@ -134,7 +134,7 @@ class CreateParams(TypedDict): """ class UpdateParams(TypedDict): - api_key_id: str + id: str """ The API key ID. """ @@ -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" @@ -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" diff --git a/resend/version.py b/resend/version.py index 745af6a..4de567f 100644 --- a/resend/version.py +++ b/resend/version.py @@ -1,4 +1,4 @@ -__version__ = "2.40.1" +__version__ = "2.40.2" def get_version() -> str: diff --git a/tests/api_keys_async_test.py b/tests/api_keys_async_test.py index 0924c67..85bc7c2 100644 --- a/tests/api_keys_async_test.py +++ b/tests/api_keys_async_test.py @@ -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 = ( @@ -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): diff --git a/tests/api_keys_test.py b/tests/api_keys_test.py index 988f4b9..f91ad82 100644 --- a/tests/api_keys_test.py +++ b/tests/api_keys_test.py @@ -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) @@ -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):