Skip to content

Commit e9b8799

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4ff7e73 of spec repo
1 parent b7e9f9e commit e9b8799

File tree

25 files changed

+229
-59
lines changed

25 files changed

+229
-59
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17829,6 +17829,13 @@ components:
1782917829
format: date-time
1783017830
readOnly: true
1783117831
type: string
17832+
date_last_used:
17833+
description: Date the API Key was last used
17834+
example: '2020-11-27T10:00:00.000Z'
17835+
format: date-time
17836+
nullable: true
17837+
readOnly: true
17838+
type: string
1783217839
key:
1783317840
description: The API key.
1783417841
readOnly: true
@@ -17887,6 +17894,13 @@ components:
1788717894
minLength: 4
1788817895
readOnly: true
1788917896
type: string
17897+
last_used_at:
17898+
description: Last usage timestamp of the application key.
17899+
example: '2020-12-20T10:00:00.000Z'
17900+
format: date-time
17901+
nullable: true
17902+
readOnly: true
17903+
type: string
1789017904
name:
1789117905
description: Name of the application key.
1789217906
example: Application Key for managing dashboards
@@ -33724,6 +33738,13 @@ components:
3372433738
example: '2020-11-23T10:00:00.000Z'
3372533739
readOnly: true
3372633740
type: string
33741+
date_last_used:
33742+
description: Date the API Key was last used.
33743+
example: '2020-11-27T10:00:00.000Z'
33744+
format: date-time
33745+
nullable: true
33746+
readOnly: true
33747+
type: string
3372733748
last4:
3372833749
description: The last four characters of the API key.
3372933750
example: abcd
@@ -33772,6 +33793,12 @@ components:
3377233793
minLength: 4
3377333794
readOnly: true
3377433795
type: string
33796+
last_used_at:
33797+
description: Last usage timestamp of the application key.
33798+
example: '2020-12-20T10:00:00.000Z'
33799+
nullable: true
33800+
readOnly: true
33801+
type: string
3377533802
name:
3377633803
description: Name of the application key.
3377733804
example: Application Key for managing dashboards
@@ -36678,6 +36705,7 @@ components:
3667836705
- type
3667936706
type: object
3668036707
RoleAttributes:
36708+
additionalProperties: {}
3668136709
description: Attributes of the role.
3668236710
properties:
3668336711
created_at:

