File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from typing import Optional
2+
13from typing_extensions import TypedDict
24
35
@@ -14,3 +16,7 @@ class ApiKey(TypedDict):
1416 """
1517 The API key creation date
1618 """
19+ last_used_at : Optional [str ]
20+ """
21+ The date and time the API key was last used, or None if never used
22+ """
Original file line number Diff line number Diff line change 1- __version__ = "2.23 .0"
1+ __version__ = "2.24 .0"
22
33
44def get_version () -> str :
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ def test_api_keys_list(self) -> None:
3838 "id" : "91f3200a-df72-4654-b0cd-f202395f5354" ,
3939 "name" : "Production" ,
4040 "created_at" : "2023-04-08T00:11:13.110779+00:00" ,
41+ "last_used_at" : "2023-04-08T12:00:00.000000+00:00" ,
4142 }
4243 ],
4344 }
@@ -50,6 +51,26 @@ def test_api_keys_list(self) -> None:
5051 assert key ["id" ] == "91f3200a-df72-4654-b0cd-f202395f5354"
5152 assert key ["name" ] == "Production"
5253 assert key ["created_at" ] == "2023-04-08T00:11:13.110779+00:00"
54+ assert key ["last_used_at" ] == "2023-04-08T12:00:00.000000+00:00"
55+
56+ def test_api_keys_list_last_used_at_none (self ) -> None :
57+ self .set_mock_json (
58+ {
59+ "object" : "list" ,
60+ "has_more" : False ,
61+ "data" : [
62+ {
63+ "id" : "91f3200a-df72-4654-b0cd-f202395f5354" ,
64+ "name" : "Production" ,
65+ "created_at" : "2023-04-08T00:11:13.110779+00:00" ,
66+ "last_used_at" : None ,
67+ }
68+ ],
69+ }
70+ )
71+
72+ keys : resend .ApiKeys .ListResponse = resend .ApiKeys .list ()
73+ assert keys ["data" ][0 ]["last_used_at" ] is None
5374
5475 def test_should_list_api_key_raise_exception_when_no_content (self ) -> None :
5576 self .set_mock_json (None )
You can’t perform that action at this time.
0 commit comments