Skip to content

Commit 80f99a9

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 733cf3ea of spec repo (#2338)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 99cf671 commit 80f99a9

File tree

3 files changed

+29
-5
lines changed

3 files changed

+29
-5
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": "2025-01-02 15:18:22.861274",
8-
"spec_repo_commit": "bc53c28f"
7+
"regenerated": "2025-01-02 17:32:10.022066",
8+
"spec_repo_commit": "733cf3ea"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-02 15:18:22.882795",
13-
"spec_repo_commit": "bc53c28f"
12+
"regenerated": "2025-01-02 17:32:10.039540",
13+
"spec_repo_commit": "733cf3ea"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40985,6 +40985,14 @@ paths:
4098540985
operationId: UpdateRestrictionPolicy
4098640986
parameters:
4098740987
- $ref: '#/components/parameters/ResourceID'
40988+
- description: Allows admins (users with the `user_access_manage` permission)
40989+
to remove their own access from the resource if set to `true`. By default,
40990+
this is set to `false`, preventing admins from locking themselves out.
40991+
in: query
40992+
name: allow_self_lockout
40993+
required: false
40994+
schema:
40995+
type: string
4098840996
requestBody:
4098940997
content:
4099040998
application/json:

src/datadog_api_client/v2/api/restriction_policies_api.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Any, Dict
6+
from typing import Any, Dict, Union
77

88
from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
99
from datadog_api_client.configuration import Configuration
10+
from datadog_api_client.model_utils import (
11+
UnsetType,
12+
unset,
13+
)
1014
from datadog_api_client.v2.model.restriction_policy_response import RestrictionPolicyResponse
1115
from datadog_api_client.v2.model.restriction_policy_update_request import RestrictionPolicyUpdateRequest
1216

@@ -85,6 +89,11 @@ def __init__(self, api_client=None):
8589
"attribute": "resource_id",
8690
"location": "path",
8791
},
92+
"allow_self_lockout": {
93+
"openapi_types": (str,),
94+
"attribute": "allow_self_lockout",
95+
"location": "query",
96+
},
8897
"body": {
8998
"required": True,
9099
"openapi_types": (RestrictionPolicyUpdateRequest,),
@@ -133,6 +142,8 @@ def update_restriction_policy(
133142
self,
134143
resource_id: str,
135144
body: RestrictionPolicyUpdateRequest,
145+
*,
146+
allow_self_lockout: Union[str, UnsetType] = unset,
136147
) -> RestrictionPolicyResponse:
137148
"""Update a restriction policy.
138149
@@ -186,11 +197,16 @@ def update_restriction_policy(
186197
:type resource_id: str
187198
:param body: Restriction policy payload
188199
:type body: RestrictionPolicyUpdateRequest
200+
:param allow_self_lockout: Allows admins (users with the ``user_access_manage`` permission) to remove their own access from the resource if set to ``true``. By default, this is set to ``false`` , preventing admins from locking themselves out.
201+
:type allow_self_lockout: str, optional
189202
:rtype: RestrictionPolicyResponse
190203
"""
191204
kwargs: Dict[str, Any] = {}
192205
kwargs["resource_id"] = resource_id
193206

207+
if allow_self_lockout is not unset:
208+
kwargs["allow_self_lockout"] = allow_self_lockout
209+
194210
kwargs["body"] = body
195211

196212
return self._update_restriction_policy_endpoint.call_with_http_info(**kwargs)

0 commit comments

Comments
 (0)