|
3 | 3 | # Copyright 2019-Present Datadog, Inc.
|
4 | 4 | from __future__ import annotations
|
5 | 5 |
|
6 |
| -from typing import Any, Dict |
| 6 | +from typing import Any, Dict, Union |
7 | 7 |
|
8 | 8 | from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint
|
9 | 9 | from datadog_api_client.configuration import Configuration
|
| 10 | +from datadog_api_client.model_utils import ( |
| 11 | + UnsetType, |
| 12 | + unset, |
| 13 | +) |
10 | 14 | from datadog_api_client.v2.model.restriction_policy_response import RestrictionPolicyResponse
|
11 | 15 | from datadog_api_client.v2.model.restriction_policy_update_request import RestrictionPolicyUpdateRequest
|
12 | 16 |
|
@@ -85,6 +89,11 @@ def __init__(self, api_client=None):
|
85 | 89 | "attribute": "resource_id",
|
86 | 90 | "location": "path",
|
87 | 91 | },
|
| 92 | + "allow_self_lockout": { |
| 93 | + "openapi_types": (str,), |
| 94 | + "attribute": "allow_self_lockout", |
| 95 | + "location": "query", |
| 96 | + }, |
88 | 97 | "body": {
|
89 | 98 | "required": True,
|
90 | 99 | "openapi_types": (RestrictionPolicyUpdateRequest,),
|
@@ -133,6 +142,8 @@ def update_restriction_policy(
|
133 | 142 | self,
|
134 | 143 | resource_id: str,
|
135 | 144 | body: RestrictionPolicyUpdateRequest,
|
| 145 | + *, |
| 146 | + allow_self_lockout: Union[str, UnsetType] = unset, |
136 | 147 | ) -> RestrictionPolicyResponse:
|
137 | 148 | """Update a restriction policy.
|
138 | 149 |
|
@@ -186,11 +197,16 @@ def update_restriction_policy(
|
186 | 197 | :type resource_id: str
|
187 | 198 | :param body: Restriction policy payload
|
188 | 199 | :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 |
189 | 202 | :rtype: RestrictionPolicyResponse
|
190 | 203 | """
|
191 | 204 | kwargs: Dict[str, Any] = {}
|
192 | 205 | kwargs["resource_id"] = resource_id
|
193 | 206 |
|
| 207 | + if allow_self_lockout is not unset: |
| 208 | + kwargs["allow_self_lockout"] = allow_self_lockout |
| 209 | + |
194 | 210 | kwargs["body"] = body
|
195 | 211 |
|
196 | 212 | return self._update_restriction_policy_endpoint.call_with_http_info(**kwargs)
|
0 commit comments