diff --git a/.apigentools-info b/.apigentools-info index 79af721321..cd34681ade 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 14:39:45.568008", - "spec_repo_commit": "b4e964b3" + "regenerated": "2025-01-02 17:21:20.405019", + "spec_repo_commit": "59e36a8d" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 14:39:45.582278", - "spec_repo_commit": "b4e964b3" + "regenerated": "2025-01-02 17:21:20.421355", + "spec_repo_commit": "59e36a8d" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5c7885313e..1082127ee5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -40785,6 +40785,14 @@ paths: operationId: UpdateRestrictionPolicy parameters: - $ref: '#/components/parameters/ResourceID' + - description: 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. + in: query + name: allow_self_lockout + required: false + schema: + type: string requestBody: content: application/json: diff --git a/src/datadog_api_client/v2/api/restriction_policies_api.py b/src/datadog_api_client/v2/api/restriction_policies_api.py index e3e85d9ee6..cc565e8885 100644 --- a/src/datadog_api_client/v2/api/restriction_policies_api.py +++ b/src/datadog_api_client/v2/api/restriction_policies_api.py @@ -3,10 +3,14 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Any, Dict +from typing import Any, Dict, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) from datadog_api_client.v2.model.restriction_policy_response import RestrictionPolicyResponse from datadog_api_client.v2.model.restriction_policy_update_request import RestrictionPolicyUpdateRequest @@ -85,6 +89,11 @@ def __init__(self, api_client=None): "attribute": "resource_id", "location": "path", }, + "allow_self_lockout": { + "openapi_types": (str,), + "attribute": "allow_self_lockout", + "location": "query", + }, "body": { "required": True, "openapi_types": (RestrictionPolicyUpdateRequest,), @@ -133,6 +142,8 @@ def update_restriction_policy( self, resource_id: str, body: RestrictionPolicyUpdateRequest, + *, + allow_self_lockout: Union[str, UnsetType] = unset, ) -> RestrictionPolicyResponse: """Update a restriction policy. @@ -186,11 +197,16 @@ def update_restriction_policy( :type resource_id: str :param body: Restriction policy payload :type body: RestrictionPolicyUpdateRequest + :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. + :type allow_self_lockout: str, optional :rtype: RestrictionPolicyResponse """ kwargs: Dict[str, Any] = {} kwargs["resource_id"] = resource_id + if allow_self_lockout is not unset: + kwargs["allow_self_lockout"] = allow_self_lockout + kwargs["body"] = body return self._update_restriction_policy_endpoint.call_with_http_info(**kwargs)