Skip to content

Commit fe55cfe

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add resource_type query param to authn mapping spec (#1989)
* Regenerate client from commit 4e7a6907 of spec repo * pre-commit fixes --------- Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent b902870 commit fe55cfe

File tree

6 files changed

+77
-4
lines changed

6 files changed

+77
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-07-18 19:52:50.738768",
8-
"spec_repo_commit": "17f1aa28"
7+
"regenerated": "2024-07-18 21:03:09.090272",
8+
"spec_repo_commit": "4e7a6907"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-18 19:52:50.755789",
13-
"spec_repo_commit": "17f1aa28"
12+
"regenerated": "2024-07-18 21:03:09.115557",
13+
"spec_repo_commit": "4e7a6907"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,15 @@ components:
13841384
team:
13851385
$ref: '#/components/schemas/RelationshipToTeam'
13861386
type: object
1387+
AuthNMappingResourceType:
1388+
description: The type of resource being mapped to.
1389+
enum:
1390+
- role
1391+
- team
1392+
type: string
1393+
x-enum-varnames:
1394+
- ROLE
1395+
- TEAM
13871396
AuthNMappingResponse:
13881397
description: AuthN Mapping response from the API.
13891398
properties:
@@ -24696,6 +24705,11 @@ paths:
2469624705
required: false
2469724706
schema:
2469824707
type: string
24708+
- description: Filter by mapping resource type. Defaults to "role" if not specified.
24709+
in: query
24710+
name: resource_type
24711+
schema:
24712+
$ref: '#/components/schemas/AuthNMappingResourceType'
2469924713
responses:
2470024714
'200':
2470124715
content:

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,13 @@ authn\_mapping\_relationships
400400
:members:
401401
:show-inheritance:
402402

403+
authn\_mapping\_resource\_type
404+
------------------------------
405+
406+
.. automodule:: datadog_api_client.v2.model.authn_mapping_resource_type
407+
:members:
408+
:show-inheritance:
409+
403410
authn\_mapping\_response
404411
------------------------
405412

src/datadog_api_client/v2/api/authn_mappings_api.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
)
1414
from datadog_api_client.v2.model.authn_mappings_response import AuthNMappingsResponse
1515
from datadog_api_client.v2.model.authn_mappings_sort import AuthNMappingsSort
16+
from datadog_api_client.v2.model.authn_mapping_resource_type import AuthNMappingResourceType
1617
from datadog_api_client.v2.model.authn_mapping_response import AuthNMappingResponse
1718
from datadog_api_client.v2.model.authn_mapping_create_request import AuthNMappingCreateRequest
1819
from datadog_api_client.v2.model.authn_mapping_update_request import AuthNMappingUpdateRequest
@@ -126,6 +127,11 @@ def __init__(self, api_client=None):
126127
"attribute": "filter",
127128
"location": "query",
128129
},
130+
"resource_type": {
131+
"openapi_types": (AuthNMappingResourceType,),
132+
"attribute": "resource_type",
133+
"location": "query",
134+
},
129135
},
130136
headers_map={
131137
"accept": ["application/json"],
@@ -216,6 +222,7 @@ def list_authn_mappings(
216222
page_number: Union[int, UnsetType] = unset,
217223
sort: Union[AuthNMappingsSort, UnsetType] = unset,
218224
filter: Union[str, UnsetType] = unset,
225+
resource_type: Union[AuthNMappingResourceType, UnsetType] = unset,
219226
) -> AuthNMappingsResponse:
220227
"""List all AuthN Mappings.
221228
@@ -229,6 +236,8 @@ def list_authn_mappings(
229236
:type sort: AuthNMappingsSort, optional
230237
:param filter: Filter all mappings by the given string.
231238
:type filter: str, optional
239+
:param resource_type: Filter by mapping resource type. Defaults to "role" if not specified.
240+
:type resource_type: AuthNMappingResourceType, optional
232241
:rtype: AuthNMappingsResponse
233242
"""
234243
kwargs: Dict[str, Any] = {}
@@ -244,6 +253,9 @@ def list_authn_mappings(
244253
if filter is not unset:
245254
kwargs["filter"] = filter
246255

256+
if resource_type is not unset:
257+
kwargs["resource_type"] = resource_type
258+
247259
return self._list_authn_mappings_endpoint.call_with_http_info(**kwargs)
248260

249261
def update_authn_mapping(
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class AuthNMappingResourceType(ModelSimple):
16+
"""
17+
The type of resource being mapped to.
18+
19+
:param value: Must be one of ["role", "team"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"role",
25+
"team",
26+
}
27+
ROLE: ClassVar["AuthNMappingResourceType"]
28+
TEAM: ClassVar["AuthNMappingResourceType"]
29+
30+
@cached_property
31+
def openapi_types(_):
32+
return {
33+
"value": (str,),
34+
}
35+
36+
37+
AuthNMappingResourceType.ROLE = AuthNMappingResourceType("role")
38+
AuthNMappingResourceType.TEAM = AuthNMappingResourceType("team")

src/datadog_api_client/v2/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
from datadog_api_client.v2.model.authn_mapping_relationship_to_role import AuthNMappingRelationshipToRole
6060
from datadog_api_client.v2.model.authn_mapping_relationship_to_team import AuthNMappingRelationshipToTeam
6161
from datadog_api_client.v2.model.authn_mapping_relationships import AuthNMappingRelationships
62+
from datadog_api_client.v2.model.authn_mapping_resource_type import AuthNMappingResourceType
6263
from datadog_api_client.v2.model.authn_mapping_response import AuthNMappingResponse
6364
from datadog_api_client.v2.model.authn_mapping_team import AuthNMappingTeam
6465
from datadog_api_client.v2.model.authn_mapping_team_attributes import AuthNMappingTeamAttributes
@@ -1898,6 +1899,7 @@
18981899
"AuthNMappingRelationshipToRole",
18991900
"AuthNMappingRelationshipToTeam",
19001901
"AuthNMappingRelationships",
1902+
"AuthNMappingResourceType",
19011903
"AuthNMappingResponse",
19021904
"AuthNMappingTeam",
19031905
"AuthNMappingTeamAttributes",

0 commit comments

Comments
 (0)