From deaf89b020a885cab8e79c9b10fe2888affce3e7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 25 Sep 2026 13:37:33 +0000 Subject: [PATCH] Regenerate client from commit 6d6f74d of spec repo --- .generator/schemas/v2/openapi.yaml | 163 +++++++++++++++++- .../v2/api/key_management_api.py | 46 ++++- .../v2/api/service_accounts_api.py | 48 +++++- .../access_token_list_item_relationships.py | 16 +- .../access_token_response_included_item.py | 44 +++++ .../v2/model/full_personal_access_token.py | 14 +- ...ull_personal_access_token_relationships.py | 42 +++++ .../v2/model/full_service_access_token.py | 12 +- ...full_service_access_token_relationships.py | 42 +++++ .../list_personal_access_tokens_response.py | 11 ++ .../list_service_access_tokens_response.py | 11 ++ .../personal_access_token_relationships.py | 16 +- .../model/personal_access_token_response.py | 19 +- ...ess_tokens_include_query_parameter_item.py | 37 ++++ .../v2/model/personal_access_tokens_sort.py | 8 +- .../v2/model/relationship_to_leaked_key.py | 41 +++++ .../model/relationship_to_leaked_key_data.py | 48 ++++++ .../service_access_token_relationships.py | 16 +- .../v2/model/service_access_token_response.py | 19 +- .../v2/model/updated_personal_access_token.py | 77 +++++++++ ...ted_personal_access_token_relationships.py | 42 +++++ .../updated_personal_access_token_response.py | 40 +++++ .../v2/model/updated_service_access_token.py | 77 +++++++++ ...ated_service_access_token_relationships.py | 42 +++++ .../updated_service_access_token_response.py | 40 +++++ src/datadog_api_client/v2/models/__init__.py | 30 ++++ 26 files changed, 972 insertions(+), 29 deletions(-) create mode 100644 src/datadog_api_client/v2/model/access_token_response_included_item.py create mode 100644 src/datadog_api_client/v2/model/full_personal_access_token_relationships.py create mode 100644 src/datadog_api_client/v2/model/full_service_access_token_relationships.py create mode 100644 src/datadog_api_client/v2/model/personal_access_tokens_include_query_parameter_item.py create mode 100644 src/datadog_api_client/v2/model/relationship_to_leaked_key.py create mode 100644 src/datadog_api_client/v2/model/relationship_to_leaked_key_data.py create mode 100644 src/datadog_api_client/v2/model/updated_personal_access_token.py create mode 100644 src/datadog_api_client/v2/model/updated_personal_access_token_relationships.py create mode 100644 src/datadog_api_client/v2/model/updated_personal_access_token_response.py create mode 100644 src/datadog_api_client/v2/model/updated_service_access_token.py create mode 100644 src/datadog_api_client/v2/model/updated_service_access_token_relationships.py create mode 100644 src/datadog_api_client/v2/model/updated_service_access_token_response.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 12847a964d..1846f886a4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1502,6 +1502,14 @@ components: required: true schema: type: string + PersonalAccessTokensFilterLeakedParameter: + description: When true, only return access tokens that have been detected as leaked. Has no effect when false. + in: query + name: filter[leaked] + required: false + schema: + example: true + type: boolean PersonalAccessTokensFilterOwnerIDParameter: description: Filter access tokens by the owner's ID. Supports multiple values. in: query @@ -1519,6 +1527,16 @@ components: required: false schema: type: string + PersonalAccessTokensIncludeParameter: + description: Comma-separated list of relationship objects that should be included in the response. + explode: false + in: query + name: include + required: false + schema: + items: + $ref: "#/components/schemas/PersonalAccessTokensIncludeQueryParameterItem" + type: array PersonalAccessTokensSortParameter: description: |- Access token attribute used to sort results. Sort order is ascending @@ -4227,6 +4245,8 @@ components: AccessTokenListItemRelationships: description: Resources related to the access token entry in the mixed list response. properties: + leak_information: + $ref: "#/components/schemas/RelationshipToLeakedKey" owned_by: $ref: "#/components/schemas/RelationshipToAccessTokenOwner" type: object @@ -4240,6 +4260,15 @@ components: x-enum-varnames: - USERS - SERVICE_ACCOUNT + AccessTokenResponseIncludedArray: + description: Array of objects related to the access tokens. + items: + $ref: "#/components/schemas/AccessTokenResponseIncludedItem" + type: array + AccessTokenResponseIncludedItem: + description: An object related to an access token. + oneOf: + - $ref: "#/components/schemas/LeakedKey" AccessTokensType: description: Resource type returned by the access tokens list endpoint. Includes both personal and service access tokens. enum: @@ -45649,7 +45678,7 @@ components: description: ID of the access token. type: string relationships: - $ref: "#/components/schemas/PersonalAccessTokenRelationships" + $ref: "#/components/schemas/FullPersonalAccessTokenRelationships" type: $ref: "#/components/schemas/PersonalAccessTokensType" type: object @@ -45692,6 +45721,12 @@ components: type: string type: array type: object + FullPersonalAccessTokenRelationships: + description: Resources related to the access token. + properties: + owned_by: + $ref: "#/components/schemas/RelationshipToUser" + type: object FullServiceAccessToken: description: Datadog access token, including the token key. properties: @@ -45701,7 +45736,7 @@ components: description: ID of the access token. type: string relationships: - $ref: "#/components/schemas/ServiceAccessTokenRelationships" + $ref: "#/components/schemas/FullServiceAccessTokenRelationships" type: $ref: "#/components/schemas/ServiceAccessTokensType" type: object @@ -45744,6 +45779,12 @@ components: type: string type: array type: object + FullServiceAccessTokenRelationships: + description: Resources related to the access token. + properties: + owned_by: + $ref: "#/components/schemas/RelationshipToServiceAccount" + type: object GCPCredentials: description: The definition of the `GCPCredentials` object. oneOf: @@ -67192,6 +67233,8 @@ components: items: $ref: "#/components/schemas/AccessTokenListItem" type: array + included: + $ref: "#/components/schemas/AccessTokenResponseIncludedArray" meta: $ref: "#/components/schemas/PersonalAccessTokenResponseMeta" type: object @@ -67432,6 +67475,8 @@ components: items: $ref: "#/components/schemas/ServiceAccessToken" type: array + included: + $ref: "#/components/schemas/AccessTokenResponseIncludedArray" meta: $ref: "#/components/schemas/ServiceAccessTokenResponseMeta" type: object @@ -86256,6 +86301,8 @@ components: PersonalAccessTokenRelationships: description: Resources related to the access token. properties: + leak_information: + $ref: "#/components/schemas/RelationshipToLeakedKey" owned_by: $ref: "#/components/schemas/RelationshipToUser" type: object @@ -86264,6 +86311,8 @@ components: properties: data: $ref: "#/components/schemas/PersonalAccessToken" + included: + $ref: "#/components/schemas/AccessTokenResponseIncludedArray" type: object PersonalAccessTokenResponseMeta: description: Additional information related to the access token response. @@ -86320,6 +86369,14 @@ components: required: - data type: object + PersonalAccessTokensIncludeQueryParameterItem: + description: Relationship object that should be included in the response. + enum: + - leak_information + example: "leak_information" + type: string + x-enum-varnames: + - LEAK_INFORMATION PersonalAccessTokensSort: default: name description: Sorting options @@ -86332,6 +86389,8 @@ components: - -expires_at - last_used_at - -last_used_at + - leaked + - -leaked type: string x-enum-varnames: - NAME_ASCENDING @@ -86342,6 +86401,8 @@ components: - EXPIRES_AT_DESCENDING - LAST_USED_AT_ASCENDING - LAST_USED_AT_DESCENDING + - LEAKED_ASCENDING + - LEAKED_DESCENDING PersonalAccessTokensType: default: personal_access_tokens description: Personal access tokens resource type. @@ -93325,6 +93386,28 @@ components: required: - data type: object + RelationshipToLeakedKey: + description: Relationship to the leak the access token was found in. `data` is null when the access token has not been detected as leaked. + properties: + data: + $ref: "#/components/schemas/RelationshipToLeakedKeyData" + required: + - data + type: object + RelationshipToLeakedKeyData: + description: Relationship to the leak the access token was found in. + nullable: true + properties: + id: + description: A unique identifier that represents the leak. + example: "00000000-0000-1234-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/LeakedKeyType" + required: + - id + - type + type: object RelationshipToOrganization: description: Relationship to an organization. properties: @@ -108413,6 +108496,8 @@ components: ServiceAccessTokenRelationships: description: Resources related to the access token. properties: + leak_information: + $ref: "#/components/schemas/RelationshipToLeakedKey" owned_by: $ref: "#/components/schemas/RelationshipToServiceAccount" type: object @@ -108421,6 +108506,8 @@ components: properties: data: $ref: "#/components/schemas/ServiceAccessToken" + included: + $ref: "#/components/schemas/AccessTokenResponseIncludedArray" type: object ServiceAccessTokenResponseMeta: description: Additional information related to the access token response. @@ -127264,6 +127351,68 @@ components: data: $ref: "#/components/schemas/WorkflowDataUpdate" type: object + UpdatedPersonalAccessToken: + description: Datadog access token returned by the update endpoint. + properties: + attributes: + $ref: "#/components/schemas/PersonalAccessTokenAttributes" + id: + description: ID of the access token. + example: "00000000-0000-1234-0000-000000000000" + type: string + relationships: + $ref: "#/components/schemas/UpdatedPersonalAccessTokenRelationships" + type: + $ref: "#/components/schemas/PersonalAccessTokensType" + required: + - id + - type + type: object + UpdatedPersonalAccessTokenRelationships: + description: Resources related to the access token. + properties: + owned_by: + $ref: "#/components/schemas/RelationshipToUser" + type: object + UpdatedPersonalAccessTokenResponse: + description: Response for updating an access token. + properties: + data: + $ref: "#/components/schemas/UpdatedPersonalAccessToken" + required: + - data + type: object + UpdatedServiceAccessToken: + description: Datadog access token returned by the update endpoint. + properties: + attributes: + $ref: "#/components/schemas/ServiceAccessTokenAttributes" + id: + description: ID of the access token. + example: "00000000-0000-1234-0000-000000000000" + type: string + relationships: + $ref: "#/components/schemas/UpdatedServiceAccessTokenRelationships" + type: + $ref: "#/components/schemas/ServiceAccessTokensType" + required: + - id + - type + type: object + UpdatedServiceAccessTokenRelationships: + description: Resources related to the access token. + properties: + owned_by: + $ref: "#/components/schemas/RelationshipToServiceAccount" + type: object + UpdatedServiceAccessTokenResponse: + description: Response for updating an access token. + properties: + data: + $ref: "#/components/schemas/UpdatedServiceAccessToken" + required: + - data + type: object UpsertAllocationRequest: description: Request to create or update a targeting rule (allocation) for a feature flag environment. properties: @@ -191854,6 +192003,8 @@ paths: - $ref: "#/components/parameters/PersonalAccessTokensSortParameter" - $ref: "#/components/parameters/PersonalAccessTokensFilterParameter" - $ref: "#/components/parameters/PersonalAccessTokensFilterOwnerIDParameter" + - $ref: "#/components/parameters/PersonalAccessTokensFilterLeakedParameter" + - $ref: "#/components/parameters/PersonalAccessTokensIncludeParameter" responses: "200": content: @@ -191998,6 +192149,7 @@ paths: operationId: GetPersonalAccessToken parameters: - $ref: "#/components/parameters/AccessTokenID" + - $ref: "#/components/parameters/PersonalAccessTokensIncludeParameter" responses: "200": content: @@ -192080,7 +192232,7 @@ paths: id: 00000000-0000-0000-0000-000000000004 type: personal_access_tokens schema: - $ref: "#/components/schemas/PersonalAccessTokenResponse" + $ref: "#/components/schemas/UpdatedPersonalAccessTokenResponse" description: OK "400": content: @@ -215732,6 +215884,8 @@ paths: - $ref: "#/components/parameters/PageNumber" - $ref: "#/components/parameters/PersonalAccessTokensSortParameter" - $ref: "#/components/parameters/PersonalAccessTokensFilterParameter" + - $ref: "#/components/parameters/PersonalAccessTokensFilterLeakedParameter" + - $ref: "#/components/parameters/PersonalAccessTokensIncludeParameter" responses: "200": content: @@ -215889,6 +216043,7 @@ paths: parameters: - $ref: "#/components/parameters/ServiceAccountID" - $ref: "#/components/parameters/AccessTokenID" + - $ref: "#/components/parameters/PersonalAccessTokensIncludeParameter" responses: "200": content: @@ -215971,7 +216126,7 @@ paths: id: 00000000-0000-0000-0000-000000000008 type: service_access_tokens schema: - $ref: "#/components/schemas/ServiceAccessTokenResponse" + $ref: "#/components/schemas/UpdatedServiceAccessTokenResponse" description: OK "400": content: diff --git a/src/datadog_api_client/v2/api/key_management_api.py b/src/datadog_api_client/v2/api/key_management_api.py index c853152af0..743e903038 100644 --- a/src/datadog_api_client/v2/api/key_management_api.py +++ b/src/datadog_api_client/v2/api/key_management_api.py @@ -23,9 +23,13 @@ from datadog_api_client.v2.model.application_key_create_request import ApplicationKeyCreateRequest from datadog_api_client.v2.model.list_personal_access_tokens_response import ListPersonalAccessTokensResponse from datadog_api_client.v2.model.personal_access_tokens_sort import PersonalAccessTokensSort +from datadog_api_client.v2.model.personal_access_tokens_include_query_parameter_item import ( + PersonalAccessTokensIncludeQueryParameterItem, +) from datadog_api_client.v2.model.personal_access_token_create_response import PersonalAccessTokenCreateResponse from datadog_api_client.v2.model.personal_access_token_create_request import PersonalAccessTokenCreateRequest from datadog_api_client.v2.model.personal_access_token_response import PersonalAccessTokenResponse +from datadog_api_client.v2.model.updated_personal_access_token_response import UpdatedPersonalAccessTokenResponse from datadog_api_client.v2.model.personal_access_token_update_request import PersonalAccessTokenUpdateRequest from datadog_api_client.v2.model.validate_v2_response import ValidateV2Response from datadog_api_client.v2.model.validate_api_key_response import ValidateAPIKeyResponse @@ -271,6 +275,12 @@ def __init__(self, api_client=None): "attribute": "token_id", "location": "path", }, + "include": { + "openapi_types": ([PersonalAccessTokensIncludeQueryParameterItem],), + "attribute": "include", + "location": "query", + "collection_format": "csv", + }, }, headers_map={ "accept": ["application/json"], @@ -495,6 +505,17 @@ def __init__(self, api_client=None): "location": "query", "collection_format": "multi", }, + "filter_leaked": { + "openapi_types": (bool,), + "attribute": "filter[leaked]", + "location": "query", + }, + "include": { + "openapi_types": ([PersonalAccessTokensIncludeQueryParameterItem],), + "attribute": "include", + "location": "query", + "collection_format": "csv", + }, }, headers_map={ "accept": ["application/json"], @@ -605,7 +626,7 @@ def __init__(self, api_client=None): self._update_personal_access_token_endpoint = _Endpoint( settings={ - "response_type": (PersonalAccessTokenResponse,), + "response_type": (UpdatedPersonalAccessTokenResponse,), "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], "endpoint_path": "/api/v2/personal_access_tokens/{token_id}", "operation_id": "update_personal_access_token", @@ -829,6 +850,8 @@ def get_current_user_application_key( def get_personal_access_token( self, token_id: str, + *, + include: Union[List[PersonalAccessTokensIncludeQueryParameterItem], UnsetType] = unset, ) -> PersonalAccessTokenResponse: """Get a personal access token. @@ -836,11 +859,16 @@ def get_personal_access_token( :param token_id: The ID of the access token. :type token_id: str + :param include: Comma-separated list of relationship objects that should be included in the response. + :type include: [PersonalAccessTokensIncludeQueryParameterItem], optional :rtype: PersonalAccessTokenResponse """ kwargs: Dict[str, Any] = {} kwargs["token_id"] = token_id + if include is not unset: + kwargs["include"] = include + return self._get_personal_access_token_endpoint.call_with_http_info(**kwargs) def list_api_keys( @@ -1052,6 +1080,8 @@ def list_personal_access_tokens( sort: Union[PersonalAccessTokensSort, UnsetType] = unset, filter: Union[str, UnsetType] = unset, filter_owned_by: Union[List[str], UnsetType] = unset, + filter_leaked: Union[bool, UnsetType] = unset, + include: Union[List[PersonalAccessTokensIncludeQueryParameterItem], UnsetType] = unset, ) -> ListPersonalAccessTokensResponse: """Get all access tokens. @@ -1069,6 +1099,10 @@ def list_personal_access_tokens( :type filter: str, optional :param filter_owned_by: Filter access tokens by the owner's ID. Supports multiple values. :type filter_owned_by: [str], optional + :param filter_leaked: When true, only return access tokens that have been detected as leaked. Has no effect when false. + :type filter_leaked: bool, optional + :param include: Comma-separated list of relationship objects that should be included in the response. + :type include: [PersonalAccessTokensIncludeQueryParameterItem], optional :rtype: ListPersonalAccessTokensResponse """ kwargs: Dict[str, Any] = {} @@ -1087,6 +1121,12 @@ def list_personal_access_tokens( if filter_owned_by is not unset: kwargs["filter_owned_by"] = filter_owned_by + if filter_leaked is not unset: + kwargs["filter_leaked"] = filter_leaked + + if include is not unset: + kwargs["include"] = include + return self._list_personal_access_tokens_endpoint.call_with_http_info(**kwargs) def revoke_personal_access_token( @@ -1174,7 +1214,7 @@ def update_personal_access_token( self, token_id: str, body: PersonalAccessTokenUpdateRequest, - ) -> PersonalAccessTokenResponse: + ) -> UpdatedPersonalAccessTokenResponse: """Update a personal access token. Update a specific personal access token. @@ -1182,7 +1222,7 @@ def update_personal_access_token( :param token_id: The ID of the access token. :type token_id: str :type body: PersonalAccessTokenUpdateRequest - :rtype: PersonalAccessTokenResponse + :rtype: UpdatedPersonalAccessTokenResponse """ kwargs: Dict[str, Any] = {} kwargs["token_id"] = token_id diff --git a/src/datadog_api_client/v2/api/service_accounts_api.py b/src/datadog_api_client/v2/api/service_accounts_api.py index dd476fc4dd..c4884ecd34 100644 --- a/src/datadog_api_client/v2/api/service_accounts_api.py +++ b/src/datadog_api_client/v2/api/service_accounts_api.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Any, Dict, Union +from typing import Any, Dict, List, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration @@ -15,11 +15,15 @@ from datadog_api_client.v2.model.service_account_create_request import ServiceAccountCreateRequest from datadog_api_client.v2.model.list_service_access_tokens_response import ListServiceAccessTokensResponse from datadog_api_client.v2.model.personal_access_tokens_sort import PersonalAccessTokensSort +from datadog_api_client.v2.model.personal_access_tokens_include_query_parameter_item import ( + PersonalAccessTokensIncludeQueryParameterItem, +) from datadog_api_client.v2.model.service_access_token_create_response import ServiceAccessTokenCreateResponse from datadog_api_client.v2.model.service_account_access_token_create_request import ( ServiceAccountAccessTokenCreateRequest, ) from datadog_api_client.v2.model.service_access_token_response import ServiceAccessTokenResponse +from datadog_api_client.v2.model.updated_service_access_token_response import UpdatedServiceAccessTokenResponse from datadog_api_client.v2.model.service_account_access_token_update_request import ( ServiceAccountAccessTokenUpdateRequest, ) @@ -164,6 +168,12 @@ def __init__(self, api_client=None): "attribute": "token_id", "location": "path", }, + "include": { + "openapi_types": ([PersonalAccessTokensIncludeQueryParameterItem],), + "attribute": "include", + "location": "query", + "collection_format": "csv", + }, }, headers_map={ "accept": ["application/json"], @@ -236,6 +246,17 @@ def __init__(self, api_client=None): "attribute": "filter", "location": "query", }, + "filter_leaked": { + "openapi_types": (bool,), + "attribute": "filter[leaked]", + "location": "query", + }, + "include": { + "openapi_types": ([PersonalAccessTokensIncludeQueryParameterItem],), + "attribute": "include", + "location": "query", + "collection_format": "csv", + }, }, headers_map={ "accept": ["application/json"], @@ -327,7 +348,7 @@ def __init__(self, api_client=None): self._update_service_account_access_token_endpoint = _Endpoint( settings={ - "response_type": (ServiceAccessTokenResponse,), + "response_type": (UpdatedServiceAccessTokenResponse,), "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], "endpoint_path": "/api/v2/service_accounts/{service_account_id}/access_tokens/{token_id}", "operation_id": "update_service_account_access_token", @@ -473,6 +494,8 @@ def get_service_account_access_token( self, service_account_id: str, token_id: str, + *, + include: Union[List[PersonalAccessTokensIncludeQueryParameterItem], UnsetType] = unset, ) -> ServiceAccessTokenResponse: """Get an access token for a service account. @@ -482,6 +505,8 @@ def get_service_account_access_token( :type service_account_id: str :param token_id: The ID of the access token. :type token_id: str + :param include: Comma-separated list of relationship objects that should be included in the response. + :type include: [PersonalAccessTokensIncludeQueryParameterItem], optional :rtype: ServiceAccessTokenResponse """ kwargs: Dict[str, Any] = {} @@ -489,6 +514,9 @@ def get_service_account_access_token( kwargs["token_id"] = token_id + if include is not unset: + kwargs["include"] = include + return self._get_service_account_access_token_endpoint.call_with_http_info(**kwargs) def get_service_account_application_key( @@ -521,6 +549,8 @@ def list_service_account_access_tokens( page_number: Union[int, UnsetType] = unset, sort: Union[PersonalAccessTokensSort, UnsetType] = unset, filter: Union[str, UnsetType] = unset, + filter_leaked: Union[bool, UnsetType] = unset, + include: Union[List[PersonalAccessTokensIncludeQueryParameterItem], UnsetType] = unset, ) -> ListServiceAccessTokensResponse: """List access tokens for a service account. @@ -538,6 +568,10 @@ def list_service_account_access_tokens( :type sort: PersonalAccessTokensSort, optional :param filter: Filter access tokens by the specified string. :type filter: str, optional + :param filter_leaked: When true, only return access tokens that have been detected as leaked. Has no effect when false. + :type filter_leaked: bool, optional + :param include: Comma-separated list of relationship objects that should be included in the response. + :type include: [PersonalAccessTokensIncludeQueryParameterItem], optional :rtype: ListServiceAccessTokensResponse """ kwargs: Dict[str, Any] = {} @@ -555,6 +589,12 @@ def list_service_account_access_tokens( if filter is not unset: kwargs["filter"] = filter + if filter_leaked is not unset: + kwargs["filter_leaked"] = filter_leaked + + if include is not unset: + kwargs["include"] = include + return self._list_service_account_access_tokens_endpoint.call_with_http_info(**kwargs) def list_service_account_application_keys( @@ -640,7 +680,7 @@ def update_service_account_access_token( service_account_id: str, token_id: str, body: ServiceAccountAccessTokenUpdateRequest, - ) -> ServiceAccessTokenResponse: + ) -> UpdatedServiceAccessTokenResponse: """Update an access token for a service account. Update a specific access token for a service account. @@ -650,7 +690,7 @@ def update_service_account_access_token( :param token_id: The ID of the access token. :type token_id: str :type body: ServiceAccountAccessTokenUpdateRequest - :rtype: ServiceAccessTokenResponse + :rtype: UpdatedServiceAccessTokenResponse """ kwargs: Dict[str, Any] = {} kwargs["service_account_id"] = service_account_id diff --git a/src/datadog_api_client/v2/model/access_token_list_item_relationships.py b/src/datadog_api_client/v2/model/access_token_list_item_relationships.py index 438742d9a4..d87e2bff53 100644 --- a/src/datadog_api_client/v2/model/access_token_list_item_relationships.py +++ b/src/datadog_api_client/v2/model/access_token_list_item_relationships.py @@ -14,29 +14,43 @@ if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_leaked_key import RelationshipToLeakedKey from datadog_api_client.v2.model.relationship_to_access_token_owner import RelationshipToAccessTokenOwner class AccessTokenListItemRelationships(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_leaked_key import RelationshipToLeakedKey from datadog_api_client.v2.model.relationship_to_access_token_owner import RelationshipToAccessTokenOwner return { + "leak_information": (RelationshipToLeakedKey,), "owned_by": (RelationshipToAccessTokenOwner,), } attribute_map = { + "leak_information": "leak_information", "owned_by": "owned_by", } - def __init__(self_, owned_by: Union[RelationshipToAccessTokenOwner, UnsetType] = unset, **kwargs): + def __init__( + self_, + leak_information: Union[RelationshipToLeakedKey, UnsetType] = unset, + owned_by: Union[RelationshipToAccessTokenOwner, UnsetType] = unset, + **kwargs, + ): """ Resources related to the access token entry in the mixed list response. + :param leak_information: Relationship to the leak the access token was found in. ``data`` is null when the access token has not been detected as leaked. + :type leak_information: RelationshipToLeakedKey, optional + :param owned_by: Relationship to the access token's owner. :type owned_by: RelationshipToAccessTokenOwner, optional """ + if leak_information is not unset: + kwargs["leak_information"] = leak_information if owned_by is not unset: kwargs["owned_by"] = owned_by super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/access_token_response_included_item.py b/src/datadog_api_client/v2/model/access_token_response_included_item.py new file mode 100644 index 0000000000..e461e94814 --- /dev/null +++ b/src/datadog_api_client/v2/model/access_token_response_included_item.py @@ -0,0 +1,44 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelComposed, + cached_property, +) + + +class AccessTokenResponseIncludedItem(ModelComposed): + def __init__(self, **kwargs): + """ + An object related to an access token. + + :param attributes: The definition of LeakedKeyAttributes object. + :type attributes: LeakedKeyAttributes + + :param id: The LeakedKey id. + :type id: str + + :param type: The definition of LeakedKeyType object. + :type type: LeakedKeyType + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.leaked_key import LeakedKey + + return { + "oneOf": [ + LeakedKey, + ], + } diff --git a/src/datadog_api_client/v2/model/full_personal_access_token.py b/src/datadog_api_client/v2/model/full_personal_access_token.py index 27f2875db4..2443d1940b 100644 --- a/src/datadog_api_client/v2/model/full_personal_access_token.py +++ b/src/datadog_api_client/v2/model/full_personal_access_token.py @@ -15,7 +15,9 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.full_personal_access_token_attributes import FullPersonalAccessTokenAttributes - from datadog_api_client.v2.model.personal_access_token_relationships import PersonalAccessTokenRelationships + from datadog_api_client.v2.model.full_personal_access_token_relationships import ( + FullPersonalAccessTokenRelationships, + ) from datadog_api_client.v2.model.personal_access_tokens_type import PersonalAccessTokensType @@ -23,13 +25,15 @@ class FullPersonalAccessToken(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.full_personal_access_token_attributes import FullPersonalAccessTokenAttributes - from datadog_api_client.v2.model.personal_access_token_relationships import PersonalAccessTokenRelationships + from datadog_api_client.v2.model.full_personal_access_token_relationships import ( + FullPersonalAccessTokenRelationships, + ) from datadog_api_client.v2.model.personal_access_tokens_type import PersonalAccessTokensType return { "attributes": (FullPersonalAccessTokenAttributes,), "id": (str,), - "relationships": (PersonalAccessTokenRelationships,), + "relationships": (FullPersonalAccessTokenRelationships,), "type": (PersonalAccessTokensType,), } @@ -44,7 +48,7 @@ def __init__( self_, attributes: Union[FullPersonalAccessTokenAttributes, UnsetType] = unset, id: Union[str, UnsetType] = unset, - relationships: Union[PersonalAccessTokenRelationships, UnsetType] = unset, + relationships: Union[FullPersonalAccessTokenRelationships, UnsetType] = unset, type: Union[PersonalAccessTokensType, UnsetType] = unset, **kwargs, ): @@ -58,7 +62,7 @@ def __init__( :type id: str, optional :param relationships: Resources related to the access token. - :type relationships: PersonalAccessTokenRelationships, optional + :type relationships: FullPersonalAccessTokenRelationships, optional :param type: Personal access tokens resource type. :type type: PersonalAccessTokensType, optional diff --git a/src/datadog_api_client/v2/model/full_personal_access_token_relationships.py b/src/datadog_api_client/v2/model/full_personal_access_token_relationships.py new file mode 100644 index 0000000000..2c6a3afeaf --- /dev/null +++ b/src/datadog_api_client/v2/model/full_personal_access_token_relationships.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + + +class FullPersonalAccessTokenRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + + return { + "owned_by": (RelationshipToUser,), + } + + attribute_map = { + "owned_by": "owned_by", + } + + def __init__(self_, owned_by: Union[RelationshipToUser, UnsetType] = unset, **kwargs): + """ + Resources related to the access token. + + :param owned_by: Relationship to user. + :type owned_by: RelationshipToUser, optional + """ + if owned_by is not unset: + kwargs["owned_by"] = owned_by + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/full_service_access_token.py b/src/datadog_api_client/v2/model/full_service_access_token.py index 111f2c5d57..168021328a 100644 --- a/src/datadog_api_client/v2/model/full_service_access_token.py +++ b/src/datadog_api_client/v2/model/full_service_access_token.py @@ -15,7 +15,7 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.full_service_access_token_attributes import FullServiceAccessTokenAttributes - from datadog_api_client.v2.model.service_access_token_relationships import ServiceAccessTokenRelationships + from datadog_api_client.v2.model.full_service_access_token_relationships import FullServiceAccessTokenRelationships from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType @@ -23,13 +23,15 @@ class FullServiceAccessToken(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.full_service_access_token_attributes import FullServiceAccessTokenAttributes - from datadog_api_client.v2.model.service_access_token_relationships import ServiceAccessTokenRelationships + from datadog_api_client.v2.model.full_service_access_token_relationships import ( + FullServiceAccessTokenRelationships, + ) from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType return { "attributes": (FullServiceAccessTokenAttributes,), "id": (str,), - "relationships": (ServiceAccessTokenRelationships,), + "relationships": (FullServiceAccessTokenRelationships,), "type": (ServiceAccessTokensType,), } @@ -44,7 +46,7 @@ def __init__( self_, attributes: Union[FullServiceAccessTokenAttributes, UnsetType] = unset, id: Union[str, UnsetType] = unset, - relationships: Union[ServiceAccessTokenRelationships, UnsetType] = unset, + relationships: Union[FullServiceAccessTokenRelationships, UnsetType] = unset, type: Union[ServiceAccessTokensType, UnsetType] = unset, **kwargs, ): @@ -58,7 +60,7 @@ def __init__( :type id: str, optional :param relationships: Resources related to the access token. - :type relationships: ServiceAccessTokenRelationships, optional + :type relationships: FullServiceAccessTokenRelationships, optional :param type: Service access tokens resource type. :type type: ServiceAccessTokensType, optional diff --git a/src/datadog_api_client/v2/model/full_service_access_token_relationships.py b/src/datadog_api_client/v2/model/full_service_access_token_relationships.py new file mode 100644 index 0000000000..56a1430a38 --- /dev/null +++ b/src/datadog_api_client/v2/model/full_service_access_token_relationships.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_service_account import RelationshipToServiceAccount + + +class FullServiceAccessTokenRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_service_account import RelationshipToServiceAccount + + return { + "owned_by": (RelationshipToServiceAccount,), + } + + attribute_map = { + "owned_by": "owned_by", + } + + def __init__(self_, owned_by: Union[RelationshipToServiceAccount, UnsetType] = unset, **kwargs): + """ + Resources related to the access token. + + :param owned_by: Relationship to service account. + :type owned_by: RelationshipToServiceAccount, optional + """ + if owned_by is not unset: + kwargs["owned_by"] = owned_by + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/list_personal_access_tokens_response.py b/src/datadog_api_client/v2/model/list_personal_access_tokens_response.py index faffe264e7..100cedda90 100644 --- a/src/datadog_api_client/v2/model/list_personal_access_tokens_response.py +++ b/src/datadog_api_client/v2/model/list_personal_access_tokens_response.py @@ -15,28 +15,34 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.access_token_list_item import AccessTokenListItem + from datadog_api_client.v2.model.access_token_response_included_item import AccessTokenResponseIncludedItem from datadog_api_client.v2.model.personal_access_token_response_meta import PersonalAccessTokenResponseMeta + from datadog_api_client.v2.model.leaked_key import LeakedKey class ListPersonalAccessTokensResponse(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.access_token_list_item import AccessTokenListItem + from datadog_api_client.v2.model.access_token_response_included_item import AccessTokenResponseIncludedItem from datadog_api_client.v2.model.personal_access_token_response_meta import PersonalAccessTokenResponseMeta return { "data": ([AccessTokenListItem],), + "included": ([AccessTokenResponseIncludedItem],), "meta": (PersonalAccessTokenResponseMeta,), } attribute_map = { "data": "data", + "included": "included", "meta": "meta", } def __init__( self_, data: Union[List[AccessTokenListItem], UnsetType] = unset, + included: Union[List[Union[AccessTokenResponseIncludedItem, LeakedKey]], UnsetType] = unset, meta: Union[PersonalAccessTokenResponseMeta, UnsetType] = unset, **kwargs, ): @@ -46,11 +52,16 @@ def __init__( :param data: Array of access tokens. Includes both personal and service access tokens. :type data: [AccessTokenListItem], optional + :param included: Array of objects related to the access tokens. + :type included: [AccessTokenResponseIncludedItem], optional + :param meta: Additional information related to the access token response. :type meta: PersonalAccessTokenResponseMeta, optional """ if data is not unset: kwargs["data"] = data + if included is not unset: + kwargs["included"] = included if meta is not unset: kwargs["meta"] = meta super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/list_service_access_tokens_response.py b/src/datadog_api_client/v2/model/list_service_access_tokens_response.py index 96814f500a..72a66694e6 100644 --- a/src/datadog_api_client/v2/model/list_service_access_tokens_response.py +++ b/src/datadog_api_client/v2/model/list_service_access_tokens_response.py @@ -15,28 +15,34 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.service_access_token import ServiceAccessToken + from datadog_api_client.v2.model.access_token_response_included_item import AccessTokenResponseIncludedItem from datadog_api_client.v2.model.service_access_token_response_meta import ServiceAccessTokenResponseMeta + from datadog_api_client.v2.model.leaked_key import LeakedKey class ListServiceAccessTokensResponse(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.service_access_token import ServiceAccessToken + from datadog_api_client.v2.model.access_token_response_included_item import AccessTokenResponseIncludedItem from datadog_api_client.v2.model.service_access_token_response_meta import ServiceAccessTokenResponseMeta return { "data": ([ServiceAccessToken],), + "included": ([AccessTokenResponseIncludedItem],), "meta": (ServiceAccessTokenResponseMeta,), } attribute_map = { "data": "data", + "included": "included", "meta": "meta", } def __init__( self_, data: Union[List[ServiceAccessToken], UnsetType] = unset, + included: Union[List[Union[AccessTokenResponseIncludedItem, LeakedKey]], UnsetType] = unset, meta: Union[ServiceAccessTokenResponseMeta, UnsetType] = unset, **kwargs, ): @@ -46,11 +52,16 @@ def __init__( :param data: Array of access tokens. :type data: [ServiceAccessToken], optional + :param included: Array of objects related to the access tokens. + :type included: [AccessTokenResponseIncludedItem], optional + :param meta: Additional information related to the access token response. :type meta: ServiceAccessTokenResponseMeta, optional """ if data is not unset: kwargs["data"] = data + if included is not unset: + kwargs["included"] = included if meta is not unset: kwargs["meta"] = meta super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/personal_access_token_relationships.py b/src/datadog_api_client/v2/model/personal_access_token_relationships.py index 2b76301c40..4fe505a145 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_relationships.py +++ b/src/datadog_api_client/v2/model/personal_access_token_relationships.py @@ -14,29 +14,43 @@ if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_leaked_key import RelationshipToLeakedKey from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser class PersonalAccessTokenRelationships(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_leaked_key import RelationshipToLeakedKey from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser return { + "leak_information": (RelationshipToLeakedKey,), "owned_by": (RelationshipToUser,), } attribute_map = { + "leak_information": "leak_information", "owned_by": "owned_by", } - def __init__(self_, owned_by: Union[RelationshipToUser, UnsetType] = unset, **kwargs): + def __init__( + self_, + leak_information: Union[RelationshipToLeakedKey, UnsetType] = unset, + owned_by: Union[RelationshipToUser, UnsetType] = unset, + **kwargs, + ): """ Resources related to the access token. + :param leak_information: Relationship to the leak the access token was found in. ``data`` is null when the access token has not been detected as leaked. + :type leak_information: RelationshipToLeakedKey, optional + :param owned_by: Relationship to user. :type owned_by: RelationshipToUser, optional """ + if leak_information is not unset: + kwargs["leak_information"] = leak_information if owned_by is not unset: kwargs["owned_by"] = owned_by super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/personal_access_token_response.py b/src/datadog_api_client/v2/model/personal_access_token_response.py index 64976aac63..c2ae5f0d71 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_response.py +++ b/src/datadog_api_client/v2/model/personal_access_token_response.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Union, TYPE_CHECKING +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -15,28 +15,43 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.personal_access_token import PersonalAccessToken + from datadog_api_client.v2.model.access_token_response_included_item import AccessTokenResponseIncludedItem + from datadog_api_client.v2.model.leaked_key import LeakedKey class PersonalAccessTokenResponse(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.personal_access_token import PersonalAccessToken + from datadog_api_client.v2.model.access_token_response_included_item import AccessTokenResponseIncludedItem return { "data": (PersonalAccessToken,), + "included": ([AccessTokenResponseIncludedItem],), } attribute_map = { "data": "data", + "included": "included", } - def __init__(self_, data: Union[PersonalAccessToken, UnsetType] = unset, **kwargs): + def __init__( + self_, + data: Union[PersonalAccessToken, UnsetType] = unset, + included: Union[List[Union[AccessTokenResponseIncludedItem, LeakedKey]], UnsetType] = unset, + **kwargs, + ): """ Response for retrieving an access token. :param data: Datadog access token. :type data: PersonalAccessToken, optional + + :param included: Array of objects related to the access tokens. + :type included: [AccessTokenResponseIncludedItem], optional """ if data is not unset: kwargs["data"] = data + if included is not unset: + kwargs["included"] = included super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/personal_access_tokens_include_query_parameter_item.py b/src/datadog_api_client/v2/model/personal_access_tokens_include_query_parameter_item.py new file mode 100644 index 0000000000..7061e0cd79 --- /dev/null +++ b/src/datadog_api_client/v2/model/personal_access_tokens_include_query_parameter_item.py @@ -0,0 +1,37 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class PersonalAccessTokensIncludeQueryParameterItem(ModelSimple): + """ + Relationship object that should be included in the response. + + :param value: If omitted defaults to "leak_information". Must be one of ["leak_information"]. + :type value: str + """ + + allowed_values = { + "leak_information", + } + LEAK_INFORMATION: ClassVar["PersonalAccessTokensIncludeQueryParameterItem"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +PersonalAccessTokensIncludeQueryParameterItem.LEAK_INFORMATION = PersonalAccessTokensIncludeQueryParameterItem( + "leak_information" +) diff --git a/src/datadog_api_client/v2/model/personal_access_tokens_sort.py b/src/datadog_api_client/v2/model/personal_access_tokens_sort.py index 2bd4f0d216..e9d7867849 100644 --- a/src/datadog_api_client/v2/model/personal_access_tokens_sort.py +++ b/src/datadog_api_client/v2/model/personal_access_tokens_sort.py @@ -16,7 +16,7 @@ class PersonalAccessTokensSort(ModelSimple): """ Sorting options - :param value: If omitted defaults to "name". Must be one of ["name", "-name", "created_at", "-created_at", "expires_at", "-expires_at", "last_used_at", "-last_used_at"]. + :param value: If omitted defaults to "name". Must be one of ["name", "-name", "created_at", "-created_at", "expires_at", "-expires_at", "last_used_at", "-last_used_at", "leaked", "-leaked"]. :type value: str """ @@ -29,6 +29,8 @@ class PersonalAccessTokensSort(ModelSimple): "-expires_at", "last_used_at", "-last_used_at", + "leaked", + "-leaked", } NAME_ASCENDING: ClassVar["PersonalAccessTokensSort"] NAME_DESCENDING: ClassVar["PersonalAccessTokensSort"] @@ -38,6 +40,8 @@ class PersonalAccessTokensSort(ModelSimple): EXPIRES_AT_DESCENDING: ClassVar["PersonalAccessTokensSort"] LAST_USED_AT_ASCENDING: ClassVar["PersonalAccessTokensSort"] LAST_USED_AT_DESCENDING: ClassVar["PersonalAccessTokensSort"] + LEAKED_ASCENDING: ClassVar["PersonalAccessTokensSort"] + LEAKED_DESCENDING: ClassVar["PersonalAccessTokensSort"] @cached_property def openapi_types(_): @@ -54,3 +58,5 @@ def openapi_types(_): PersonalAccessTokensSort.EXPIRES_AT_DESCENDING = PersonalAccessTokensSort("-expires_at") PersonalAccessTokensSort.LAST_USED_AT_ASCENDING = PersonalAccessTokensSort("last_used_at") PersonalAccessTokensSort.LAST_USED_AT_DESCENDING = PersonalAccessTokensSort("-last_used_at") +PersonalAccessTokensSort.LEAKED_ASCENDING = PersonalAccessTokensSort("leaked") +PersonalAccessTokensSort.LEAKED_DESCENDING = PersonalAccessTokensSort("-leaked") diff --git a/src/datadog_api_client/v2/model/relationship_to_leaked_key.py b/src/datadog_api_client/v2/model/relationship_to_leaked_key.py new file mode 100644 index 0000000000..ba5f988dcc --- /dev/null +++ b/src/datadog_api_client/v2/model/relationship_to_leaked_key.py @@ -0,0 +1,41 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + none_type, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_leaked_key_data import RelationshipToLeakedKeyData + + +class RelationshipToLeakedKey(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_leaked_key_data import RelationshipToLeakedKeyData + + return { + "data": (RelationshipToLeakedKeyData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[RelationshipToLeakedKeyData, none_type], **kwargs): + """ + Relationship to the leak the access token was found in. ``data`` is null when the access token has not been detected as leaked. + + :param data: Relationship to the leak the access token was found in. + :type data: RelationshipToLeakedKeyData, none_type + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/relationship_to_leaked_key_data.py b/src/datadog_api_client/v2/model/relationship_to_leaked_key_data.py new file mode 100644 index 0000000000..dc75ca3240 --- /dev/null +++ b/src/datadog_api_client/v2/model/relationship_to_leaked_key_data.py @@ -0,0 +1,48 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.leaked_key_type import LeakedKeyType + + +class RelationshipToLeakedKeyData(ModelNormal): + _nullable = True + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.leaked_key_type import LeakedKeyType + + return { + "id": (str,), + "type": (LeakedKeyType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: LeakedKeyType, **kwargs): + """ + Relationship to the leak the access token was found in. + + :param id: A unique identifier that represents the leak. + :type id: str + + :param type: The definition of LeakedKeyType object. + :type type: LeakedKeyType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_access_token_relationships.py b/src/datadog_api_client/v2/model/service_access_token_relationships.py index 568e87e5b6..6cf92b873c 100644 --- a/src/datadog_api_client/v2/model/service_access_token_relationships.py +++ b/src/datadog_api_client/v2/model/service_access_token_relationships.py @@ -14,29 +14,43 @@ if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_leaked_key import RelationshipToLeakedKey from datadog_api_client.v2.model.relationship_to_service_account import RelationshipToServiceAccount class ServiceAccessTokenRelationships(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_leaked_key import RelationshipToLeakedKey from datadog_api_client.v2.model.relationship_to_service_account import RelationshipToServiceAccount return { + "leak_information": (RelationshipToLeakedKey,), "owned_by": (RelationshipToServiceAccount,), } attribute_map = { + "leak_information": "leak_information", "owned_by": "owned_by", } - def __init__(self_, owned_by: Union[RelationshipToServiceAccount, UnsetType] = unset, **kwargs): + def __init__( + self_, + leak_information: Union[RelationshipToLeakedKey, UnsetType] = unset, + owned_by: Union[RelationshipToServiceAccount, UnsetType] = unset, + **kwargs, + ): """ Resources related to the access token. + :param leak_information: Relationship to the leak the access token was found in. ``data`` is null when the access token has not been detected as leaked. + :type leak_information: RelationshipToLeakedKey, optional + :param owned_by: Relationship to service account. :type owned_by: RelationshipToServiceAccount, optional """ + if leak_information is not unset: + kwargs["leak_information"] = leak_information if owned_by is not unset: kwargs["owned_by"] = owned_by super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_access_token_response.py b/src/datadog_api_client/v2/model/service_access_token_response.py index b453a89d4a..6c0fc9a59c 100644 --- a/src/datadog_api_client/v2/model/service_access_token_response.py +++ b/src/datadog_api_client/v2/model/service_access_token_response.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Union, TYPE_CHECKING +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -15,28 +15,43 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.service_access_token import ServiceAccessToken + from datadog_api_client.v2.model.access_token_response_included_item import AccessTokenResponseIncludedItem + from datadog_api_client.v2.model.leaked_key import LeakedKey class ServiceAccessTokenResponse(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.service_access_token import ServiceAccessToken + from datadog_api_client.v2.model.access_token_response_included_item import AccessTokenResponseIncludedItem return { "data": (ServiceAccessToken,), + "included": ([AccessTokenResponseIncludedItem],), } attribute_map = { "data": "data", + "included": "included", } - def __init__(self_, data: Union[ServiceAccessToken, UnsetType] = unset, **kwargs): + def __init__( + self_, + data: Union[ServiceAccessToken, UnsetType] = unset, + included: Union[List[Union[AccessTokenResponseIncludedItem, LeakedKey]], UnsetType] = unset, + **kwargs, + ): """ Response for retrieving an access token. :param data: Datadog access token. :type data: ServiceAccessToken, optional + + :param included: Array of objects related to the access tokens. + :type included: [AccessTokenResponseIncludedItem], optional """ if data is not unset: kwargs["data"] = data + if included is not unset: + kwargs["included"] = included super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/updated_personal_access_token.py b/src/datadog_api_client/v2/model/updated_personal_access_token.py new file mode 100644 index 0000000000..80c272d7da --- /dev/null +++ b/src/datadog_api_client/v2/model/updated_personal_access_token.py @@ -0,0 +1,77 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.personal_access_token_attributes import PersonalAccessTokenAttributes + from datadog_api_client.v2.model.updated_personal_access_token_relationships import ( + UpdatedPersonalAccessTokenRelationships, + ) + from datadog_api_client.v2.model.personal_access_tokens_type import PersonalAccessTokensType + + +class UpdatedPersonalAccessToken(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.personal_access_token_attributes import PersonalAccessTokenAttributes + from datadog_api_client.v2.model.updated_personal_access_token_relationships import ( + UpdatedPersonalAccessTokenRelationships, + ) + from datadog_api_client.v2.model.personal_access_tokens_type import PersonalAccessTokensType + + return { + "attributes": (PersonalAccessTokenAttributes,), + "id": (str,), + "relationships": (UpdatedPersonalAccessTokenRelationships,), + "type": (PersonalAccessTokensType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + id: str, + type: PersonalAccessTokensType, + attributes: Union[PersonalAccessTokenAttributes, UnsetType] = unset, + relationships: Union[UpdatedPersonalAccessTokenRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Datadog access token returned by the update endpoint. + + :param attributes: Attributes of an access token. + :type attributes: PersonalAccessTokenAttributes, optional + + :param id: ID of the access token. + :type id: str + + :param relationships: Resources related to the access token. + :type relationships: UpdatedPersonalAccessTokenRelationships, optional + + :param type: Personal access tokens resource type. + :type type: PersonalAccessTokensType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/updated_personal_access_token_relationships.py b/src/datadog_api_client/v2/model/updated_personal_access_token_relationships.py new file mode 100644 index 0000000000..8ff5a9cc97 --- /dev/null +++ b/src/datadog_api_client/v2/model/updated_personal_access_token_relationships.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + + +class UpdatedPersonalAccessTokenRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_user import RelationshipToUser + + return { + "owned_by": (RelationshipToUser,), + } + + attribute_map = { + "owned_by": "owned_by", + } + + def __init__(self_, owned_by: Union[RelationshipToUser, UnsetType] = unset, **kwargs): + """ + Resources related to the access token. + + :param owned_by: Relationship to user. + :type owned_by: RelationshipToUser, optional + """ + if owned_by is not unset: + kwargs["owned_by"] = owned_by + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/updated_personal_access_token_response.py b/src/datadog_api_client/v2/model/updated_personal_access_token_response.py new file mode 100644 index 0000000000..3fcd9c6731 --- /dev/null +++ b/src/datadog_api_client/v2/model/updated_personal_access_token_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.updated_personal_access_token import UpdatedPersonalAccessToken + + +class UpdatedPersonalAccessTokenResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.updated_personal_access_token import UpdatedPersonalAccessToken + + return { + "data": (UpdatedPersonalAccessToken,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UpdatedPersonalAccessToken, **kwargs): + """ + Response for updating an access token. + + :param data: Datadog access token returned by the update endpoint. + :type data: UpdatedPersonalAccessToken + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/updated_service_access_token.py b/src/datadog_api_client/v2/model/updated_service_access_token.py new file mode 100644 index 0000000000..b43fda44a9 --- /dev/null +++ b/src/datadog_api_client/v2/model/updated_service_access_token.py @@ -0,0 +1,77 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_access_token_attributes import ServiceAccessTokenAttributes + from datadog_api_client.v2.model.updated_service_access_token_relationships import ( + UpdatedServiceAccessTokenRelationships, + ) + from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType + + +class UpdatedServiceAccessToken(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_access_token_attributes import ServiceAccessTokenAttributes + from datadog_api_client.v2.model.updated_service_access_token_relationships import ( + UpdatedServiceAccessTokenRelationships, + ) + from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType + + return { + "attributes": (ServiceAccessTokenAttributes,), + "id": (str,), + "relationships": (UpdatedServiceAccessTokenRelationships,), + "type": (ServiceAccessTokensType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + id: str, + type: ServiceAccessTokensType, + attributes: Union[ServiceAccessTokenAttributes, UnsetType] = unset, + relationships: Union[UpdatedServiceAccessTokenRelationships, UnsetType] = unset, + **kwargs, + ): + """ + Datadog access token returned by the update endpoint. + + :param attributes: Attributes of an access token. + :type attributes: ServiceAccessTokenAttributes, optional + + :param id: ID of the access token. + :type id: str + + :param relationships: Resources related to the access token. + :type relationships: UpdatedServiceAccessTokenRelationships, optional + + :param type: Service access tokens resource type. + :type type: ServiceAccessTokensType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/updated_service_access_token_relationships.py b/src/datadog_api_client/v2/model/updated_service_access_token_relationships.py new file mode 100644 index 0000000000..e7068d03bc --- /dev/null +++ b/src/datadog_api_client/v2/model/updated_service_access_token_relationships.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_service_account import RelationshipToServiceAccount + + +class UpdatedServiceAccessTokenRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_service_account import RelationshipToServiceAccount + + return { + "owned_by": (RelationshipToServiceAccount,), + } + + attribute_map = { + "owned_by": "owned_by", + } + + def __init__(self_, owned_by: Union[RelationshipToServiceAccount, UnsetType] = unset, **kwargs): + """ + Resources related to the access token. + + :param owned_by: Relationship to service account. + :type owned_by: RelationshipToServiceAccount, optional + """ + if owned_by is not unset: + kwargs["owned_by"] = owned_by + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/updated_service_access_token_response.py b/src/datadog_api_client/v2/model/updated_service_access_token_response.py new file mode 100644 index 0000000000..f8d425f130 --- /dev/null +++ b/src/datadog_api_client/v2/model/updated_service_access_token_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.updated_service_access_token import UpdatedServiceAccessToken + + +class UpdatedServiceAccessTokenResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.updated_service_access_token import UpdatedServiceAccessToken + + return { + "data": (UpdatedServiceAccessToken,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: UpdatedServiceAccessToken, **kwargs): + """ + Response for updating an access token. + + :param data: Datadog access token returned by the update endpoint. + :type data: UpdatedServiceAccessToken + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index a8fbacf823..6d122b593e 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -166,6 +166,7 @@ from datadog_api_client.v2.model.access_token_list_item import AccessTokenListItem from datadog_api_client.v2.model.access_token_list_item_relationships import AccessTokenListItemRelationships from datadog_api_client.v2.model.access_token_owner_type import AccessTokenOwnerType +from datadog_api_client.v2.model.access_token_response_included_item import AccessTokenResponseIncludedItem from datadog_api_client.v2.model.access_tokens_type import AccessTokensType from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig from datadog_api_client.v2.model.account_filters import AccountFilters @@ -3533,8 +3534,10 @@ from datadog_api_client.v2.model.full_custom_framework_data_attributes import FullCustomFrameworkDataAttributes from datadog_api_client.v2.model.full_personal_access_token import FullPersonalAccessToken from datadog_api_client.v2.model.full_personal_access_token_attributes import FullPersonalAccessTokenAttributes +from datadog_api_client.v2.model.full_personal_access_token_relationships import FullPersonalAccessTokenRelationships from datadog_api_client.v2.model.full_service_access_token import FullServiceAccessToken from datadog_api_client.v2.model.full_service_access_token_attributes import FullServiceAccessTokenAttributes +from datadog_api_client.v2.model.full_service_access_token_relationships import FullServiceAccessTokenRelationships from datadog_api_client.v2.model.gcp_credentials import GCPCredentials from datadog_api_client.v2.model.gcp_credentials_update import GCPCredentialsUpdate from datadog_api_client.v2.model.gcp_integration import GCPIntegration @@ -7507,6 +7510,9 @@ from datadog_api_client.v2.model.personal_access_token_update_attributes import PersonalAccessTokenUpdateAttributes from datadog_api_client.v2.model.personal_access_token_update_data import PersonalAccessTokenUpdateData from datadog_api_client.v2.model.personal_access_token_update_request import PersonalAccessTokenUpdateRequest +from datadog_api_client.v2.model.personal_access_tokens_include_query_parameter_item import ( + PersonalAccessTokensIncludeQueryParameterItem, +) from datadog_api_client.v2.model.personal_access_tokens_sort import PersonalAccessTokensSort from datadog_api_client.v2.model.personal_access_tokens_type import PersonalAccessTokensType from datadog_api_client.v2.model.playlist import Playlist @@ -8208,6 +8214,8 @@ from datadog_api_client.v2.model.relationship_to_incident_user_defined_fields import ( RelationshipToIncidentUserDefinedFields, ) +from datadog_api_client.v2.model.relationship_to_leaked_key import RelationshipToLeakedKey +from datadog_api_client.v2.model.relationship_to_leaked_key_data import RelationshipToLeakedKeyData from datadog_api_client.v2.model.relationship_to_organization import RelationshipToOrganization from datadog_api_client.v2.model.relationship_to_organization_data import RelationshipToOrganizationData from datadog_api_client.v2.model.relationship_to_organizations import RelationshipToOrganizations @@ -11539,6 +11547,16 @@ from datadog_api_client.v2.model.update_variant_request import UpdateVariantRequest from datadog_api_client.v2.model.update_workflow_request import UpdateWorkflowRequest from datadog_api_client.v2.model.update_workflow_response import UpdateWorkflowResponse +from datadog_api_client.v2.model.updated_personal_access_token import UpdatedPersonalAccessToken +from datadog_api_client.v2.model.updated_personal_access_token_relationships import ( + UpdatedPersonalAccessTokenRelationships, +) +from datadog_api_client.v2.model.updated_personal_access_token_response import UpdatedPersonalAccessTokenResponse +from datadog_api_client.v2.model.updated_service_access_token import UpdatedServiceAccessToken +from datadog_api_client.v2.model.updated_service_access_token_relationships import ( + UpdatedServiceAccessTokenRelationships, +) +from datadog_api_client.v2.model.updated_service_access_token_response import UpdatedServiceAccessTokenResponse from datadog_api_client.v2.model.upsert_allocation_request import UpsertAllocationRequest from datadog_api_client.v2.model.upsert_and_publish_form_version_data import UpsertAndPublishFormVersionData from datadog_api_client.v2.model.upsert_and_publish_form_version_data_attributes import ( @@ -12007,6 +12025,7 @@ "AccessTokenListItem", "AccessTokenListItemRelationships", "AccessTokenOwnerType", + "AccessTokenResponseIncludedItem", "AccessTokensType", "AccountFilteringConfig", "AccountFilters", @@ -14456,8 +14475,10 @@ "FullCustomFrameworkDataAttributes", "FullPersonalAccessToken", "FullPersonalAccessTokenAttributes", + "FullPersonalAccessTokenRelationships", "FullServiceAccessToken", "FullServiceAccessTokenAttributes", + "FullServiceAccessTokenRelationships", "GCPCredentials", "GCPCredentialsUpdate", "GCPIntegration", @@ -17048,6 +17069,7 @@ "PersonalAccessTokenUpdateAttributes", "PersonalAccessTokenUpdateData", "PersonalAccessTokenUpdateRequest", + "PersonalAccessTokensIncludeQueryParameterItem", "PersonalAccessTokensSort", "PersonalAccessTokensType", "Playlist", @@ -17521,6 +17543,8 @@ "RelationshipToIncidentTypeData", "RelationshipToIncidentUserDefinedFieldData", "RelationshipToIncidentUserDefinedFields", + "RelationshipToLeakedKey", + "RelationshipToLeakedKeyData", "RelationshipToOrganization", "RelationshipToOrganizationData", "RelationshipToOrganizations", @@ -19672,6 +19696,12 @@ "UpdateVariantRequest", "UpdateWorkflowRequest", "UpdateWorkflowResponse", + "UpdatedPersonalAccessToken", + "UpdatedPersonalAccessTokenRelationships", + "UpdatedPersonalAccessTokenResponse", + "UpdatedServiceAccessToken", + "UpdatedServiceAccessTokenRelationships", + "UpdatedServiceAccessTokenResponse", "UpsertAllocationRequest", "UpsertAndPublishFormVersionData", "UpsertAndPublishFormVersionDataAttributes",