Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93067,6 +93067,8 @@ components:
$ref: "#/components/schemas/OutcomesResponseIncluded"
links:
$ref: "#/components/schemas/OutcomesResponseLinks"
meta:
$ref: "#/components/schemas/PaginatedResponseMeta"
type: object
OutcomesResponseData:
description: List of rule outcomes.
Expand Down Expand Up @@ -93114,11 +93116,27 @@ components:
type: string
type: object
OutcomesResponseLinks:
description: Links attributes.
description: Pagination links for rule outcomes.
properties:
first:
description: Link for the first set of results.
example: "/api/v2/scorecard/outcomes?include=rule&page%5Blimit%5D=100&page%5Boffset%5D=0"
type: string
last:
description: Link for the last set of results.
example: "/api/v2/scorecard/outcomes?include=rule&page%5Blimit%5D=100&page%5Boffset%5D=200"
type: string
next:
description: |-
Link for the next set of results.
example: "/api/v2/scorecard/outcomes?include=rule&page%5Blimit%5D=100&page%5Boffset%5D=200"
type: string
previous:
description: Link for the previous set of results.
example: "/api/v2/scorecard/outcomes?include=rule&page%5Blimit%5D=100&page%5Boffset%5D=0"
type: string
self:
description: Link for the current set of results.
example: "/api/v2/scorecard/outcomes?include=rule&page%5Blimit%5D=100&page%5Boffset%5D=100"
type: string
type: object
Expand Down Expand Up @@ -94199,10 +94217,10 @@ components:
- LOW
- HIGH
PaginatedResponseMeta:
description: Metadata for scores response.
description: Pagination metadata.
properties:
count:
description: Number of entities in this response.
description: Number of results in this response.
example: 10
format: int64
type: integer
Expand All @@ -94217,7 +94235,7 @@ components:
format: int64
type: integer
total:
description: Total number of entities available.
description: Total number of results matching the filters.
example: 150
format: int64
type: integer
Expand Down
5 changes: 4 additions & 1 deletion examples/v2/scorecards/ListScorecardOutcomes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::ScorecardsAPI.new
p api_instance.list_scorecard_outcomes()
opts = {
filter_rule_id: "00000000-0000-0000-0000-000000000000",
}
p api_instance.list_scorecard_outcomes(opts)
2 changes: 2 additions & 0 deletions features/v2/scorecards.feature
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ Feature: Scorecards
@team:ddoghq/idp
Scenario: List all rule outcomes returns "OK" response
Given new "ListScorecardOutcomes" request
And request contains "filter[rule][id]" parameter with value "00000000-0000-0000-0000-000000000000"
When the request is sent
Then the response status is 200 OK
And the response "data" has length 0

