Skip to content

Commit 4788ac7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5b5e690 of spec repo
1 parent 55b27ad commit 4788ac7

File tree

7 files changed

+95
-15
lines changed

7 files changed

+95
-15
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.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22

33
require "datadog_api_client"
44
api_instance = DatadogAPIClient::V2::KeyManagementAPI.new
5-
p api_instance.get_current_user_application_key("app_key_id")
5+
6+
# there is a valid "application_key" in the system
7+
APPLICATION_KEY_DATA_ID = ENV["APPLICATION_KEY_DATA_ID"]
8+
p api_instance.get_current_user_application_key(APPLICATION_KEY_DATA_ID)

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"

lib/datadog_api_client/v2/models/full_api_key_attributes.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class FullAPIKeyAttributes
2727
# Creation date of the API key.
2828
attr_accessor :created_at
2929

30+
# Date the API Key was last used
31+
attr_accessor :date_last_used
32+
3033
# The API key.
3134
attr_accessor :key
3235

@@ -50,6 +53,7 @@ def self.attribute_map
5053
{
5154
:'category' => :'category',
5255
:'created_at' => :'created_at',
56+
:'date_last_used' => :'date_last_used',
5357
:'key' => :'key',
5458
:'last4' => :'last4',
5559
:'modified_at' => :'modified_at',
@@ -64,6 +68,7 @@ def self.openapi_types
6468
{
6569
:'category' => :'String',
6670
:'created_at' => :'Time',
71+
:'date_last_used' => :'Time',
6772
:'key' => :'String',
6873
:'last4' => :'String',
6974
:'modified_at' => :'Time',
@@ -98,6 +103,10 @@ def initialize(attributes = {})
98103
self.created_at = attributes[:'created_at']
99104
end
100105

106+
if attributes.key?(:'date_last_used')
107+
self.date_last_used = attributes[:'date_last_used']
108+
end
109+
101110
if attributes.key?(:'key')
102111
self.key = attributes[:'key']
103112
end
@@ -169,6 +178,7 @@ def ==(o)
169178
self.class == o.class &&
170179
category == o.category &&
171180
created_at == o.created_at &&
181+
date_last_used == o.date_last_used &&
172182
key == o.key &&
173183
last4 == o.last4 &&
174184
modified_at == o.modified_at &&
@@ -181,7 +191,7 @@ def ==(o)
181191
# @return [Integer] Hash code
182192
# @!visibility private
183193
def hash
184-
[category, created_at, key, last4, modified_at, name, remote_config_read_enabled, additional_properties].hash
194+
[category, created_at, date_last_used, key, last4, modified_at, name, remote_config_read_enabled, additional_properties].hash
185195
end
186196
end
187197
end

lib/datadog_api_client/v2/models/full_application_key_attributes.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class FullApplicationKeyAttributes
3030
# The last four characters of the application key.
3131
attr_reader :last4
3232

33+
# Last usage timestamp of the application key.
34+
attr_accessor :last_used_at
35+
3336
# Name of the application key.
3437
attr_accessor :name
3538

@@ -45,6 +48,7 @@ def self.attribute_map
4548
:'created_at' => :'created_at',
4649
:'key' => :'key',
4750
:'last4' => :'last4',
51+
:'last_used_at' => :'last_used_at',
4852
:'name' => :'name',
4953
:'scopes' => :'scopes'
5054
}
@@ -57,6 +61,7 @@ def self.openapi_types
5761
:'created_at' => :'Time',
5862
:'key' => :'String',
5963
:'last4' => :'String',
64+
:'last_used_at' => :'Time',
6065
:'name' => :'String',
6166
:'scopes' => :'Array<String>'
6267
}
@@ -66,6 +71,7 @@ def self.openapi_types
6671
# @!visibility private
6772
def self.openapi_nullable
6873
Set.new([
74+
:'last_used_at',
6975
:'scopes',
7076
])
7177
end
@@ -100,6 +106,10 @@ def initialize(attributes = {})
100106
self.last4 = attributes[:'last4']
101107
end
102108

109+
if attributes.key?(:'last_used_at')
110+
self.last_used_at = attributes[:'last_used_at']
111+
end
112+
103113
if attributes.key?(:'name')
104114
self.name = attributes[:'name']
105115
end
@@ -162,6 +172,7 @@ def ==(o)
162172
created_at == o.created_at &&
163173
key == o.key &&
164174
last4 == o.last4 &&
175+
last_used_at == o.last_used_at &&
165176
name == o.name &&
166177
scopes == o.scopes &&
167178
additional_properties == o.additional_properties
@@ -171,7 +182,7 @@ def ==(o)
171182
# @return [Integer] Hash code
172183
# @!visibility private
173184
def hash
174-
[created_at, key, last4, name, scopes, additional_properties].hash
185+
[created_at, key, last4, last_used_at, name, scopes, additional_properties].hash
175186
end
176187
end
177188
end

