diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 828edaf56c2a..c46307ba9335 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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. @@ -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 @@ -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 @@ -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 diff --git a/examples/v2/scorecards/ListScorecardOutcomes.rb b/examples/v2/scorecards/ListScorecardOutcomes.rb index 46b5d75785a0..ea8858a5ad9c 100644 --- a/examples/v2/scorecards/ListScorecardOutcomes.rb +++ b/examples/v2/scorecards/ListScorecardOutcomes.rb @@ -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) diff --git a/features/v2/scorecards.feature b/features/v2/scorecards.feature index 0ae2916d065e..5ee08c36f3bf 100644 --- a/features/v2/scorecards.feature +++ b/features/v2/scorecards.feature @@ -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 diff --git a/generated-test/test-runner-data/v2/scorecards/list-all-rule-outcomes-returns-ok-response.json b/generated-test/test-runner-data/v2/scorecards/list-all-rule-outcomes-returns-ok-response.json index af826fac3c60..7ab79fa36926 100644 --- a/generated-test/test-runner-data/v2/scorecards/list-all-rule-outcomes-returns-ok-response.json +++ b/generated-test/test-runner-data/v2/scorecards/list-all-rule-outcomes-returns-ok-response.json @@ -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", diff --git a/generated-test/test-server-data/v2/scorecards.json b/generated-test/test-server-data/v2/scorecards.json index 3d20007e8830..303ba02b378e 100644 --- a/generated-test/test-server-data/v2/scorecards.json +++ b/generated-test/test-server-data/v2/scorecards.json @@ -458,7 +458,7 @@ }, { "feature": "Scorecards", - "frozen_at": "2023-11-01T22:17:32.235Z", + "frozen_at": "2026-10-15T18:17:34.519Z", "interactions": [ { "request": { @@ -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" diff --git a/lib/datadog_api_client/v2/models/list_campaigns_response.rb b/lib/datadog_api_client/v2/models/list_campaigns_response.rb index 6c3cecb46d20..7b66304129ab 100644 --- a/lib/datadog_api_client/v2/models/list_campaigns_response.rb +++ b/lib/datadog_api_client/v2/models/list_campaigns_response.rb @@ -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 diff --git a/lib/datadog_api_client/v2/models/outcomes_response.rb b/lib/datadog_api_client/v2/models/outcomes_response.rb index 9d2e9f7295dd..efe34d3bf628 100644 --- a/lib/datadog_api_client/v2/models/outcomes_response.rb +++ b/lib/datadog_api_client/v2/models/outcomes_response.rb @@ -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. @@ -38,7 +41,8 @@ def self.attribute_map { :'data' => :'data', :'included' => :'included', - :'links' => :'links' + :'links' => :'links', + :'meta' => :'meta' } end @@ -48,7 +52,8 @@ def self.openapi_types { :'data' => :'Array', :'included' => :'Array', - :'links' => :'OutcomesResponseLinks' + :'links' => :'OutcomesResponseLinks', + :'meta' => :'PaginatedResponseMeta' } end @@ -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. @@ -116,6 +125,7 @@ def ==(o) data == o.data && included == o.included && links == o.links && + meta == o.meta && additional_properties == o.additional_properties end @@ -123,7 +133,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [data, included, links, additional_properties].hash + [data, included, links, meta, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/outcomes_response_links.rb b/lib/datadog_api_client/v2/models/outcomes_response_links.rb index 6fe3db33f2e2..1b7e9f66abf5 100644 --- a/lib/datadog_api_client/v2/models/outcomes_response_links.rb +++ b/lib/datadog_api_client/v2/models/outcomes_response_links.rb @@ -17,20 +17,36 @@ 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 @@ -38,7 +54,11 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'_next' => :'String' + :'first' => :'String', + :'last' => :'String', + :'_next' => :'String', + :'previous' => :'String', + :'_self' => :'String' } end @@ -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. @@ -91,7 +127,11 @@ 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 @@ -99,7 +139,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [_next, additional_properties].hash + [first, last, _next, previous, _self, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/paginated_response_meta.rb b/lib/datadog_api_client/v2/models/paginated_response_meta.rb index ebd135586ae3..00ae61d4e7be 100644 --- a/lib/datadog_api_client/v2/models/paginated_response_meta.rb +++ b/lib/datadog_api_client/v2/models/paginated_response_meta.rb @@ -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. @@ -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