Skip to content

Commit 3a10095

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5b5e690 of spec repo
1 parent b210dec commit 3a10095

File tree

7 files changed

+84
-11
lines changed

7 files changed

+84
-11
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17455,6 +17455,12 @@ components:
1745517455
format: date-time
1745617456
readOnly: true
1745717457
type: string
17458+
date_last_used:
17459+
description: Date the API Key was last used
17460+
example: '2020-11-27T10:00:00.000Z'
17461+
format: date-time
17462+
readOnly: true
17463+
type: string
1745817464
key:
1745917465
description: The API key.
1746017466
readOnly: true
@@ -17513,6 +17519,13 @@ components:
1751317519
minLength: 4
1751417520
readOnly: true
1751517521
type: string
17522+
last_used_at:
17523+
description: Last usage timestamp of the application key.
17524+
example: '2020-12-20T10:00:00.000Z'
17525+
format: date-time
17526+
nullable: true
17527+
readOnly: true
17528+
type: string
1751617529
name:
1751717530
description: Name of the application key.
1751817531
example: Application Key for managing dashboards
@@ -32380,6 +32393,12 @@ components:
3238032393
example: '2020-11-23T10:00:00.000Z'
3238132394
readOnly: true
3238232395
type: string
32396+
date_last_used:
32397+
description: Date the API Key was last used.
32398+
example: '2020-11-27T10:00:00.000Z'
32399+
format: date-time
32400+
readOnly: true
32401+
type: string
3238332402
last4:
3238432403
description: The last four characters of the API key.
3238532404
example: abcd
@@ -32428,6 +32447,12 @@ components:
3242832447
minLength: 4
3242932448
readOnly: true
3243032449
type: string
32450+
last_used_at:
32451+
description: Last usage timestamp of the application key.
32452+
example: '2020-12-20T10:00:00.000Z'
32453+
nullable: true
32454+
readOnly: true
32455+
type: string
3243132456
name:
3243232457
description: Name of the application key.
3243332458
example: Application Key for managing dashboards

examples/v2/key-management/GetCurrentUserApplicationKey.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import { client, v2 } from "@datadog/datadog-api-client";
77
const configuration = client.createConfiguration();
88
const apiInstance = new v2.KeyManagementApi(configuration);
99

10+
// there is a valid "application_key" in the system
11+
const APPLICATION_KEY_DATA_ID = process.env.APPLICATION_KEY_DATA_ID as string;
12+
1013
const params: v2.KeyManagementApiGetCurrentUserApplicationKeyRequest = {
11-
appKeyId: "app_key_id",
14+
appKeyId: APPLICATION_KEY_DATA_ID,
1215
};
1316

1417
apiInstance

features/v2/key_management.feature

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ Feature: Key Management
182182
And the response "data.id" is equal to "{{ application_key.data.id }}"
183183
And the response "data.attributes.name" is equal to "{{ application_key.data.attributes.name }}-updated"
184184

185-
@generated @skip @team:DataDog/credentials-management
185+
@team:DataDog/credentials-management
186186
Scenario: Get API key returns "Not Found" response
187187
Given new "GetAPIKey" request
188-
And request contains "api_key_id" parameter from "REPLACE.ME"
188+
And request contains "api_key_id" parameter with value "invalidId"
189189
When the request is sent
190190
Then the response status is 404 Not Found
191191

@@ -198,8 +198,9 @@ Feature: Key Management
198198
Then the response status is 200 OK
199199
And the response "data.type" is equal to "api_keys"
200200
And the response "data.id" is equal to "{{ api_key.data.id }}"
201+
And the response "data.attributes" has field "date_last_used"
201202

202-
@generated @skip @team:DataDog/credentials-management
203+
@team:DataDog/credentials-management
203204
Scenario: Get all API keys returns "Bad Request" response
204205
Given new "ListAPIKeys" request
205206
When the request is sent
@@ -213,6 +214,7 @@ Feature: Key Management
213214
When the request is sent
214215
Then the response status is 200 OK
215216
And the response "data[0].type" is equal to "api_keys"
217+
And the response "data[0].attributes" has field "date_last_used"
216218

217219
@generated @skip @team:DataDog/credentials-management
218220
Scenario: Get all application keys owned by current user returns "Bad Request" response
@@ -232,6 +234,7 @@ Feature: Key Management
232234
When the request is sent
233235
Then the response status is 200 OK
234236
And the response "data[0].type" is equal to "application_keys"
237+
And the response "data[0].attributes" has field "last_used_at"
235238

236239
@generated @skip @team:DataDog/credentials-management
237240
Scenario: Get all application keys returns "Bad Request" response
@@ -252,6 +255,7 @@ Feature: Key Management
252255
When the request is sent
253256
Then the response status is 200 OK
254257
And the response "data[0].type" is equal to "application_keys"
258+
And the response "data[0].attributes" has field "last_used_at"
255259

256260
@generated @skip @team:DataDog/credentials-management
257261
Scenario: Get an application key returns "Bad Request" response
@@ -260,10 +264,9 @@ Feature: Key Management
260264
When the request is sent
261265
Then the response status is 400 Bad Request
262266