lib/datadog_api_client/v2/models/partial_api_key_attributes.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class PartialAPIKeyAttributes
2727
# Creation date of the API key.
2828
attr_accessor :created_at
2929

30+
# Date the API Key was last used.
31+
attr_accessor :date_last_used
32+
3033
# The last four characters of the API key.
3134
attr_reader :last4
3235

@@ -47,6 +50,7 @@ def self.attribute_map
4750
{
4851
:'category' => :'category',
4952
:'created_at' => :'created_at',
53+
:'date_last_used' => :'date_last_used',
5054
:'last4' => :'last4',
5155
:'modified_at' => :'modified_at',
5256
:'name' => :'name',
@@ -60,6 +64,7 @@ def self.openapi_types
6064
{
6165
:'category' => :'String',
6266
:'created_at' => :'String',
67+
:'date_last_used' => :'Time',
6368
:'last4' => :'String',
6469
:'modified_at' => :'String',
6570
:'name' => :'String',
@@ -93,6 +98,10 @@ def initialize(attributes = {})
9398
self.created_at = attributes[:'created_at']
9499
end
95100

101+
if attributes.key?(:'date_last_used')
102+
self.date_last_used = attributes[:'date_last_used']
103+
end
104+
96105
if attributes.key?(:'last4')
97106
self.last4 = attributes[:'last4']
98107
end
@@ -160,6 +169,7 @@ def ==(o)
160169
self.class == o.class &&
161170
category == o.category &&
162171
created_at == o.created_at &&
172+
date_last_used == o.date_last_used &&
163173
last4 == o.last4 &&
164174
modified_at == o.modified_at &&
165175
name == o.name &&
@@ -171,7 +181,7 @@ def ==(o)
171181
# @return [Integer] Hash code
172182
# @!visibility private
173183
def hash
174-
[category, created_at, last4, modified_at, name, remote_config_read_enabled, additional_properties].hash
184+
[category, created_at, date_last_used, last4, modified_at, name, remote_config_read_enabled, additional_properties].hash
175185
end
176186
end
177187
end

lib/datadog_api_client/v2/models/partial_application_key_attributes.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class PartialApplicationKeyAttributes
2727
# The last four characters of the application key.
2828
attr_reader :last4
2929

30+
# Last usage timestamp of the application key.
31+
attr_accessor :last_used_at
32+
3033
# Name of the application key.
3134
attr_accessor :name
3235

@@ -41,6 +44,7 @@ def self.attribute_map
4144
{
4245
:'created_at' => :'created_at',
4346
:'last4' => :'last4',
47+
:'last_used_at' => :'last_used_at',
4448
:'name' => :'name',
4549
:'scopes' => :'scopes'
4650
}
@@ -52,6 +56,7 @@ def self.openapi_types
5256
{
5357
:'created_at' => :'String',
5458
:'last4' => :'String',
59+
:'last_used_at' => :'String',
5560
:'name' => :'String',
5661
:'scopes' => :'Array<String>'
5762
}
@@ -61,6 +66,7 @@ def self.openapi_types
6166
# @!visibility private
6267
def self.openapi_nullable
6368
Set.new([
69+
:'last_used_at',
6470
:'scopes',
6571
])
6672
end
@@ -91,6 +97,10 @@ def initialize(attributes = {})
9197
self.last4 = attributes[:'last4']
9298
end
9399

100+
if attributes.key?(:'last_used_at')
101+
self.last_used_at = attributes[:'last_used_at']
102+
end
103+
94104
if attributes.key?(:'name')
95105
self.name = attributes[:'name']
96106
end
@@ -152,6 +162,7 @@ def ==(o)
152162
self.class == o.class &&
153163
created_at == o.created_at &&
154164
last4 == o.last4 &&
165+
last_used_at == o.last_used_at &&
155166
name == o.name &&
156167
scopes == o.scopes &&
157168
additional_properties == o.additional_properties
@@ -161,7 +172,7 @@ def ==(o)
161172
# @return [Integer] Hash code
162173
# @!visibility private
163174
def hash
164-
[created_at, last4, name, scopes, additional_properties].hash
175+
[created_at, last4, last_used_at, name, scopes, additional_properties].hash
165176
end
166177
end
167178
end

0 commit comments

Comments
 (0)