From 80f99a9411b1f9a8f8109ec6fb8296c7beb17429 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:46:06 -0600 Subject: [PATCH] Regenerate client from commit 733cf3ea of spec repo (#2338) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 ++++---- .generator/schemas/v2/openapi.yaml | 8 ++++++++ .../v2/api/restriction_policies_api.py | 18 +++++++++++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 39d575bff0..ac362cd816 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 15:18:22.861274", - "spec_repo_commit": "bc53c28f" + "regenerated": "2025-01-02 17:32:10.022066", + "spec_repo_commit": "733cf3ea" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 15:18:22.882795", - "spec_repo_commit": "bc53c28f" + "regenerated": "2025-01-02 17:32:10.039540", + "spec_repo_commit": "733cf3ea" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 941ec65aef..76195d0bb3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -40985,6 +40985,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..ea8a6b2e86 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)