examples/v2/key-management/GetCurrentUserApplicationKey.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
Get one application key owned by current user returns "OK" response
33
"""
44

5+
from os import environ
56
from datadog_api_client import ApiClient, Configuration
67
from datadog_api_client.v2.api.key_management_api import KeyManagementApi
78

9+
# there is a valid "application_key" in the system
10+
APPLICATION_KEY_DATA_ID = environ["APPLICATION_KEY_DATA_ID"]
11+
812
configuration = Configuration()
913
with ApiClient(configuration) as api_client:
1014
api_instance = KeyManagementApi(api_client)
1115
response = api_instance.get_current_user_application_key(
12-
app_key_id="app_key_id",
16+
app_key_id=APPLICATION_KEY_DATA_ID,
1317
)
1418

1519
print(response)

src/datadog_api_client/v2/model/full_api_key_attributes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ModelNormal,
1010
cached_property,
1111
datetime,
12+
none_type,
1213
unset,
1314
UnsetType,
1415
)
@@ -27,6 +28,7 @@ def openapi_types(_):
2728
return {
2829
"category": (str,),
2930
"created_at": (datetime,),
31+
"date_last_used": (datetime, none_type),
3032
"key": (str,),
3133
"last4": (str,),
3234
"modified_at": (datetime,),
@@ -37,6 +39,7 @@ def openapi_types(_):
3739
attribute_map = {
3840
"category": "category",
3941
"created_at": "created_at",
42+
"date_last_used": "date_last_used",
4043
"key": "key",
4144
"last4": "last4",
4245
"modified_at": "modified_at",
@@ -45,6 +48,7 @@ def openapi_types(_):
4548
}
4649
read_only_vars = {
4750
"created_at",
51+
"date_last_used",
4852
"key",
4953
"last4",
5054
"modified_at",
@@ -54,6 +58,7 @@ def __init__(
5458
self_,
5559
category: Union[str, UnsetType] = unset,
5660
created_at: Union[datetime, UnsetType] = unset,
61+
date_last_used: Union[datetime, none_type, UnsetType] = unset,
5762
key: Union[str, UnsetType] = unset,
5863
last4: Union[str, UnsetType] = unset,
5964
modified_at: Union[datetime, UnsetType] = unset,
@@ -70,6 +75,9 @@ def __init__(
7075
:param created_at: Creation date of the API key.
7176
:type created_at: datetime, optional
7277
78+
:param date_last_used: Date the API Key was last used
79+
:type date_last_used: datetime, none_type, optional
80+
7381
:param key: The API key.
7482
:type key: str, optional
7583
@@ -89,6 +97,8 @@ def __init__(
8997
kwargs["category"] = category
9098
if created_at is not unset:
9199
kwargs["created_at"] = created_at
100+
if date_last_used is not unset:
101+
kwargs["date_last_used"] = date_last_used
92102
if key is not unset:
93103
kwargs["key"] = key
94104
if last4 is not unset:

src/datadog_api_client/v2/model/full_application_key_attributes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def openapi_types(_):
2929
"created_at": (datetime,),
3030
"key": (str,),
3131
"last4": (str,),
32+
"last_used_at": (datetime, none_type),
3233
"name": (str,),
3334
"scopes": ([str], none_type),
3435
}
@@ -37,20 +38,23 @@ def openapi_types(_):
3738
"created_at": "created_at",
3839
"key": "key",
3940
"last4": "last4",
41+
"last_used_at": "last_used_at",
4042
"name": "name",
4143
"scopes": "scopes",
4244
}
4345
read_only_vars = {
4446
"created_at",
4547
"key",
4648
"last4",
49+
"last_used_at",
4750
}
4851

4952
def __init__(
5053
self_,
5154
created_at: Union[datetime, UnsetType] = unset,
5255
key: Union[str, UnsetType] = unset,
5356
last4: Union[str, UnsetType] = unset,
57+
last_used_at: Union[datetime, none_type, UnsetType] = unset,
5458
name: Union[str, UnsetType] = unset,
5559
scopes: Union[List[str], none_type, UnsetType] = unset,
5660
**kwargs,
@@ -67,6 +71,9 @@ def __init__(
6771
:param last4: The last four characters of the application key.
6872
:type last4: str, optional
6973
74+
:param last_used_at: Last usage timestamp of the application key.
75+
:type last_used_at: datetime, none_type, optional
76+
7077
:param name: Name of the application key.
7178
:type name: str, optional
7279
@@ -79,6 +86,8 @@ def __init__(
7986
kwargs["key"] = key
8087
if last4 is not unset:
8188
kwargs["last4"] = last4
89+
if last_used_at is not unset:
90+
kwargs["last_used_at"] = last_used_at
8291
if name is not unset:
8392
kwargs["name"] = name
8493
if scopes is not unset:

src/datadog_api_client/v2/model/partial_api_key_attributes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11+
datetime,
12+
none_type,
1113
unset,
1214
UnsetType,
1315
)
@@ -26,6 +28,7 @@ def openapi_types(_):
2628
return {
2729
"category": (str,),
2830
"created_at": (str,),
31+
"date_last_used": (datetime, none_type),
2932
"last4": (str,),
3033
"modified_at": (str,),
3134
"name": (str,),
@@ -35,13 +38,15 @@ def openapi_types(_):
3538
attribute_map = {
3639
"category": "category",
3740
"created_at": "created_at",
41+
"date_last_used": "date_last_used",
3842
"last4": "last4",
3943
"modified_at": "modified_at",
4044
"name": "name",
4145
"remote_config_read_enabled": "remote_config_read_enabled",
4246
}
4347
read_only_vars = {
4448
"created_at",
49+
"date_last_used",
4550
"last4",
4651
"modified_at",
4752
}
@@ -50,6 +55,7 @@ def __init__(
5055
self_,
5156
category: Union[str, UnsetType] = unset,
5257
created_at: Union[str, UnsetType] = unset,
58+
date_last_used: Union[datetime, none_type, UnsetType] = unset,
5359
last4: Union[str, UnsetType] = unset,
5460
modified_at: Union[str, UnsetType] = unset,
5561
name: Union[str, UnsetType] = unset,
@@ -65,6 +71,9 @@ def __init__(
6571
:param created_at: Creation date of the API key.
6672
:type created_at: str, optional
6773
74+
:param date_last_used: Date the API Key was last used.
75+
:type date_last_used: datetime, none_type, optional
76+
6877
:param last4: The last four characters of the API key.
6978
:type last4: str, optional
7079
@@ -81,6 +90,8 @@ def __init__(
8190
kwargs["category"] = category
8291
if created_at is not unset:
8392
kwargs["created_at"] = created_at
93+
if date_last_used is not unset:
94+
kwargs["date_last_used"] = date_last_used
8495
if last4 is not unset:
8596
kwargs["last4"] = last4
8697
if modified_at is not unset:

src/datadog_api_client/v2/model/partial_application_key_attributes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,29 @@ def openapi_types(_):
2727
return {
2828
"created_at": (str,),
2929
"last4": (str,),
30+
"last_used_at": (str, none_type),
3031
"name": (str,),
3132
"scopes": ([str], none_type),
3233
}
3334

3435
attribute_map = {
3536
"created_at": "created_at",
3637
"last4": "last4",
38+
"last_used_at": "last_used_at",
3739
"name": "name",
3840
"scopes": "scopes",
3941
}
4042
read_only_vars = {
4143
"created_at",
4244
"last4",
45+
"last_used_at",
4346
}
4447

4548
def __init__(
4649
self_,
4750
created_at: Union[str, UnsetType] = unset,
4851
last4: Union[str, UnsetType] = unset,
52+
last_used_at: Union[str, none_type, UnsetType] = unset,
4953
name: Union[str, UnsetType] = unset,
5054
scopes: Union[List[str], none_type, UnsetType] = unset,
5155
**kwargs,
@@ -59,6 +63,9 @@ def __init__(
5963
:param last4: The last four characters of the application key.
6064
:type last4: str, optional
6165
66+
:param last_used_at: Last usage timestamp of the application key.
67+
:type last_used_at: str, none_type, optional
68+
6269
:param name: Name of the application key.
6370
:type name: str, optional
6471
@@ -69,6 +76,8 @@ def __init__(
6976
kwargs["created_at"] = created_at
7077
if last4 is not unset:
7178
kwargs["last4"] = last4
79+
if last_used_at is not unset:
80+
kwargs["last_used_at"] = last_used_at
7281
if name is not unset:
7382
kwargs["name"] = name
7483
if scopes is not unset:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-05-12T09:52:14.640Z
1+
2025-09-08T09:24:43.356Z

tests/v2/cassettes/test_scenarios/test_get_all_api_keys_returns_ok_response.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
interactions:
22
- request:
3-
body: '{"data":{"attributes":{"name":"Test-Get_all_API_keys_returns_OK_response-1652349134"},"type":"api_keys"}}'
3+
body: '{"data":{"attributes":{"name":"Test-Get_all_API_keys_returns_OK_response-1757323483"},"type":"api_keys"}}'
44
headers:
55
accept:
66
- application/json
@@ -10,7 +10,7 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/api_keys
1111
response:
1212
body:
13-
string: '{"data":{"type":"api_keys","attributes":{"created_at":"2022-05-12T09:52:15.135884+00:00","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","last4":"xxxx","modified_at":"2022-05-12T09:52:15.135884+00:00","name":"Test-Get_all_API_keys_returns_OK_response-1652349134"},"relationships":{"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"leak_information":{"data":null}},"id":"32c723fd-9e78-4b1a-a1dd-fab7fe34e8e8"}}'
13+
string: '{"data":{"type":"api_keys","attributes":{"created_at":"2025-09-08T09:24:43.558793+00:00","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","last4":"xxxx","modified_at":"2025-09-08T09:24:43.558793+00:00","remote_config_read_enabled":true,"category":"default","name":"Test-Get_all_API_keys_returns_OK_response-1757323483"},"relationships":{"created_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"modified_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"leak_information":{"data":null}},"id":"84dbd164-f3f5-4f30-ac93-e12b27adeada"}}'
1414
headers:
1515
content-type:
1616
- application/json
@@ -23,10 +23,12 @@ interactions:
2323
accept:
2424
- application/json
2525
method: GET
26-
uri: https://api.datadoghq.com/api/v2/api_keys?filter=Test-Get_all_API_keys_returns_OK_response-1652349134
26+
uri: https://api.datadoghq.com/api/v2/api_keys?filter=Test-Get_all_API_keys_returns_OK_response-1757323483
2727
response:
2828
body:
29-
string: '{"meta":{"max_allowed":200,"page":{"total_filtered_count":1}},"data":[{"type":"api_keys","attributes":{"created_at":"2022-05-12T09:52:15.135884+00:00","last4":"xxxx","modified_at":"2022-05-12T09:52:15.135884+00:00","name":"Test-Get_all_API_keys_returns_OK_response-1652349134"},"relationships":{"created_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"modified_by":{"data":{"type":"users","id":"3ad549bf-eba0-11e9-a77a-0705486660d0"}},"leak_information":{"data":null}},"id":"32c723fd-9e78-4b1a-a1dd-fab7fe34e8e8"}]}'
29+
string: '{"data":[{"type":"api_keys","attributes":{"created_at":"2025-09-08T09:24:43.558793+00:00","last4":"xxxx","modified_at":"2025-09-08T09:24:43.558793+00:00","remote_config_read_enabled":true,"category":"default","name":"Test-Get_all_API_keys_returns_OK_response-1757323483","date_last_used":null,"used_in_last_24_hours":false,"last_used_date":{"timestamp":null,"description":"Timestamp
30+
of when this key was last used in the past ninety (90) days, null if no recent
31+
usage"}},"relationships":{"created_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"modified_by":{"data":{"type":"users","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca"}},"leak_information":{"data":null}},"id":"84dbd164-f3f5-4f30-ac93-e12b27adeada"}],"meta":{"page":{"total_filtered_count":1},"max_allowed":200}}'
3032
headers:
3133
content-type:
3234
- application/json
@@ -39,11 +41,13 @@ interactions:
3941
accept:
4042
- '*/*'
4143
method: DELETE
42-
uri: https://api.datadoghq.com/api/v2/api_keys/32c723fd-9e78-4b1a-a1dd-fab7fe34e8e8
44+
uri: https://api.datadoghq.com/api/v2/api_keys/84dbd164-f3f5-4f30-ac93-e12b27adeada
4345
response:
4446
body:
4547
string: ''
46-
headers: {}
48+
headers:
49+
content-type:
50+
- text/html; charset=utf-8
4751
status:
4852
code: 204
4953
message: No Content
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-10-16T13:23:16.735Z
1+
2025-09-08T09:24:46.730Z

0 commit comments

Comments
 (0)