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
24 changes: 23 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92841,6 +92841,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 @@ -92888,11 +92890,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 @@ -141761,6 +141779,7 @@ components:
authorizationCode:
authorizationUrl: /oauth2/v1/authorize
scopes:
agent_builder_run: Run agents created with Agent Builder.
ai_gateway_config_read: View AI Gateway configuration.
ai_gateway_config_write: Create, update, and delete AI Gateway configuration.
ai_gateway_usage: Use AI Gateway and view configuration applicable to the authenticated user.
Expand All @@ -141771,11 +141790,14 @@ components:
apm_service_catalog_write: >-
Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog.
appsec_vm_read: View infrastructure, application code, and library vulnerability findings.
assistant_access: Access Bits Chat.
aws_configurations_manage: Manage AWS integration account configurations and related integration settings.
billing_edit: Edit your organization's billing information.
billing_read: View your organization's billing information.
bits_dev_write: Create and interact with Bits Code sessions.
bits_investigations_read: View Bits AI investigations.
bits_investigations_write: Create and manage Bits AI investigations.
bits_security_analyst_write: Create and manage Bits AI Security Analyst investigations.
cases_read: View Cases.
cases_shared_settings_write: Update shared case management settings.
cases_write: Create and update cases.
Expand Down
4 changes: 3 additions & 1 deletion examples/v2/scorecards/ListScorecardOutcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = ScorecardsApi(api_client)
response = api_instance.list_scorecard_outcomes()
response = api_instance.list_scorecard_outcomes(
filter_rule_id="00000000-0000-0000-0000-000000000000",
)

print(response)
12 changes: 11 additions & 1 deletion src/datadog_api_client/v2/model/outcomes_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from datadog_api_client.v2.model.outcomes_response_data_item import OutcomesResponseDataItem
from datadog_api_client.v2.model.outcomes_response_included_item import OutcomesResponseIncludedItem
from datadog_api_client.v2.model.outcomes_response_links import OutcomesResponseLinks
from datadog_api_client.v2.model.paginated_response_meta import PaginatedResponseMeta


class OutcomesResponse(ModelNormal):
Expand All @@ -25,24 +26,28 @@ def openapi_types(_):
from datadog_api_client.v2.model.outcomes_response_data_item import OutcomesResponseDataItem
from datadog_api_client.v2.model.outcomes_response_included_item import OutcomesResponseIncludedItem
from datadog_api_client.v2.model.outcomes_response_links import OutcomesResponseLinks
from datadog_api_client.v2.model.paginated_response_meta import PaginatedResponseMeta

return {
"data": ([OutcomesResponseDataItem],),
"included": ([OutcomesResponseIncludedItem],),
"links": (OutcomesResponseLinks,),
"meta": (PaginatedResponseMeta,),
}

attribute_map = {
"data": "data",
"included": "included",
"links": "links",
"meta": "meta",
}

def __init__(
self_,
data: Union[List[OutcomesResponseDataItem], UnsetType] = unset,
included: Union[List[OutcomesResponseIncludedItem], UnsetType] = unset,
links: Union[OutcomesResponseLinks, UnsetType] = unset,
meta: Union[PaginatedResponseMeta, UnsetType] = unset,
**kwargs,
):
"""
Expand All @@ -54,13 +59,18 @@ def __init__(
:param included: Array of rule details.
:type included: [OutcomesResponseIncludedItem], optional

:param links: Links attributes.
:param links: Pagination links for rule outcomes.
:type links: OutcomesResponseLinks, optional

:param meta: Metadata for scores response.
:type meta: PaginatedResponseMeta, optional
"""
if data is not unset:
kwargs["data"] = data
if included is not unset:
kwargs["included"] = included
if links is not unset:
kwargs["links"] = links
if meta is not unset:
kwargs["meta"] = meta
super().__init__(kwargs)
40 changes: 38 additions & 2 deletions src/datadog_api_client/v2/model/outcomes_response_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,56 @@ class OutcomesResponseLinks(ModelNormal):
@cached_property
def openapi_types(_):
return {
"first": (str,),
"last": (str,),
"next": (str,),
"previous": (str,),
"self": (str,),
}

attribute_map = {
"first": "first",
"last": "last",
"next": "next",
"previous": "previous",
"self": "self",
}

def __init__(self_, next: Union[str, UnsetType] = unset, **kwargs):
def __init__(
self_,
first: Union[str, UnsetType] = unset,
last: Union[str, UnsetType] = unset,
next: Union[str, UnsetType] = unset,
previous: Union[str, UnsetType] = unset,
self: Union[str, UnsetType] = unset,
**kwargs,
):
"""
Links attributes.
Pagination links for rule outcomes.

:param first: Link for the first set of results.
:type first: str, optional

:param last: Link for the last set of results.
:type last: str, optional

:param next: Link for the next set of results.
:type next: str, optional

:param previous: Link for the previous set of results.
:type previous: str, optional

:param self: Link for the current set of results.
:type self: str, optional
"""
if first is not unset:
kwargs["first"] = first
if last is not unset:
kwargs["last"] = last
if next is not unset:
kwargs["next"] = next
if previous is not unset:
kwargs["previous"] = previous
if self is not unset:
kwargs["self"] = self
super().__init__(kwargs)
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 tests/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
2 changes: 2 additions & 0 deletions tests/v2/features/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
Loading