Skip to content

Commit 2ffd78e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 4b26956 of spec repo
1 parent 94cca5a commit 2ffd78e

23 files changed

Lines changed: 1650 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 519 additions & 0 deletions
Large diffs are not rendered by default.

docs/datadog_api_client.v2.api.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,13 @@ datadog\_api\_client.v2.api.google\_chat\_integration\_api module
403403
:members:
404404
:show-inheritance:
405405

406+
datadog\_api\_client.v2.api.governance\_insights\_api module
407+
------------------------------------------------------------
408+
409+
.. automodule:: datadog_api_client.v2.api.governance_insights_api
410+
:members:
411+
:show-inheritance:
412+
406413
datadog\_api\_client.v2.api.high\_availability\_multi\_region\_api module
407414
-------------------------------------------------------------------------
408415

docs/datadog_api_client.v2.model.rst

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16706,6 +16706,97 @@ datadog\_api\_client.v2.model.google\_meet\_configuration\_reference\_data modul
1670616706
:members:
1670716707
:show-inheritance:
1670816708

16709+
datadog\_api\_client.v2.model.governance\_best\_practice\_definition module
16710+
---------------------------------------------------------------------------
16711+
16712+
.. automodule:: datadog_api_client.v2.model.governance_best_practice_definition
16713+
:members:
16714+
:show-inheritance:
16715+
16716+
datadog\_api\_client.v2.model.governance\_insight\_attributes module
16717+
--------------------------------------------------------------------
16718+
16719+
.. automodule:: datadog_api_client.v2.model.governance_insight_attributes
16720+
:members:
16721+
:show-inheritance:
16722+
16723+
datadog\_api\_client.v2.model.governance\_insight\_audit\_compute module
16724+
------------------------------------------------------------------------
16725+
16726+
.. automodule:: datadog_api_client.v2.model.governance_insight_audit_compute
16727+
:members:
16728+
:show-inheritance:
16729+
16730+
datadog\_api\_client.v2.model.governance\_insight\_audit\_query module
16731+
----------------------------------------------------------------------
16732+
16733+
.. automodule:: datadog_api_client.v2.model.governance_insight_audit_query
16734+
:members:
16735+
:show-inheritance:
16736+
16737+
datadog\_api\_client.v2.model.governance\_insight\_data module
16738+
--------------------------------------------------------------
16739+
16740+
.. automodule:: datadog_api_client.v2.model.governance_insight_data
16741+
:members:
16742+
:show-inheritance:
16743+
16744+
datadog\_api\_client.v2.model.governance\_insight\_event\_compute module
16745+
------------------------------------------------------------------------
16746+
16747+
.. automodule:: datadog_api_client.v2.model.governance_insight_event_compute
16748+
:members:
16749+
:show-inheritance:
16750+
16751+
datadog\_api\_client.v2.model.governance\_insight\_event\_query module
16752+
----------------------------------------------------------------------
16753+
16754+
.. automodule:: datadog_api_client.v2.model.governance_insight_event_query
16755+
:members:
16756+
:show-inheritance:
16757+
16758+
datadog\_api\_client.v2.model.governance\_insight\_metric\_query module
16759+
-----------------------------------------------------------------------
16760+
16761+
.. automodule:: datadog_api_client.v2.model.governance_insight_metric_query
16762+
:members:
16763+
:show-inheritance:
16764+
16765+
datadog\_api\_client.v2.model.governance\_insight\_percentage\_query module
16766+
---------------------------------------------------------------------------
16767+
16768+
.. automodule:: datadog_api_client.v2.model.governance_insight_percentage_query
16769+
:members:
16770+
:show-inheritance:
16771+
16772+
datadog\_api\_client.v2.model.governance\_insight\_query\_config module
16773+
-----------------------------------------------------------------------
16774+
16775+
.. automodule:: datadog_api_client.v2.model.governance_insight_query_config
16776+
:members:
16777+
:show-inheritance:
16778+
16779+
datadog\_api\_client.v2.model.governance\_insight\_resource\_type module
16780+
------------------------------------------------------------------------
16781+
16782+
.. automodule:: datadog_api_client.v2.model.governance_insight_resource_type
16783+
:members:
16784+
:show-inheritance:
16785+
16786+
datadog\_api\_client.v2.model.governance\_insight\_usage\_query module
16787+
----------------------------------------------------------------------
16788+
16789+
.. automodule:: datadog_api_client.v2.model.governance_insight_usage_query
16790+
:members:
16791+
:show-inheritance:
16792+
16793+
datadog\_api\_client.v2.model.governance\_insights\_response module
16794+
-------------------------------------------------------------------
16795+
16796+
.. automodule:: datadog_api_client.v2.model.governance_insights_response
16797+
:members:
16798+
:show-inheritance:
16799+
1670916800
datadog\_api\_client.v2.model.grey\_noise\_api\_key module
1671016801
----------------------------------------------------------
1671116802

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
List governance insights returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.governance_insights_api import GovernanceInsightsApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["list_governance_insights"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = GovernanceInsightsApi(api_client)
12+
response = api_instance.list_governance_insights()
13+
14+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ def __init__(
523523
"v2.upsert_and_publish_form_version": False,
524524
"v2.upsert_form_version": False,
525525
"v2.update_org_saml_configurations": False,
526+
"v2.list_governance_insights": False,
526527
"v2.create_hamr_org_connection": False,
527528
"v2.get_hamr_org_connection": False,
528529
"v2.delete_entity_integration_config": False,
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Any, Dict, List, Union
7+
8+
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
9+
from datadog_api_client.configuration import Configuration
10+
from datadog_api_client.model_utils import (
11+
UnsetType,
12+
unset,
13+
)
14+
from datadog_api_client.v2.model.governance_insights_response import GovernanceInsightsResponse
15+
16+
17+
class GovernanceInsightsApi:
18+
"""
19+
Governance Insights surface key usage, configuration, and best-practice signals for an
20+
organization within the Governance Console. Each insight reports a current value (and,
21+
optionally, a previous value for comparison) along with the query used to compute it, so
22+
that the Console can render trends and highlight areas that need attention.
23+
"""
24+
25+
def __init__(self, api_client=None):
26+
if api_client is None:
27+
api_client = ApiClient(Configuration())
28+
self.api_client = api_client
29+
30+
self._list_governance_insights_endpoint = _Endpoint(
31+
settings={
32+
"response_type": (GovernanceInsightsResponse,),
33+
"auth": ["apiKeyAuth", "appKeyAuth"],
34+
"endpoint_path": "/api/v2/governance/insights",
35+
"operation_id": "list_governance_insights",
36+
"http_method": "GET",
37+
"version": "v2",
38+
},
39+
params_map={
40+
"with_values": {
41+
"openapi_types": (bool,),
42+
"attribute": "withValues",
43+
"location": "query",
44+
},
45+
"org_uuid": {
46+
"openapi_types": (str,),
47+
"attribute": "orgUuid",
48+
"location": "query",
49+
},
50+
"filter_product": {
51+
"openapi_types": ([str],),
52+
"attribute": "filter[product]",
53+
"location": "query",
54+
"collection_format": "multi",
55+
},
56+
},
57+
headers_map={
58+
"accept": ["application/json"],
59+
},
60+
api_client=api_client,
61+
)
62+
63+
def list_governance_insights(
64+
self,
65+
*,
66+
with_values: Union[bool, UnsetType] = unset,
67+
org_uuid: Union[str, UnsetType] = unset,
68+
filter_product: Union[List[str], UnsetType] = unset,
69+
) -> GovernanceInsightsResponse:
70+
"""List governance insights.
71+
72+
Retrieve the list of governance insights available to the organization. By default, only
73+
insight metadata is returned; pass ``withValues=true`` to also compute and include each
74+
insight's current and previous values. Insights can be filtered by product.
75+
76+
:param with_values: Whether to compute and include the current and previous value of each insight.
77+
Defaults to ``false`` , in which case only insight metadata is returned.
78+
:type with_values: bool, optional
79+
:param org_uuid: The UUID of the organization to compute insights for. Defaults to the organization of
80+
the authenticated user. Used to retrieve insights for a child organization from a
81+
parent organization.
82+
:type org_uuid: str, optional
83+
:param filter_product: Restrict the results to insights belonging to the given products. May be repeated to
84+
filter by multiple products. Matching is case-insensitive.
85+
:type filter_product: [str], optional
86+
:rtype: GovernanceInsightsResponse
87+
"""
88+
kwargs: Dict[str, Any] = {}
89+
if with_values is not unset:
90+
kwargs["with_values"] = with_values
91+
92+
if org_uuid is not unset:
93+
kwargs["org_uuid"] = org_uuid
94+
95+
if filter_product is not unset:
96+
kwargs["filter_product"] = filter_product
97+
98+
return self._list_governance_insights_endpoint.call_with_http_info(**kwargs)

src/datadog_api_client/v2/apis/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
from datadog_api_client.v2.api.forms_api import FormsApi
5656
from datadog_api_client.v2.api.gcp_integration_api import GCPIntegrationApi
5757
from datadog_api_client.v2.api.google_chat_integration_api import GoogleChatIntegrationApi
58+
from datadog_api_client.v2.api.governance_insights_api import GovernanceInsightsApi
5859
from datadog_api_client.v2.api.high_availability_multi_region_api import HighAvailabilityMultiRegionApi
5960
from datadog_api_client.v2.api.ip_allowlist_api import IPAllowlistApi
6061
from datadog_api_client.v2.api.incidents_api import IncidentsApi
@@ -189,6 +190,7 @@
189190
"FormsApi",
190191
"GCPIntegrationApi",
191192
"GoogleChatIntegrationApi",
193+
"GovernanceInsightsApi",
192194
"HighAvailabilityMultiRegionApi",
193195
"IPAllowlistApi",
194196
"IncidentsApi",
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
none_type,
12+
unset,
13+
UnsetType,
14+
)
15+
16+
17+
class GovernanceBestPracticeDefinition(ModelNormal):
18+
@cached_property
19+
def openapi_types(_):
20+
return {
21+
"category": (str,),
22+
"deep_link": (str,),
23+
"description": (str,),
24+
"detection_type": (str, none_type),
25+
"id": (str,),
26+
"impact": (str,),
27+
"impact_hint": (int,),
28+
"permissions": ([str],),
29+
"status": (str,),
30+
"summary": (str,),
31+
"title": (str,),
32+
"trigger_condition": (str,),
33+
"trigger_type": (str,),
34+
}
35+
36+
attribute_map = {
37+
"category": "category",
38+
"deep_link": "deep_link",
39+
"description": "description",
40+
"detection_type": "detection_type",
41+
"id": "id",
42+
"impact": "impact",
43+
"impact_hint": "impact_hint",
44+
"permissions": "permissions",
45+
"status": "status",
46+
"summary": "summary",
47+
"title": "title",
48+
"trigger_condition": "trigger_condition",
49+
"trigger_type": "trigger_type",
50+
}
51+
52+
def __init__(
53+
self_,
54+
category: str,
55+
deep_link: str,
56+
description: str,
57+
id: str,
58+
impact: str,
59+
impact_hint: int,
60+
permissions: List[str],
61+
status: str,
62+
summary: str,
63+
title: str,
64+
trigger_condition: str,
65+
trigger_type: str,
66+
detection_type: Union[str, none_type, UnsetType] = unset,
67+
**kwargs,
68+
):
69+
"""
70+
The best practice associated with an insight. Populated with the first active best practice
71+
matched to the insight; ``null`` when no best practice is attached.
72+
73+
:param category: The value driver the best practice is grouped under, such as ``access_governance`` ,
74+
``security`` , ``compliance`` , or ``operational_hygiene``.
75+
:type category: str
76+
77+
:param deep_link: A relative link to the configuration page where the best practice can be acted upon.
78+
:type deep_link: str
79+
80+
:param description: The full rationale and guidance for the best practice.
81+
:type description: str
82+
83+
:param detection_type: An optional association to a control's detection type. ``null`` when not associated with a control.
84+
:type detection_type: str, none_type, optional
85+
86+
:param id: The unique identifier of the best practice.
87+
:type id: str
88+
89+
:param impact: The expected impact of following the best practice.
90+
:type impact: str
91+
92+
:param impact_hint: A priority hint for ordering best practices by expected impact. Lower values indicate
93+
higher priority.
94+
:type impact_hint: int
95+
96+
:param permissions: The permissions required for the user to act on the best practice.
97+
:type permissions: [str]
98+
99+
:param status: Whether the best practice is currently ``active`` or ``deprecated``.
100+
:type status: str
101+
102+
:param summary: A one-line explanation of why this best practice matters.
103+
:type summary: str
104+
105+
:param title: A short, human-readable name for the best practice.
106+
:type title: str
107+
108+
:param trigger_condition: The condition that surfaces the best practice. For an ``insight`` trigger, the insight
109+
slug; for a ``static`` trigger, a descriptive condition key.
110+
:type trigger_condition: str
111+
112+
:param trigger_type: How the best practice is surfaced. ``insight`` ties it to an insight; ``static`` surfaces it
113+
unless its condition is met.
114+
:type trigger_type: str
115+
"""
116+
if detection_type is not unset:
117+
kwargs["detection_type"] = detection_type
118+
super().__init__(kwargs)
119+
120+
self_.category = category
121+
self_.deep_link = deep_link
122+
self_.description = description
123+
self_.id = id
124+
self_.impact = impact
125+
self_.impact_hint = impact_hint
126+
self_.permissions = permissions
127+
self_.status = status
128+
self_.summary = summary
129+
self_.title = title
130+
self_.trigger_condition = trigger_condition
131+
self_.trigger_type = trigger_type

0 commit comments

Comments
 (0)