Skip to content

Commit

Permalink
Regenerate client from commit 59e36a8d of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jan 2, 2025
1 parent 5aecaab commit 4e5bf63
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
8 changes: 8 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
18 changes: 17 additions & 1 deletion src/datadog_api_client/v2/api/restriction_policies_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,),
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)

0 comments on commit 4e5bf63

Please sign in to comment.