263-
@generated @skip @team:DataDog/credentials-management
267+
@gteam:DataDog/credentials-management @team:DataDog/credentials-management
264268
Scenario: Get an application key returns "Not Found" response
265269
Given new "GetApplicationKey" request
266-
And request contains "app_key_id" parameter from "REPLACE.ME"
267270
When the request is sent
268271
Then the response status is 404 Not Found
269272

@@ -276,17 +279,24 @@ Feature: Key Management
276279
Then the response status is 200 OK
277280
And the response "data.type" is equal to "application_keys"
278281
And the response "data.id" has the same value as "application_key.data.id"
282+
And the response "data.attributes" has field "last_used_at"
279283

280-
@generated @skip @team:DataDog/credentials-management
284+
@team:DataDog/credentials-management
281285
Scenario: Get one application key owned by current user returns "Not Found" response
282286
Given new "GetCurrentUserApplicationKey" request
283-
And request contains "app_key_id" parameter from "REPLACE.ME"
287+
And request contains "app_key_id" parameter with value "incorrectId"
284288
When the request is sent
285289
Then the response status is 404 Not Found
286290

287-
@generated @skip @team:DataDog/credentials-management
291+
@team:DataDog/credentials-management
288292
Scenario: Get one application key owned by current user returns "OK" response
289-
Given new "GetCurrentUserApplicationKey" request
290-
And request contains "app_key_id" parameter from "REPLACE.ME"
293+
Given there is a valid "application_key" in the system
294+
And new "GetCurrentUserApplicationKey" request
295+
And request contains "app_key_id" parameter from "application_key.data.id"
291296
When the request is sent
292297
Then the response status is 200 OK
298+
And the response "data.type" is equal to "application_keys"
299+
And the response "data.id" is equal to "{{ application_key.data.id }}"
300+
And the response "data.attributes.name" is equal to "{{ application_key.data.attributes.name }}"
301+
And the response "data.attributes" has field "scopes"
302+
And the response "data.attributes" has field "last_used_at"

packages/datadog-api-client-v2/models/FullAPIKeyAttributes.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export class FullAPIKeyAttributes {
1818
* Creation date of the API key.
1919
*/
2020
"createdAt"?: Date;
21+
/**
22+
* Date the API Key was last used
23+
*/
24+
"dateLastUsed"?: Date;
2125
/**
2226
* The API key.
2327
*/
@@ -64,6 +68,11 @@ export class FullAPIKeyAttributes {
6468
type: "Date",
6569
format: "date-time",
6670
},
71+
dateLastUsed: {
72+
baseName: "date_last_used",
73+
type: "Date",
74+
format: "date-time",
75+
},
6776
key: {
6877
baseName: "key",
6978
type: "string",

packages/datadog-api-client-v2/models/FullApplicationKeyAttributes.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export class FullApplicationKeyAttributes {
2222
* The last four characters of the application key.
2323
*/
2424
"last4"?: string;
25+
/**
26+
* Last usage timestamp of the application key.
27+
*/
28+
"lastUsedAt"?: Date;
2529
/**
2630
* Name of the application key.
2731
*/
@@ -60,6 +64,11 @@ export class FullApplicationKeyAttributes {
6064
baseName: "last4",
6165
type: "string",
6266
},
67+
lastUsedAt: {
68+
baseName: "last_used_at",
69+
type: "Date",
70+
format: "date-time",
71+
},
6372
name: {
6473
baseName: "name",
6574
type: "string",

packages/datadog-api-client-v2/models/PartialAPIKeyAttributes.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export class PartialAPIKeyAttributes {
1818
* Creation date of the API key.
1919
*/
2020
"createdAt"?: string;
21+
/**
22+
* Date the API Key was last used.
23+
*/
24+
"dateLastUsed"?: Date;
2125
/**
2226
* The last four characters of the API key.
2327
*/
@@ -59,6 +63,11 @@ export class PartialAPIKeyAttributes {
5963
baseName: "created_at",
6064
type: "string",
6165
},
66+
dateLastUsed: {
67+
baseName: "date_last_used",
68+
type: "Date",
69+
format: "date-time",
70+
},
6271
last4: {
6372
baseName: "last4",
6473
type: "string",

packages/datadog-api-client-v2/models/PartialApplicationKeyAttributes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export class PartialApplicationKeyAttributes {
1818
* The last four characters of the application key.
1919
*/
2020
"last4"?: string;
21+
/**
22+
* Last usage timestamp of the application key.
23+
*/
24+
"lastUsedAt"?: string;
2125
/**
2226
* Name of the application key.
2327
*/
@@ -51,6 +55,10 @@ export class PartialApplicationKeyAttributes {
5155
baseName: "last4",
5256
type: "string",
5357
},
58+
lastUsedAt: {
59+
baseName: "last_used_at",
60+
type: "string",
61+
},
5462
name: {
5563
baseName: "name",
5664
type: "string",

0 commit comments

Comments
 (0)