@replay-only @skip-validation @team:ddoghq/idp @with-pagination
Scenario: List all rule outcomes returns "OK" response with pagination
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,24 @@
"content_type": null,
"method": "GET",
"pagination": false,
"parameters": [],
"parameters": [
{
"explode": null,
"in": "query",
"name": "filter[rule][id]",
"required": false,
"schema": {
"format": null,
"ref": null,
"type": "string"
},
"source": {
"type": "literal",
"value": "00000000-0000-0000-0000-000000000000"
},
"style": null
}
],
"path": "/api/v2/scorecard/outcomes"
},
"scenario": "List all rule outcomes returns \"OK\" response",
Expand Down
11 changes: 8 additions & 3 deletions generated-test/test-server-data/v2/scorecards.json
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
},
{
"feature": "Scorecards",
"frozen_at": "2023-11-01T22:17:32.235Z",
"frozen_at": "2026-10-15T18:17:34.519Z",
"interactions": [
{
"request": {
Expand All @@ -469,12 +469,17 @@
"content_type": "",
"method": "GET",
"path": "/api/v2/scorecard/outcomes",
"query": []
"query": [
[
"filter[rule][id]",
"00000000-0000-0000-0000-000000000000"
]
]
},
"response": {
"body": {
"encoding": "text",
"value": "{\"data\":[{\"id\":\"c70e3b5f-a9f7-4ef8-8417-bf28ea153631\\\\my-service\",\"type\":\"outcome\",\"attributes\":{\"modified_at\":\"2023-11-01T20:08:35.478323Z\",\"remarks\":\"See: \\u003ca href=\\\"https://app.datadoghq.com/services\\\"\\u003eServices\\u003c/a\\u003e\",\"service_name\":\"my-service\",\"state\":\"pass\"},\"relationships\":{\"rule\":{\"data\":{\"id\":\"c70e3b5f-a9f7-4ef8-8417-bf28ea153631\",\"type\":\"rule\"}}}},{\"id\":\"2609deb7-bbd0-4277-bf48-2265328bc4ca\\\\my-service\",\"type\":\"outcome\",\"attributes\":{\"modified_at\":\"2023-11-01T20:08:49.202899Z\",\"remarks\":\"See: \\u003ca href=\\\"https://app.datadoghq.com/services\\\"\\u003eServices\\u003c/a\\u003e\",\"service_name\":\"my-service\",\"state\":\"pass\"},\"relationships\":{\"rule\":{\"data\":{\"id\":\"2609deb7-bbd0-4277-bf48-2265328bc4ca\",\"type\":\"rule\"}}}},{\"id\":\"be6867b9-bd71-497f-803f-208d7361fee2\\\\my-service\",\"type\":\"outcome\",\"attributes\":{\"modified_at\":\"2023-11-01T20:25:35.504243Z\",\"remarks\":\"See: \\u003ca href=\\\"https://app.datadoghq.com/services\\\"\\u003eServices\\u003c/a\\u003e\",\"service_name\":\"my-service\",\"state\":\"pass\"},\"relationships\":{\"rule\":{\"data\":{\"id\":\"be6867b9-bd71-497f-803f-208d7361fee2\",\"type\":\"rule\"}}}}],\"links\":{\"next\":\"/api/v2/scorecard/outcomes?page%5Blimit%5D=100\\u0026page%5Boffset%5D=100\"}}"
"value": "{\"data\":[],\"meta\":{\"count\":0,\"limit\":1000,\"offset\":0,\"total\":0},\"links\":{\"self\":\"/api/v2/scorecard/outcomes?filter%5Brule%5D%5Bid%5D=00000000-0000-0000-0000-000000000000\\u0026include=entity\\u0026page%5Blimit%5D=1000\\u0026page%5Boffset%5D=0\",\"first\":\"/api/v2/scorecard/outcomes?filter%5Brule%5D%5Bid%5D=00000000-0000-0000-0000-000000000000\\u0026include=entity\\u0026page%5Blimit%5D=1000\\u0026page%5Boffset%5D=0\",\"last\":\"/api/v2/scorecard/outcomes?filter%5Brule%5D%5Bid%5D=00000000-0000-0000-0000-000000000000\\u0026include=entity\\u0026page%5Blimit%5D=1000\\u0026page%5Boffset%5D=0\"}}"
},
"headers": {
"content-type": "application/vnd.api+json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ListCampaignsResponse
# Array of campaigns.
attr_reader :data

# Metadata for scores response.
# Pagination metadata.
attr_reader :meta

attr_accessor :additional_properties
Expand Down
18 changes: 14 additions & 4 deletions lib/datadog_api_client/v2/models/outcomes_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ class OutcomesResponse
# Array of rule details.
attr_accessor :included

# Links attributes.
# Pagination links for rule outcomes.
attr_accessor :links

# Pagination metadata.
attr_accessor :meta

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
Expand All @@ -38,7 +41,8 @@ def self.attribute_map
{
:'data' => :'data',
:'included' => :'included',
:'links' => :'links'
:'links' => :'links',
:'meta' => :'meta'
}
end

Expand All @@ -48,7 +52,8 @@ def self.openapi_types
{
:'data' => :'Array<OutcomesResponseDataItem>',
:'included' => :'Array<OutcomesResponseIncludedItem>',
:'links' => :'OutcomesResponseLinks'
:'links' => :'OutcomesResponseLinks',
:'meta' => :'PaginatedResponseMeta'
}
end

Expand Down Expand Up @@ -85,6 +90,10 @@ def initialize(attributes = {})
if attributes.key?(:'links')
self.links = attributes[:'links']
end

if attributes.key?(:'meta')
self.meta = attributes[:'meta']
end
end

# Returns the object in the form of hash, with additionalProperties support.
Expand Down Expand Up @@ -116,14 +125,15 @@ def ==(o)
data == o.data &&
included == o.included &&
links == o.links &&
meta == o.meta &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[data, included, links, additional_properties].hash
[data, included, links, meta, additional_properties].hash
end
end
end
48 changes: 44 additions & 4 deletions lib/datadog_api_client/v2/models/outcomes_response_links.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,48 @@
require 'time'

module DatadogAPIClient::V2
# Links attributes.
# Pagination links for rule outcomes.
class OutcomesResponseLinks
include BaseGenericModel

# Link for the first set of results.
attr_accessor :first

# Link for the last set of results.
attr_accessor :last

# Link for the next set of results.
attr_accessor :_next

# Link for the previous set of results.
attr_accessor :previous

# Link for the current set of results.
attr_accessor :_self

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'_next' => :'next'
:'first' => :'first',
:'last' => :'last',
:'_next' => :'next',
:'previous' => :'previous',
:'_self' => :'self'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'_next' => :'String'
:'first' => :'String',
:'last' => :'String',
:'_next' => :'String',
:'previous' => :'String',
:'_self' => :'String'
}
end

Expand All @@ -60,9 +80,25 @@ def initialize(attributes = {})
end
}

if attributes.key?(:'first')
self.first = attributes[:'first']
end

if attributes.key?(:'last')
self.last = attributes[:'last']
end

if attributes.key?(:'_next')
self._next = attributes[:'_next']
end

if attributes.key?(:'previous')
self.previous = attributes[:'previous']
end

if attributes.key?(:'_self')
self._self = attributes[:'_self']
end
end

# Returns the object in the form of hash, with additionalProperties support.
Expand Down Expand Up @@ -91,15 +127,19 @@ def to_hash
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
first == o.first &&
last == o.last &&
_next == o._next &&
previous == o.previous &&
_self == o._self &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[_next, additional_properties].hash
[first, last, _next, previous, _self, additional_properties].hash
end
end
end
6 changes: 3 additions & 3 deletions lib/datadog_api_client/v2/models/paginated_response_meta.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
require 'time'

module DatadogAPIClient::V2
# Metadata for scores response.
# Pagination metadata.
class PaginatedResponseMeta
include BaseGenericModel

# Number of entities in this response.
# Number of results in this response.
attr_reader :count

# Pagination limit.
Expand All @@ -30,7 +30,7 @@ class PaginatedResponseMeta
# Pagination offset.
attr_reader :offset

# Total number of entities available.
# Total number of results matching the filters.
attr_reader :total

attr_accessor :additional_properties
Expand Down
Loading