From de6af7f479ae34047e42fd90805c2559ac8e94e9 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 28 May 2026 18:10:53 +0000 Subject: [PATCH] Regenerate client from commit c33af48 of spec repo --- .generator/schemas/v2/openapi.yaml | 476 ++++++++++++++---- docs/datadog_api_client.v2.model.rst | 161 ++++++ .../key-management/GetPersonalAccessToken.py | 2 +- .../ListPersonalAccessTokens.py | 2 +- .../ListPersonalAccessTokens_4153414404.py | 13 + .../RevokePersonalAccessToken.py | 2 +- .../UpdatePersonalAccessToken.py | 2 +- .../CreateServiceAccountAccessToken.py | 4 +- .../GetServiceAccountAccessToken.py | 2 +- .../RevokeServiceAccountAccessToken.py | 2 +- .../UpdateServiceAccountAccessToken.py | 24 +- .../v2/api/key_management_api.py | 66 +-- .../v2/api/service_accounts_api.py | 88 ++-- .../v2/model/access_token_list_item.py | 74 +++ .../access_token_list_item_relationships.py | 42 ++ .../v2/model/access_token_owner_type.py | 38 ++ .../v2/model/access_tokens_type.py | 38 ++ .../v2/model/full_personal_access_token.py | 8 +- .../full_personal_access_token_attributes.py | 14 +- .../v2/model/full_service_access_token.py | 74 +++ .../full_service_access_token_attributes.py | 88 ++++ .../list_personal_access_tokens_response.py | 16 +- .../list_service_access_tokens_response.py | 56 +++ .../v2/model/personal_access_token.py | 8 +- .../model/personal_access_token_attributes.py | 16 +- ...personal_access_token_create_attributes.py | 8 +- .../personal_access_token_create_data.py | 4 +- .../personal_access_token_create_request.py | 4 +- .../personal_access_token_create_response.py | 4 +- .../personal_access_token_relationships.py | 2 +- .../model/personal_access_token_response.py | 4 +- .../personal_access_token_response_meta.py | 2 +- ...ersonal_access_token_response_meta_page.py | 2 +- ...personal_access_token_update_attributes.py | 6 +- .../personal_access_token_update_data.py | 6 +- .../personal_access_token_update_request.py | 4 +- .../v2/model/personal_access_tokens_sort.py | 8 +- .../relationship_to_access_token_owner.py | 42 ++ ...relationship_to_access_token_owner_data.py | 46 ++ .../model/relationship_to_service_account.py | 40 ++ .../relationship_to_service_account_data.py | 46 ++ .../v2/model/service_access_token.py | 74 +++ .../model/service_access_token_attributes.py | 97 ++++ .../service_access_token_create_response.py | 42 ++ .../service_access_token_relationships.py | 42 ++ .../v2/model/service_access_token_response.py | 42 ++ .../service_access_token_response_meta.py | 44 ++ ...service_access_token_response_meta_page.py | 36 ++ .../v2/model/service_access_tokens_type.py | 35 ++ ...ervice_account_access_token_create_data.py | 14 +- ..._account_access_token_update_attributes.py | 43 ++ ...ervice_account_access_token_update_data.py | 60 +++ ...ice_account_access_token_update_request.py | 42 ++ .../v2/model/service_account_type.py | 35 ++ src/datadog_api_client/v2/models/__init__.py | 50 ++ ...ce_account_returns_created_response.frozen | 2 +- ...vice_account_returns_created_response.yaml | 14 +- ...service_account_returns_ok_response.frozen | 2 +- ...a_service_account_returns_ok_response.yaml | 18 +- ...account_returns_no_content_response.frozen | 2 +- ...e_account_returns_no_content_response.yaml | 16 +- ...service_account_returns_ok_response.frozen | 2 +- ...a_service_account_returns_ok_response.yaml | 20 +- tests/v2/features/given.json | 2 +- tests/v2/features/key_management.feature | 35 +- tests/v2/features/service_accounts.feature | 32 +- tests/v2/features/undo.json | 4 +- 67 files changed, 2036 insertions(+), 313 deletions(-) create mode 100644 examples/v2/key-management/ListPersonalAccessTokens_4153414404.py create mode 100644 src/datadog_api_client/v2/model/access_token_list_item.py create mode 100644 src/datadog_api_client/v2/model/access_token_list_item_relationships.py create mode 100644 src/datadog_api_client/v2/model/access_token_owner_type.py create mode 100644 src/datadog_api_client/v2/model/access_tokens_type.py create mode 100644 src/datadog_api_client/v2/model/full_service_access_token.py create mode 100644 src/datadog_api_client/v2/model/full_service_access_token_attributes.py create mode 100644 src/datadog_api_client/v2/model/list_service_access_tokens_response.py create mode 100644 src/datadog_api_client/v2/model/relationship_to_access_token_owner.py create mode 100644 src/datadog_api_client/v2/model/relationship_to_access_token_owner_data.py create mode 100644 src/datadog_api_client/v2/model/relationship_to_service_account.py create mode 100644 src/datadog_api_client/v2/model/relationship_to_service_account_data.py create mode 100644 src/datadog_api_client/v2/model/service_access_token.py create mode 100644 src/datadog_api_client/v2/model/service_access_token_attributes.py create mode 100644 src/datadog_api_client/v2/model/service_access_token_create_response.py create mode 100644 src/datadog_api_client/v2/model/service_access_token_relationships.py create mode 100644 src/datadog_api_client/v2/model/service_access_token_response.py create mode 100644 src/datadog_api_client/v2/model/service_access_token_response_meta.py create mode 100644 src/datadog_api_client/v2/model/service_access_token_response_meta_page.py create mode 100644 src/datadog_api_client/v2/model/service_access_tokens_type.py create mode 100644 src/datadog_api_client/v2/model/service_account_access_token_update_attributes.py create mode 100644 src/datadog_api_client/v2/model/service_account_access_token_update_data.py create mode 100644 src/datadog_api_client/v2/model/service_account_access_token_update_request.py create mode 100644 src/datadog_api_client/v2/model/service_account_type.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4bc99f94bc..9b60ce5912 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -93,6 +93,14 @@ components: required: true schema: type: string + AccessTokenID: + description: The ID of the access token. + in: path + name: token_id + required: true + schema: + example: "00000000-0000-1234-0000-000000000000" + type: string AnnotationEndTimeQueryParameter: description: End of the time window in milliseconds since the Unix epoch. example: 1704153600000 @@ -1278,18 +1286,10 @@ components: required: true schema: type: string - PersonalAccessTokenID: - description: The ID of the personal access token. - in: path - name: pat_id - required: true - schema: - example: "00000000-0000-1234-0000-000000000000" - type: string - PersonalAccessTokensFilterOwnerUUIDParameter: - description: Filter personal access tokens by the owner's UUID. Supports multiple values. + PersonalAccessTokensFilterOwnerIDParameter: + description: Filter access tokens by the owner's ID. Supports multiple values. in: query - name: filter[owner_uuid] + name: filter[owned_by] required: false schema: items: @@ -1297,7 +1297,7 @@ components: type: string type: array PersonalAccessTokensFilterParameter: - description: Filter personal access tokens by the specified string. + description: Filter access tokens by the specified string. in: query name: filter required: false @@ -1305,7 +1305,7 @@ components: type: string PersonalAccessTokensSortParameter: description: |- - Personal access token attribute used to sort results. Sort order is ascending + Access token attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign. in: query @@ -3421,6 +3421,45 @@ components: xray_services: $ref: "#/components/schemas/XRayServicesList" type: object + AccessTokenListItem: + description: An access token entry returned by the personal access tokens list endpoint. May represent either a personal or a service access token. + properties: + attributes: + $ref: "#/components/schemas/PersonalAccessTokenAttributes" + id: + description: ID of the access token. + type: string + relationships: + $ref: "#/components/schemas/AccessTokenListItemRelationships" + type: + $ref: "#/components/schemas/AccessTokensType" + type: object + AccessTokenListItemRelationships: + description: Resources related to the access token entry in the mixed list response. + properties: + owned_by: + $ref: "#/components/schemas/RelationshipToAccessTokenOwner" + type: object + AccessTokenOwnerType: + description: Owner resource type. Either a user or a service account. + enum: + - users + - service_account + example: users + type: string + x-enum-varnames: + - USERS + - SERVICE_ACCOUNT + AccessTokensType: + description: Resource type returned by the access tokens list endpoint. Includes both personal and service access tokens. + enum: + - personal_access_tokens + - service_access_tokens + example: personal_access_tokens + type: string + x-enum-varnames: + - PERSONAL_ACCESS_TOKENS + - SERVICE_ACCESS_TOKENS AccountFilteringConfig: description: The account filtering configuration. properties: @@ -35264,12 +35303,12 @@ components: - requirements type: object FullPersonalAccessToken: - description: Datadog personal access token, including the token key. + description: Datadog access token, including the token key. properties: attributes: $ref: "#/components/schemas/FullPersonalAccessTokenAttributes" id: - description: ID of the personal access token. + description: ID of the access token. type: string relationships: $ref: "#/components/schemas/PersonalAccessTokenRelationships" @@ -35277,36 +35316,88 @@ components: $ref: "#/components/schemas/PersonalAccessTokensType" type: object FullPersonalAccessTokenAttributes: - description: Attributes of a full personal access token, including the token key. + description: Attributes of a full access token, including the token key. properties: created_at: - description: Creation date of the personal access token. + description: Creation date of the access token. example: "2024-01-01T00:00:00+00:00" format: date-time readOnly: true type: string expires_at: - description: Expiration date of the personal access token. + description: Expiration date of the access token. example: "2025-12-31T23:59:59+00:00" format: date-time nullable: true readOnly: true type: string key: - description: The personal access token key. Only returned upon creation. + description: The access token key. Only returned upon creation. readOnly: true type: string name: - description: Name of the personal access token. - example: "My Personal Access Token" + description: Name of the access token. + example: "My Access Token" type: string public_portion: - description: The public portion of the personal access token. + description: The public portion of the access token. example: "ddpat_abc123" readOnly: true type: string scopes: - description: Array of scopes granted to the personal access token. + description: Array of scopes granted to the access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + type: object + FullServiceAccessToken: + description: Datadog access token, including the token key. + properties: + attributes: + $ref: "#/components/schemas/FullServiceAccessTokenAttributes" + id: + description: ID of the access token. + type: string + relationships: + $ref: "#/components/schemas/ServiceAccessTokenRelationships" + type: + $ref: "#/components/schemas/ServiceAccessTokensType" + type: object + FullServiceAccessTokenAttributes: + description: Attributes of a full access token, including the token key. + properties: + created_at: + description: Creation date of the access token. + example: "2024-01-01T00:00:00+00:00" + format: date-time + readOnly: true + type: string + expires_at: + description: Expiration date of the access token. + example: "2025-12-31T23:59:59+00:00" + format: date-time + nullable: true + readOnly: true + type: string + key: + description: The access token key. Only returned upon creation. + readOnly: true + type: string + name: + description: Name of the access token. + example: "My Access Token" + type: string + public_portion: + description: The public portion of the access token. + example: "ddsat_abc123" + readOnly: true + type: string + scopes: + description: Array of scopes granted to the access token. example: - "dashboards_read" - "dashboards_write" @@ -49442,12 +49533,12 @@ components: type: array type: object ListPersonalAccessTokensResponse: - description: Response for a list of personal access tokens. + description: Response for a list of access tokens. Includes both personal and service access tokens. properties: data: - description: Array of personal access tokens. + description: Array of access tokens. Includes both personal and service access tokens. items: - $ref: "#/components/schemas/PersonalAccessToken" + $ref: "#/components/schemas/AccessTokenListItem" type: array meta: $ref: "#/components/schemas/PersonalAccessTokenResponseMeta" @@ -49617,6 +49708,17 @@ components: meta: $ref: "#/components/schemas/SecurityFindingsMeta" type: object + ListServiceAccessTokensResponse: + description: Response for a list of access tokens. + properties: + data: + description: Array of access tokens. + items: + $ref: "#/components/schemas/ServiceAccessToken" + type: array + meta: + $ref: "#/components/schemas/ServiceAccessTokenResponseMeta" + type: object ListTagsResponse: description: List tags response. properties: @@ -64454,12 +64556,12 @@ components: x-enum-varnames: - PERMISSIONS PersonalAccessToken: - description: Datadog personal access token. + description: Datadog access token. properties: attributes: $ref: "#/components/schemas/PersonalAccessTokenAttributes" id: - description: ID of the personal access token. + description: ID of the access token. type: string relationships: $ref: "#/components/schemas/PersonalAccessTokenRelationships" @@ -64467,46 +64569,46 @@ components: $ref: "#/components/schemas/PersonalAccessTokensType" type: object PersonalAccessTokenAttributes: - description: Attributes of a personal access token. + description: Attributes of an access token. properties: created_at: - description: Creation date of the personal access token. + description: Creation date of the access token. example: "2024-01-01T00:00:00+00:00" format: date-time readOnly: true type: string expires_at: - description: Expiration date of the personal access token. + description: Expiration date of the access token. example: "2025-12-31T23:59:59+00:00" format: date-time nullable: true readOnly: true type: string last_used_at: - description: Date the personal access token was last used. + description: Date the access token was last used. example: "2025-06-15T12:30:00+00:00" format: date-time nullable: true readOnly: true type: string modified_at: - description: Date of last modification of the personal access token. + description: Date of last modification of the access token. example: "2024-06-01T00:00:00+00:00" format: date-time nullable: true readOnly: true type: string name: - description: Name of the personal access token. - example: "My Personal Access Token" + description: Name of the access token. + example: "My Access Token" type: string public_portion: - description: The public portion of the personal access token. + description: The public portion of the access token. example: "ddpat_abc123" readOnly: true type: string scopes: - description: Array of scopes granted to the personal access token. + description: Array of scopes granted to the access token. example: - "dashboards_read" - "dashboards_write" @@ -64516,19 +64618,19 @@ components: type: array type: object PersonalAccessTokenCreateAttributes: - description: Attributes used to create a personal access token. + description: Attributes used to create an access token. properties: expires_at: - description: Expiration date of the personal access token. Must be at least 24 hours in the future. + description: Expiration date of the access token. Must be at least 24 hours in the future. example: "2025-12-31T23:59:59+00:00" format: date-time type: string name: - description: Name of the personal access token. + description: Name of the access token. example: "My Personal Access Token" type: string scopes: - description: Array of scopes to grant the personal access token. + description: Array of scopes to grant the access token. example: - "dashboards_read" - "dashboards_write" @@ -64542,7 +64644,7 @@ components: - expires_at type: object PersonalAccessTokenCreateData: - description: Object used to create a personal access token. + description: Object used to create an access token. properties: attributes: $ref: "#/components/schemas/PersonalAccessTokenCreateAttributes" @@ -64553,7 +64655,7 @@ components: - type type: object PersonalAccessTokenCreateRequest: - description: Request used to create a personal access token. + description: Request used to create an access token. properties: data: $ref: "#/components/schemas/PersonalAccessTokenCreateData" @@ -64561,25 +64663,25 @@ components: - data type: object PersonalAccessTokenCreateResponse: - description: Response for creating a personal access token. Includes the token key. + description: Response for creating an access token. Includes the token key. properties: data: $ref: "#/components/schemas/FullPersonalAccessToken" type: object PersonalAccessTokenRelationships: - description: Resources related to the personal access token. + description: Resources related to the access token. properties: owned_by: $ref: "#/components/schemas/RelationshipToUser" type: object PersonalAccessTokenResponse: - description: Response for retrieving a personal access token. + description: Response for retrieving an access token. properties: data: $ref: "#/components/schemas/PersonalAccessToken" type: object PersonalAccessTokenResponseMeta: - description: Additional information related to the personal access token response. + description: Additional information related to the access token response. properties: page: $ref: "#/components/schemas/PersonalAccessTokenResponseMetaPage" @@ -64588,19 +64690,19 @@ components: description: Pagination information. properties: total_filtered_count: - description: Total filtered personal access token count. + description: Total filtered access token count. format: int64 type: integer type: object PersonalAccessTokenUpdateAttributes: - description: Attributes used to update a personal access token. + description: Attributes used to update an access token. properties: name: - description: Name of the personal access token. + description: Name of the access token. example: "Updated Personal Access Token" type: string scopes: - description: Array of scopes to grant the personal access token. + description: Array of scopes to grant the access token. example: - "dashboards_read" - "dashboards_write" @@ -64610,12 +64712,12 @@ components: type: array type: object PersonalAccessTokenUpdateData: - description: Object used to update a personal access token. + description: Object used to update an access token. properties: attributes: $ref: "#/components/schemas/PersonalAccessTokenUpdateAttributes" id: - description: ID of the personal access token. + description: ID of the access token. example: "00112233-4455-6677-8899-aabbccddeeff" type: string type: @@ -64626,7 +64728,7 @@ components: - type type: object PersonalAccessTokenUpdateRequest: - description: Request used to update a personal access token. + description: Request used to update an access token. properties: data: $ref: "#/components/schemas/PersonalAccessTokenUpdateData" @@ -64643,6 +64745,8 @@ components: - -created_at - expires_at - -expires_at + - last_used_at + - -last_used_at type: string x-enum-varnames: - NAME_ASCENDING @@ -64651,6 +64755,8 @@ components: - CREATED_AT_DESCENDING - EXPIRES_AT_ASCENDING - EXPIRES_AT_DESCENDING + - LAST_USED_AT_ASCENDING + - LAST_USED_AT_DESCENDING PersonalAccessTokensType: default: personal_access_tokens description: Personal access tokens resource type. @@ -68021,6 +68127,27 @@ components: description: Relationship type. type: string type: object + RelationshipToAccessTokenOwner: + description: Relationship to the access token's owner. + properties: + data: + $ref: "#/components/schemas/RelationshipToAccessTokenOwnerData" + required: + - data + type: object + RelationshipToAccessTokenOwnerData: + description: Relationship to the access token's owner. + properties: + id: + description: A unique identifier that represents the owner. + example: "00000000-0000-0000-2345-000000000000" + type: string + type: + $ref: "#/components/schemas/AccessTokenOwnerType" + required: + - id + - type + type: object RelationshipToIncident: description: Relationship to incident. properties: @@ -68379,6 +68506,27 @@ components: - id - type type: object + RelationshipToServiceAccount: + description: Relationship to service account. + properties: + data: + $ref: "#/components/schemas/RelationshipToServiceAccountData" + required: + - data + type: object + RelationshipToServiceAccountData: + description: Relationship to service account object. + properties: + id: + description: A unique identifier that represents the service account. + example: "00000000-0000-0000-2345-000000000000" + type: string + type: + $ref: "#/components/schemas/ServiceAccountType" + required: + - id + - type + type: object RelationshipToTeam: description: Relationship to team. properties: @@ -79462,6 +79610,109 @@ components: - REPLACEMENT_STRING - PARTIAL_REPLACEMENT_FROM_BEGINNING - PARTIAL_REPLACEMENT_FROM_END + ServiceAccessToken: + description: Datadog access token. + properties: + attributes: + $ref: "#/components/schemas/ServiceAccessTokenAttributes" + id: + description: ID of the access token. + type: string + relationships: + $ref: "#/components/schemas/ServiceAccessTokenRelationships" + type: + $ref: "#/components/schemas/ServiceAccessTokensType" + type: object + ServiceAccessTokenAttributes: + description: Attributes of an access token. + properties: + created_at: + description: Creation date of the access token. + example: "2024-01-01T00:00:00+00:00" + format: date-time + readOnly: true + type: string + expires_at: + description: Expiration date of the access token. + example: "2025-12-31T23:59:59+00:00" + format: date-time + nullable: true + readOnly: true + type: string + last_used_at: + description: Date the access token was last used. + example: "2025-06-15T12:30:00+00:00" + format: date-time + nullable: true + readOnly: true + type: string + modified_at: + description: Date of last modification of the access token. + example: "2024-06-01T00:00:00+00:00" + format: date-time + nullable: true + readOnly: true + type: string + name: + description: Name of the access token. + example: "My Access Token" + type: string + public_portion: + description: The public portion of the access token. + example: "ddsat_abc123" + readOnly: true + type: string + scopes: + description: Array of scopes granted to the access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + type: object + ServiceAccessTokenCreateResponse: + description: Response for creating an access token. Includes the token key. + properties: + data: + $ref: "#/components/schemas/FullServiceAccessToken" + type: object + ServiceAccessTokenRelationships: + description: Resources related to the access token. + properties: + owned_by: + $ref: "#/components/schemas/RelationshipToServiceAccount" + type: object + ServiceAccessTokenResponse: + description: Response for retrieving an access token. + properties: + data: + $ref: "#/components/schemas/ServiceAccessToken" + type: object + ServiceAccessTokenResponseMeta: + description: Additional information related to the access token response. + properties: + page: + $ref: "#/components/schemas/ServiceAccessTokenResponseMetaPage" + type: object + ServiceAccessTokenResponseMetaPage: + description: Pagination information. + properties: + total_filtered_count: + description: Total filtered access token count. + format: int64 + type: integer + type: object + ServiceAccessTokensType: + default: service_access_tokens + description: Service access tokens resource type. + enum: + - service_access_tokens + example: service_access_tokens + type: string + x-enum-varnames: + - SERVICE_ACCESS_TOKENS ServiceAccountAccessTokenCreateAttributes: description: Attributes used to create a service account access token. properties: @@ -79493,7 +79744,7 @@ components: attributes: $ref: "#/components/schemas/ServiceAccountAccessTokenCreateAttributes" type: - $ref: "#/components/schemas/PersonalAccessTokensType" + $ref: "#/components/schemas/ServiceAccessTokensType" required: - attributes - type @@ -79506,6 +79757,47 @@ components: required: - data type: object + ServiceAccountAccessTokenUpdateAttributes: + description: Attributes used to update a service account access token. + properties: + name: + description: Name of the access token. + example: "Updated Service Access Token" + type: string + scopes: + description: Array of scopes to grant the access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + type: object + ServiceAccountAccessTokenUpdateData: + description: Object used to update a service account access token. + properties: + attributes: + $ref: "#/components/schemas/ServiceAccountAccessTokenUpdateAttributes" + id: + description: ID of the access token. + example: "00112233-4455-6677-8899-aabbccddeeff" + type: string + type: + $ref: "#/components/schemas/ServiceAccessTokensType" + required: + - attributes + - id + - type + type: object + ServiceAccountAccessTokenUpdateRequest: + description: Request used to update a service account access token. + properties: + data: + $ref: "#/components/schemas/ServiceAccountAccessTokenUpdateData" + required: + - data + type: object ServiceAccountCreateAttributes: description: Attributes of the created user. properties: @@ -79548,6 +79840,14 @@ components: required: - data type: object + ServiceAccountType: + description: Service account resource type. + enum: + - service_account + example: service_account + type: string + x-enum-varnames: + - SERVICE_ACCOUNT ServiceDefinitionCreateResponse: description: Create service definitions response. properties: @@ -140254,14 +140554,14 @@ paths: - user_access_read /api/v2/personal_access_tokens: get: - description: List all personal access tokens for the organization. + description: List all access tokens for the organization. operationId: ListPersonalAccessTokens parameters: - $ref: "#/components/parameters/PageSize" - $ref: "#/components/parameters/PageNumber" - $ref: "#/components/parameters/PersonalAccessTokensSortParameter" - $ref: "#/components/parameters/PersonalAccessTokensFilterParameter" - - $ref: "#/components/parameters/PersonalAccessTokensFilterOwnerUUIDParameter" + - $ref: "#/components/parameters/PersonalAccessTokensFilterOwnerIDParameter" responses: "200": content: @@ -140274,6 +140574,7 @@ paths: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" name: My Personal Access Token + public_portion: ddpat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000002 @@ -140298,7 +140599,7 @@ paths: description: Forbidden "429": $ref: "#/components/responses/TooManyRequestsResponse" - summary: Get all personal access tokens + summary: Get all access tokens tags: - Key Management "x-permission": @@ -140369,12 +140670,12 @@ paths: operator: OR permissions: - user_app_keys - /api/v2/personal_access_tokens/{pat_id}: + /api/v2/personal_access_tokens/{token_id}: delete: description: Revoke a specific personal access token. operationId: RevokePersonalAccessToken parameters: - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" responses: "204": description: No Content @@ -140401,10 +140702,10 @@ paths: - user_app_keys - org_app_keys_write get: - description: Get a specific personal access token by its UUID. + description: Get a specific personal access token by its ID. operationId: GetPersonalAccessToken parameters: - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" responses: "200": content: @@ -140417,6 +140718,7 @@ paths: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" name: My Personal Access Token + public_portion: ddpat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000003 @@ -140450,7 +140752,7 @@ paths: description: Update a specific personal access token. operationId: UpdatePersonalAccessToken parameters: - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" requestBody: content: application/json: @@ -140480,6 +140782,7 @@ paths: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" name: My Personal Access Token + public_portion: ddpat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000004 @@ -156110,16 +156413,17 @@ paths: - attributes: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" - name: My Personal Access Token + name: My Service Access Token + public_portion: ddsat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000005 - type: personal_access_tokens + type: service_access_tokens meta: page: total_filtered_count: 1 schema: - $ref: "#/components/schemas/ListPersonalAccessTokensResponse" + $ref: "#/components/schemas/ListServiceAccessTokensResponse" description: OK "400": content: @@ -156165,7 +156469,7 @@ paths: scopes: - dashboards_read - dashboards_write - type: personal_access_tokens + type: service_access_tokens schema: $ref: "#/components/schemas/ServiceAccountAccessTokenCreateRequest" required: true @@ -156181,14 +156485,14 @@ paths: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" key: "" - name: My Personal Access Token - public_portion: ddpat_abc123 + name: My Service Access Token + public_portion: ddsat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000006 - type: personal_access_tokens + type: service_access_tokens schema: - $ref: "#/components/schemas/PersonalAccessTokenCreateResponse" + $ref: "#/components/schemas/ServiceAccessTokenCreateResponse" description: Created "400": content: @@ -156218,13 +156522,13 @@ paths: operator: OR permissions: - service_account_write - /api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}: + /api/v2/service_accounts/{service_account_id}/access_tokens/{token_id}: delete: description: Revoke a specific access token for a service account. operationId: RevokeServiceAccountAccessToken parameters: - $ref: "#/components/parameters/ServiceAccountID" - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" responses: "204": description: No Content @@ -156250,11 +156554,11 @@ paths: permissions: - service_account_write get: - description: Get a specific access token for a service account by its UUID. + description: Get a specific access token for a service account by its ID. operationId: GetServiceAccountAccessToken parameters: - $ref: "#/components/parameters/ServiceAccountID" - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" responses: "200": content: @@ -156266,13 +156570,14 @@ paths: attributes: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" - name: My Personal Access Token + name: My Service Access Token + public_portion: ddsat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000007 - type: personal_access_tokens + type: service_access_tokens schema: - $ref: "#/components/schemas/PersonalAccessTokenResponse" + $ref: "#/components/schemas/ServiceAccessTokenResponse" description: OK "403": content: @@ -156300,7 +156605,7 @@ paths: operationId: UpdateServiceAccountAccessToken parameters: - $ref: "#/components/parameters/ServiceAccountID" - - $ref: "#/components/parameters/PersonalAccessTokenID" + - $ref: "#/components/parameters/AccessTokenID" requestBody: content: application/json: @@ -156309,14 +156614,14 @@ paths: value: data: attributes: - name: Updated Personal Access Token + name: Updated Service Access Token scopes: - dashboards_read - dashboards_write id: 00112233-4455-6677-8899-aabbccddeeff - type: personal_access_tokens + type: service_access_tokens schema: - $ref: "#/components/schemas/PersonalAccessTokenUpdateRequest" + $ref: "#/components/schemas/ServiceAccountAccessTokenUpdateRequest" required: true responses: "200": @@ -156329,13 +156634,14 @@ paths: attributes: created_at: "2024-01-01T00:00:00+00:00" expires_at: "2025-12-31T23:59:59+00:00" - name: My Personal Access Token + name: My Service Access Token + public_portion: ddsat_abc123 scopes: - dashboards_read id: 00000000-0000-0000-0000-000000000008 - type: personal_access_tokens + type: service_access_tokens schema: - $ref: "#/components/schemas/PersonalAccessTokenResponse" + $ref: "#/components/schemas/ServiceAccessTokenResponse" description: OK "400": content: diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 5d1f8d7e30..9fc2587e91 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -4,6 +4,34 @@ datadog\_api\_client.v2.model package Submodules ---------- +datadog\_api\_client.v2.model.access\_token\_list\_item module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.access_token_list_item + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.access\_token\_list\_item\_relationships module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.access_token_list_item_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.access\_token\_owner\_type module +--------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.access_token_owner_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.access\_tokens\_type module +--------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.access_tokens_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.account\_filtering\_config module --------------------------------------------------------------- @@ -14354,6 +14382,20 @@ datadog\_api\_client.v2.model.full\_personal\_access\_token\_attributes module :members: :show-inheritance: +datadog\_api\_client.v2.model.full\_service\_access\_token module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.full_service_access_token + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.full\_service\_access\_token\_attributes module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.full_service_access_token_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.gcp\_credentials module ----------------------------------------------------- @@ -19023,6 +19065,13 @@ datadog\_api\_client.v2.model.list\_security\_findings\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_service\_access\_tokens\_response module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_service_access_tokens_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_tags\_response module --------------------------------------------------------- @@ -29012,6 +29061,20 @@ datadog\_api\_client.v2.model.relationship\_item module :members: :show-inheritance: +datadog\_api\_client.v2.model.relationship\_to\_access\_token\_owner module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.relationship_to_access_token_owner + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.relationship\_to\_access\_token\_owner\_data module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.relationship_to_access_token_owner_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.relationship\_to\_incident module --------------------------------------------------------------- @@ -29257,6 +29320,20 @@ datadog\_api\_client.v2.model.relationship\_to\_saml\_assertion\_attribute\_data :members: :show-inheritance: +datadog\_api\_client.v2.model.relationship\_to\_service\_account module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.relationship_to_service_account + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.relationship\_to\_service\_account\_data module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.relationship_to_service_account_data + :members: + :show-inheritance: + datadog\_api\_client.v2.model.relationship\_to\_team module ----------------------------------------------------------- @@ -34486,6 +34563,62 @@ datadog\_api\_client.v2.model.sensitive\_data\_scanner\_text\_replacement\_type :members: :show-inheritance: +datadog\_api\_client.v2.model.service\_access\_token module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_access_token + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_access\_token\_attributes module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_access_token_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_access\_token\_create\_response module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_access_token_create_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_access\_token\_relationships module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_access_token_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_access\_token\_response module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_access_token_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_access\_token\_response\_meta module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_access_token_response_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_access\_token\_response\_meta\_page module +--------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_access_token_response_meta_page + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_access\_tokens\_type module +------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.service_access_tokens_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.service\_account\_access\_token\_create\_attributes module ---------------------------------------------------------------------------------------- @@ -34507,6 +34640,27 @@ datadog\_api\_client.v2.model.service\_account\_access\_token\_create\_request m :members: :show-inheritance: +datadog\_api\_client.v2.model.service\_account\_access\_token\_update\_attributes module +---------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_account_access_token_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_account\_access\_token\_update\_data module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_account_access_token_update_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.service\_account\_access\_token\_update\_request module +------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_account_access_token_update_request + :members: + :show-inheritance: + datadog\_api\_client.v2.model.service\_account\_create\_attributes module ------------------------------------------------------------------------- @@ -34528,6 +34682,13 @@ datadog\_api\_client.v2.model.service\_account\_create\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.service\_account\_type module +----------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.service_account_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.service\_definition\_create\_response module -------------------------------------------------------------------------- diff --git a/examples/v2/key-management/GetPersonalAccessToken.py b/examples/v2/key-management/GetPersonalAccessToken.py index d2a095c8b5..93260740be 100644 --- a/examples/v2/key-management/GetPersonalAccessToken.py +++ b/examples/v2/key-management/GetPersonalAccessToken.py @@ -13,7 +13,7 @@ with ApiClient(configuration) as api_client: api_instance = KeyManagementApi(api_client) response = api_instance.get_personal_access_token( - pat_id=PERSONAL_ACCESS_TOKEN_DATA_ID, + token_id=PERSONAL_ACCESS_TOKEN_DATA_ID, ) print(response) diff --git a/examples/v2/key-management/ListPersonalAccessTokens.py b/examples/v2/key-management/ListPersonalAccessTokens.py index 5e01b3eea3..e1e6567fec 100644 --- a/examples/v2/key-management/ListPersonalAccessTokens.py +++ b/examples/v2/key-management/ListPersonalAccessTokens.py @@ -1,5 +1,5 @@ """ -Get all personal access tokens returns "OK" response +Get all access tokens returns "OK" response """ from datadog_api_client import ApiClient, Configuration diff --git a/examples/v2/key-management/ListPersonalAccessTokens_4153414404.py b/examples/v2/key-management/ListPersonalAccessTokens_4153414404.py new file mode 100644 index 0000000000..5e01b3eea3 --- /dev/null +++ b/examples/v2/key-management/ListPersonalAccessTokens_4153414404.py @@ -0,0 +1,13 @@ +""" +Get all personal access tokens returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.key_management_api import KeyManagementApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = KeyManagementApi(api_client) + response = api_instance.list_personal_access_tokens() + + print(response) diff --git a/examples/v2/key-management/RevokePersonalAccessToken.py b/examples/v2/key-management/RevokePersonalAccessToken.py index e556052464..bab2fcaa4e 100644 --- a/examples/v2/key-management/RevokePersonalAccessToken.py +++ b/examples/v2/key-management/RevokePersonalAccessToken.py @@ -13,5 +13,5 @@ with ApiClient(configuration) as api_client: api_instance = KeyManagementApi(api_client) api_instance.revoke_personal_access_token( - pat_id=PERSONAL_ACCESS_TOKEN_DATA_ID, + token_id=PERSONAL_ACCESS_TOKEN_DATA_ID, ) diff --git a/examples/v2/key-management/UpdatePersonalAccessToken.py b/examples/v2/key-management/UpdatePersonalAccessToken.py index 38e95f97ff..7b01c43566 100644 --- a/examples/v2/key-management/UpdatePersonalAccessToken.py +++ b/examples/v2/key-management/UpdatePersonalAccessToken.py @@ -26,6 +26,6 @@ configuration = Configuration() with ApiClient(configuration) as api_client: api_instance = KeyManagementApi(api_client) - response = api_instance.update_personal_access_token(pat_id=PERSONAL_ACCESS_TOKEN_DATA_ID, body=body) + response = api_instance.update_personal_access_token(token_id=PERSONAL_ACCESS_TOKEN_DATA_ID, body=body) print(response) diff --git a/examples/v2/service-accounts/CreateServiceAccountAccessToken.py b/examples/v2/service-accounts/CreateServiceAccountAccessToken.py index c48b45b6ca..c5c51724e6 100644 --- a/examples/v2/service-accounts/CreateServiceAccountAccessToken.py +++ b/examples/v2/service-accounts/CreateServiceAccountAccessToken.py @@ -5,7 +5,7 @@ from os import environ from datadog_api_client import ApiClient, Configuration from datadog_api_client.v2.api.service_accounts_api import ServiceAccountsApi -from datadog_api_client.v2.model.personal_access_tokens_type import PersonalAccessTokensType +from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType from datadog_api_client.v2.model.service_account_access_token_create_attributes import ( ServiceAccountAccessTokenCreateAttributes, ) @@ -19,7 +19,7 @@ body = ServiceAccountAccessTokenCreateRequest( data=ServiceAccountAccessTokenCreateData( - type=PersonalAccessTokensType.PERSONAL_ACCESS_TOKENS, + type=ServiceAccessTokensType.SERVICE_ACCESS_TOKENS, attributes=ServiceAccountAccessTokenCreateAttributes( name="Example-Service-Account", scopes=[ diff --git a/examples/v2/service-accounts/GetServiceAccountAccessToken.py b/examples/v2/service-accounts/GetServiceAccountAccessToken.py index babbbfbe2b..213d12a9f4 100644 --- a/examples/v2/service-accounts/GetServiceAccountAccessToken.py +++ b/examples/v2/service-accounts/GetServiceAccountAccessToken.py @@ -17,7 +17,7 @@ api_instance = ServiceAccountsApi(api_client) response = api_instance.get_service_account_access_token( service_account_id=SERVICE_ACCOUNT_USER_DATA_ID, - pat_id=SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, + token_id=SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, ) print(response) diff --git a/examples/v2/service-accounts/RevokeServiceAccountAccessToken.py b/examples/v2/service-accounts/RevokeServiceAccountAccessToken.py index 55187e47e5..cd5fa393ce 100644 --- a/examples/v2/service-accounts/RevokeServiceAccountAccessToken.py +++ b/examples/v2/service-accounts/RevokeServiceAccountAccessToken.py @@ -17,5 +17,5 @@ api_instance = ServiceAccountsApi(api_client) api_instance.revoke_service_account_access_token( service_account_id=SERVICE_ACCOUNT_USER_DATA_ID, - pat_id=SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, + token_id=SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, ) diff --git a/examples/v2/service-accounts/UpdateServiceAccountAccessToken.py b/examples/v2/service-accounts/UpdateServiceAccountAccessToken.py index 1810fb2877..6ea805949f 100644 --- a/examples/v2/service-accounts/UpdateServiceAccountAccessToken.py +++ b/examples/v2/service-accounts/UpdateServiceAccountAccessToken.py @@ -5,10 +5,14 @@ from os import environ from datadog_api_client import ApiClient, Configuration from datadog_api_client.v2.api.service_accounts_api import ServiceAccountsApi -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_type import PersonalAccessTokensType +from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType +from datadog_api_client.v2.model.service_account_access_token_update_attributes import ( + ServiceAccountAccessTokenUpdateAttributes, +) +from datadog_api_client.v2.model.service_account_access_token_update_data import ServiceAccountAccessTokenUpdateData +from datadog_api_client.v2.model.service_account_access_token_update_request import ( + ServiceAccountAccessTokenUpdateRequest, +) # there is a valid "service_account_user" in the system SERVICE_ACCOUNT_USER_DATA_ID = environ["SERVICE_ACCOUNT_USER_DATA_ID"] @@ -17,12 +21,12 @@ SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ATTRIBUTES_NAME = environ["SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ATTRIBUTES_NAME"] SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID = environ["SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID"] -body = PersonalAccessTokenUpdateRequest( - data=PersonalAccessTokenUpdateData( +body = ServiceAccountAccessTokenUpdateRequest( + data=ServiceAccountAccessTokenUpdateData( id=SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, - type=PersonalAccessTokensType.PERSONAL_ACCESS_TOKENS, - attributes=PersonalAccessTokenUpdateAttributes( - name="My Personal Access Token-updated", + type=ServiceAccessTokensType.SERVICE_ACCESS_TOKENS, + attributes=ServiceAccountAccessTokenUpdateAttributes( + name="My Access Token-updated", ), ), ) @@ -31,7 +35,7 @@ with ApiClient(configuration) as api_client: api_instance = ServiceAccountsApi(api_client) response = api_instance.update_service_account_access_token( - service_account_id=SERVICE_ACCOUNT_USER_DATA_ID, pat_id=SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, body=body + service_account_id=SERVICE_ACCOUNT_USER_DATA_ID, token_id=SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, body=body ) print(response) 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 38c9c48895..c06731c939 100644 --- a/src/datadog_api_client/v2/api/key_management_api.py +++ b/src/datadog_api_client/v2/api/key_management_api.py @@ -259,16 +259,16 @@ def __init__(self, api_client=None): settings={ "response_type": (PersonalAccessTokenResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], - "endpoint_path": "/api/v2/personal_access_tokens/{pat_id}", + "endpoint_path": "/api/v2/personal_access_tokens/{token_id}", "operation_id": "get_personal_access_token", "http_method": "GET", "version": "v2", }, params_map={ - "pat_id": { + "token_id": { "required": True, "openapi_types": (str,), - "attribute": "pat_id", + "attribute": "token_id", "location": "path", }, }, @@ -484,9 +484,9 @@ def __init__(self, api_client=None): "attribute": "filter", "location": "query", }, - "filter_owner_uuid": { + "filter_owned_by": { "openapi_types": ([str],), - "attribute": "filter[owner_uuid]", + "attribute": "filter[owned_by]", "location": "query", "collection_format": "multi", }, @@ -501,16 +501,16 @@ def __init__(self, api_client=None): settings={ "response_type": None, "auth": ["apiKeyAuth", "appKeyAuth"], - "endpoint_path": "/api/v2/personal_access_tokens/{pat_id}", + "endpoint_path": "/api/v2/personal_access_tokens/{token_id}", "operation_id": "revoke_personal_access_token", "http_method": "DELETE", "version": "v2", }, params_map={ - "pat_id": { + "token_id": { "required": True, "openapi_types": (str,), - "attribute": "pat_id", + "attribute": "token_id", "location": "path", }, }, @@ -602,16 +602,16 @@ def __init__(self, api_client=None): settings={ "response_type": (PersonalAccessTokenResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], - "endpoint_path": "/api/v2/personal_access_tokens/{pat_id}", + "endpoint_path": "/api/v2/personal_access_tokens/{token_id}", "operation_id": "update_personal_access_token", "http_method": "PATCH", "version": "v2", }, params_map={ - "pat_id": { + "token_id": { "required": True, "openapi_types": (str,), - "attribute": "pat_id", + "attribute": "token_id", "location": "path", }, "body": { @@ -823,18 +823,18 @@ def get_current_user_application_key( def get_personal_access_token( self, - pat_id: str, + token_id: str, ) -> PersonalAccessTokenResponse: """Get a personal access token. - Get a specific personal access token by its UUID. + Get a specific personal access token by its ID. - :param pat_id: The ID of the personal access token. - :type pat_id: str + :param token_id: The ID of the access token. + :type token_id: str :rtype: PersonalAccessTokenResponse """ kwargs: Dict[str, Any] = {} - kwargs["pat_id"] = pat_id + kwargs["token_id"] = token_id return self._get_personal_access_token_endpoint.call_with_http_info(**kwargs) @@ -1040,24 +1040,24 @@ def list_personal_access_tokens( page_number: Union[int, UnsetType] = unset, sort: Union[PersonalAccessTokensSort, UnsetType] = unset, filter: Union[str, UnsetType] = unset, - filter_owner_uuid: Union[List[str], UnsetType] = unset, + filter_owned_by: Union[List[str], UnsetType] = unset, ) -> ListPersonalAccessTokensResponse: - """Get all personal access tokens. + """Get all access tokens. - List all personal access tokens for the organization. + List all access tokens for the organization. :param page_size: Size for a given page. The maximum allowed value is 100. :type page_size: int, optional :param page_number: Specific page number to return. :type page_number: int, optional - :param sort: Personal access token attribute used to sort results. Sort order is ascending + :param sort: Access token attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign. :type sort: PersonalAccessTokensSort, optional - :param filter: Filter personal access tokens by the specified string. + :param filter: Filter access tokens by the specified string. :type filter: str, optional - :param filter_owner_uuid: Filter personal access tokens by the owner's UUID. Supports multiple values. - :type filter_owner_uuid: [str], optional + :param filter_owned_by: Filter access tokens by the owner's ID. Supports multiple values. + :type filter_owned_by: [str], optional :rtype: ListPersonalAccessTokensResponse """ kwargs: Dict[str, Any] = {} @@ -1073,25 +1073,25 @@ def list_personal_access_tokens( if filter is not unset: kwargs["filter"] = filter - if filter_owner_uuid is not unset: - kwargs["filter_owner_uuid"] = filter_owner_uuid + if filter_owned_by is not unset: + kwargs["filter_owned_by"] = filter_owned_by return self._list_personal_access_tokens_endpoint.call_with_http_info(**kwargs) def revoke_personal_access_token( self, - pat_id: str, + token_id: str, ) -> None: """Revoke a personal access token. Revoke a specific personal access token. - :param pat_id: The ID of the personal access token. - :type pat_id: str + :param token_id: The ID of the access token. + :type token_id: str :rtype: None """ kwargs: Dict[str, Any] = {} - kwargs["pat_id"] = pat_id + kwargs["token_id"] = token_id return self._revoke_personal_access_token_endpoint.call_with_http_info(**kwargs) @@ -1161,20 +1161,20 @@ def update_current_user_application_key( def update_personal_access_token( self, - pat_id: str, + token_id: str, body: PersonalAccessTokenUpdateRequest, ) -> PersonalAccessTokenResponse: """Update a personal access token. Update a specific personal access token. - :param pat_id: The ID of the personal access token. - :type pat_id: str + :param token_id: The ID of the access token. + :type token_id: str :type body: PersonalAccessTokenUpdateRequest :rtype: PersonalAccessTokenResponse """ kwargs: Dict[str, Any] = {} - kwargs["pat_id"] = pat_id + kwargs["token_id"] = token_id kwargs["body"] = body 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 e972993b05..1eea255614 100644 --- a/src/datadog_api_client/v2/api/service_accounts_api.py +++ b/src/datadog_api_client/v2/api/service_accounts_api.py @@ -13,14 +13,16 @@ ) from datadog_api_client.v2.model.user_response import UserResponse from datadog_api_client.v2.model.service_account_create_request import ServiceAccountCreateRequest -from datadog_api_client.v2.model.list_personal_access_tokens_response import ListPersonalAccessTokensResponse +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_token_create_response import PersonalAccessTokenCreateResponse +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.personal_access_token_response import PersonalAccessTokenResponse -from datadog_api_client.v2.model.personal_access_token_update_request import PersonalAccessTokenUpdateRequest +from datadog_api_client.v2.model.service_access_token_response import ServiceAccessTokenResponse +from datadog_api_client.v2.model.service_account_access_token_update_request import ( + ServiceAccountAccessTokenUpdateRequest, +) from datadog_api_client.v2.model.list_application_keys_response import ListApplicationKeysResponse from datadog_api_client.v2.model.application_keys_sort import ApplicationKeysSort from datadog_api_client.v2.model.application_key_response import ApplicationKeyResponse @@ -61,7 +63,7 @@ def __init__(self, api_client=None): self._create_service_account_access_token_endpoint = _Endpoint( settings={ - "response_type": (PersonalAccessTokenCreateResponse,), + "response_type": (ServiceAccessTokenCreateResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/service_accounts/{service_account_id}/access_tokens", "operation_id": "create_service_account_access_token", @@ -142,9 +144,9 @@ def __init__(self, api_client=None): self._get_service_account_access_token_endpoint = _Endpoint( settings={ - "response_type": (PersonalAccessTokenResponse,), + "response_type": (ServiceAccessTokenResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], - "endpoint_path": "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}", + "endpoint_path": "/api/v2/service_accounts/{service_account_id}/access_tokens/{token_id}", "operation_id": "get_service_account_access_token", "http_method": "GET", "version": "v2", @@ -156,10 +158,10 @@ def __init__(self, api_client=None): "attribute": "service_account_id", "location": "path", }, - "pat_id": { + "token_id": { "required": True, "openapi_types": (str,), - "attribute": "pat_id", + "attribute": "token_id", "location": "path", }, }, @@ -200,7 +202,7 @@ def __init__(self, api_client=None): self._list_service_account_access_tokens_endpoint = _Endpoint( settings={ - "response_type": (ListPersonalAccessTokensResponse,), + "response_type": (ListServiceAccessTokensResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], "endpoint_path": "/api/v2/service_accounts/{service_account_id}/access_tokens", "operation_id": "list_service_account_access_tokens", @@ -298,7 +300,7 @@ def __init__(self, api_client=None): settings={ "response_type": None, "auth": ["apiKeyAuth", "appKeyAuth"], - "endpoint_path": "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}", + "endpoint_path": "/api/v2/service_accounts/{service_account_id}/access_tokens/{token_id}", "operation_id": "revoke_service_account_access_token", "http_method": "DELETE", "version": "v2", @@ -310,10 +312,10 @@ def __init__(self, api_client=None): "attribute": "service_account_id", "location": "path", }, - "pat_id": { + "token_id": { "required": True, "openapi_types": (str,), - "attribute": "pat_id", + "attribute": "token_id", "location": "path", }, }, @@ -325,9 +327,9 @@ def __init__(self, api_client=None): self._update_service_account_access_token_endpoint = _Endpoint( settings={ - "response_type": (PersonalAccessTokenResponse,), + "response_type": (ServiceAccessTokenResponse,), "auth": ["apiKeyAuth", "appKeyAuth"], - "endpoint_path": "/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_id}", + "endpoint_path": "/api/v2/service_accounts/{service_account_id}/access_tokens/{token_id}", "operation_id": "update_service_account_access_token", "http_method": "PATCH", "version": "v2", @@ -339,15 +341,15 @@ def __init__(self, api_client=None): "attribute": "service_account_id", "location": "path", }, - "pat_id": { + "token_id": { "required": True, "openapi_types": (str,), - "attribute": "pat_id", + "attribute": "token_id", "location": "path", }, "body": { "required": True, - "openapi_types": (PersonalAccessTokenUpdateRequest,), + "openapi_types": (ServiceAccountAccessTokenUpdateRequest,), "location": "body", }, }, @@ -407,7 +409,7 @@ def create_service_account_access_token( self, service_account_id: str, body: ServiceAccountAccessTokenCreateRequest, - ) -> PersonalAccessTokenCreateResponse: + ) -> ServiceAccessTokenCreateResponse: """Create an access token for a service account. Create an access token for a service account. @@ -415,7 +417,7 @@ def create_service_account_access_token( :param service_account_id: The ID of the service account. :type service_account_id: str :type body: ServiceAccountAccessTokenCreateRequest - :rtype: PersonalAccessTokenCreateResponse + :rtype: ServiceAccessTokenCreateResponse """ kwargs: Dict[str, Any] = {} kwargs["service_account_id"] = service_account_id @@ -470,22 +472,22 @@ def delete_service_account_application_key( def get_service_account_access_token( self, service_account_id: str, - pat_id: str, - ) -> PersonalAccessTokenResponse: + token_id: str, + ) -> ServiceAccessTokenResponse: """Get an access token for a service account. - Get a specific access token for a service account by its UUID. + Get a specific access token for a service account by its ID. :param service_account_id: The ID of the service account. :type service_account_id: str - :param pat_id: The ID of the personal access token. - :type pat_id: str - :rtype: PersonalAccessTokenResponse + :param token_id: The ID of the access token. + :type token_id: str + :rtype: ServiceAccessTokenResponse """ kwargs: Dict[str, Any] = {} kwargs["service_account_id"] = service_account_id - kwargs["pat_id"] = pat_id + kwargs["token_id"] = token_id return self._get_service_account_access_token_endpoint.call_with_http_info(**kwargs) @@ -519,7 +521,7 @@ def list_service_account_access_tokens( page_number: Union[int, UnsetType] = unset, sort: Union[PersonalAccessTokensSort, UnsetType] = unset, filter: Union[str, UnsetType] = unset, - ) -> ListPersonalAccessTokensResponse: + ) -> ListServiceAccessTokensResponse: """List access tokens for a service account. List all access tokens for a specific service account. @@ -530,13 +532,13 @@ def list_service_account_access_tokens( :type page_size: int, optional :param page_number: Specific page number to return. :type page_number: int, optional - :param sort: Personal access token attribute used to sort results. Sort order is ascending + :param sort: Access token attribute used to sort results. Sort order is ascending by default. In order to specify a descending sort, prefix the attribute with a minus sign. :type sort: PersonalAccessTokensSort, optional - :param filter: Filter personal access tokens by the specified string. + :param filter: Filter access tokens by the specified string. :type filter: str, optional - :rtype: ListPersonalAccessTokensResponse + :rtype: ListServiceAccessTokensResponse """ kwargs: Dict[str, Any] = {} kwargs["service_account_id"] = service_account_id @@ -614,7 +616,7 @@ def list_service_account_application_keys( def revoke_service_account_access_token( self, service_account_id: str, - pat_id: str, + token_id: str, ) -> None: """Revoke an access token for a service account. @@ -622,38 +624,38 @@ def revoke_service_account_access_token( :param service_account_id: The ID of the service account. :type service_account_id: str - :param pat_id: The ID of the personal access token. - :type pat_id: str + :param token_id: The ID of the access token. + :type token_id: str :rtype: None """ kwargs: Dict[str, Any] = {} kwargs["service_account_id"] = service_account_id - kwargs["pat_id"] = pat_id + kwargs["token_id"] = token_id return self._revoke_service_account_access_token_endpoint.call_with_http_info(**kwargs) def update_service_account_access_token( self, service_account_id: str, - pat_id: str, - body: PersonalAccessTokenUpdateRequest, - ) -> PersonalAccessTokenResponse: + token_id: str, + body: ServiceAccountAccessTokenUpdateRequest, + ) -> ServiceAccessTokenResponse: """Update an access token for a service account. Update a specific access token for a service account. :param service_account_id: The ID of the service account. :type service_account_id: str - :param pat_id: The ID of the personal access token. - :type pat_id: str - :type body: PersonalAccessTokenUpdateRequest - :rtype: PersonalAccessTokenResponse + :param token_id: The ID of the access token. + :type token_id: str + :type body: ServiceAccountAccessTokenUpdateRequest + :rtype: ServiceAccessTokenResponse """ kwargs: Dict[str, Any] = {} kwargs["service_account_id"] = service_account_id - kwargs["pat_id"] = pat_id + kwargs["token_id"] = token_id kwargs["body"] = body diff --git a/src/datadog_api_client/v2/model/access_token_list_item.py b/src/datadog_api_client/v2/model/access_token_list_item.py new file mode 100644 index 0000000000..044b855898 --- /dev/null +++ b/src/datadog_api_client/v2/model/access_token_list_item.py @@ -0,0 +1,74 @@ +# 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.access_token_list_item_relationships import AccessTokenListItemRelationships + from datadog_api_client.v2.model.access_tokens_type import AccessTokensType + + +class AccessTokenListItem(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.personal_access_token_attributes import PersonalAccessTokenAttributes + from datadog_api_client.v2.model.access_token_list_item_relationships import AccessTokenListItemRelationships + from datadog_api_client.v2.model.access_tokens_type import AccessTokensType + + return { + "attributes": (PersonalAccessTokenAttributes,), + "id": (str,), + "relationships": (AccessTokenListItemRelationships,), + "type": (AccessTokensType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: Union[PersonalAccessTokenAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[AccessTokenListItemRelationships, UnsetType] = unset, + type: Union[AccessTokensType, UnsetType] = unset, + **kwargs, + ): + """ + An access token entry returned by the personal access tokens list endpoint. May represent either a personal or a service access token. + + :param attributes: Attributes of an access token. + :type attributes: PersonalAccessTokenAttributes, optional + + :param id: ID of the access token. + :type id: str, optional + + :param relationships: Resources related to the access token entry in the mixed list response. + :type relationships: AccessTokenListItemRelationships, optional + + :param type: Resource type returned by the access tokens list endpoint. Includes both personal and service access tokens. + :type type: AccessTokensType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) 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 new file mode 100644 index 0000000000..438742d9a4 --- /dev/null +++ b/src/datadog_api_client/v2/model/access_token_list_item_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_access_token_owner import RelationshipToAccessTokenOwner + + +class AccessTokenListItemRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_access_token_owner import RelationshipToAccessTokenOwner + + return { + "owned_by": (RelationshipToAccessTokenOwner,), + } + + attribute_map = { + "owned_by": "owned_by", + } + + def __init__(self_, owned_by: Union[RelationshipToAccessTokenOwner, UnsetType] = unset, **kwargs): + """ + Resources related to the access token entry in the mixed list response. + + :param owned_by: Relationship to the access token's owner. + :type owned_by: RelationshipToAccessTokenOwner, optional + """ + 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_owner_type.py b/src/datadog_api_client/v2/model/access_token_owner_type.py new file mode 100644 index 0000000000..32f1386ffb --- /dev/null +++ b/src/datadog_api_client/v2/model/access_token_owner_type.py @@ -0,0 +1,38 @@ +# 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 AccessTokenOwnerType(ModelSimple): + """ + Owner resource type. Either a user or a service account. + + :param value: Must be one of ["users", "service_account"]. + :type value: str + """ + + allowed_values = { + "users", + "service_account", + } + USERS: ClassVar["AccessTokenOwnerType"] + SERVICE_ACCOUNT: ClassVar["AccessTokenOwnerType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AccessTokenOwnerType.USERS = AccessTokenOwnerType("users") +AccessTokenOwnerType.SERVICE_ACCOUNT = AccessTokenOwnerType("service_account") diff --git a/src/datadog_api_client/v2/model/access_tokens_type.py b/src/datadog_api_client/v2/model/access_tokens_type.py new file mode 100644 index 0000000000..aca1dbfcfe --- /dev/null +++ b/src/datadog_api_client/v2/model/access_tokens_type.py @@ -0,0 +1,38 @@ +# 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 AccessTokensType(ModelSimple): + """ + Resource type returned by the access tokens list endpoint. Includes both personal and service access tokens. + + :param value: Must be one of ["personal_access_tokens", "service_access_tokens"]. + :type value: str + """ + + allowed_values = { + "personal_access_tokens", + "service_access_tokens", + } + PERSONAL_ACCESS_TOKENS: ClassVar["AccessTokensType"] + SERVICE_ACCESS_TOKENS: ClassVar["AccessTokensType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AccessTokensType.PERSONAL_ACCESS_TOKENS = AccessTokensType("personal_access_tokens") +AccessTokensType.SERVICE_ACCESS_TOKENS = AccessTokensType("service_access_tokens") 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 9dcb003b3a..27f2875db4 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 @@ -49,15 +49,15 @@ def __init__( **kwargs, ): """ - Datadog personal access token, including the token key. + Datadog access token, including the token key. - :param attributes: Attributes of a full personal access token, including the token key. + :param attributes: Attributes of a full access token, including the token key. :type attributes: FullPersonalAccessTokenAttributes, optional - :param id: ID of the personal access token. + :param id: ID of the access token. :type id: str, optional - :param relationships: Resources related to the personal access token. + :param relationships: Resources related to the access token. :type relationships: PersonalAccessTokenRelationships, optional :param type: Personal access tokens resource type. diff --git a/src/datadog_api_client/v2/model/full_personal_access_token_attributes.py b/src/datadog_api_client/v2/model/full_personal_access_token_attributes.py index 3a21d3e044..be59438b74 100644 --- a/src/datadog_api_client/v2/model/full_personal_access_token_attributes.py +++ b/src/datadog_api_client/v2/model/full_personal_access_token_attributes.py @@ -53,24 +53,24 @@ def __init__( **kwargs, ): """ - Attributes of a full personal access token, including the token key. + Attributes of a full access token, including the token key. - :param created_at: Creation date of the personal access token. + :param created_at: Creation date of the access token. :type created_at: datetime, optional - :param expires_at: Expiration date of the personal access token. + :param expires_at: Expiration date of the access token. :type expires_at: datetime, none_type, optional - :param key: The personal access token key. Only returned upon creation. + :param key: The access token key. Only returned upon creation. :type key: str, optional - :param name: Name of the personal access token. + :param name: Name of the access token. :type name: str, optional - :param public_portion: The public portion of the personal access token. + :param public_portion: The public portion of the access token. :type public_portion: str, optional - :param scopes: Array of scopes granted to the personal access token. + :param scopes: Array of scopes granted to the access token. :type scopes: [str], optional """ if created_at is not unset: 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 new file mode 100644 index 0000000000..111f2c5d57 --- /dev/null +++ b/src/datadog_api_client/v2/model/full_service_access_token.py @@ -0,0 +1,74 @@ +# 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.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.service_access_tokens_type import ServiceAccessTokensType + + +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.service_access_tokens_type import ServiceAccessTokensType + + return { + "attributes": (FullServiceAccessTokenAttributes,), + "id": (str,), + "relationships": (ServiceAccessTokenRelationships,), + "type": (ServiceAccessTokensType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: Union[FullServiceAccessTokenAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[ServiceAccessTokenRelationships, UnsetType] = unset, + type: Union[ServiceAccessTokensType, UnsetType] = unset, + **kwargs, + ): + """ + Datadog access token, including the token key. + + :param attributes: Attributes of a full access token, including the token key. + :type attributes: FullServiceAccessTokenAttributes, optional + + :param id: ID of the access token. + :type id: str, optional + + :param relationships: Resources related to the access token. + :type relationships: ServiceAccessTokenRelationships, optional + + :param type: Service access tokens resource type. + :type type: ServiceAccessTokensType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/full_service_access_token_attributes.py b/src/datadog_api_client/v2/model/full_service_access_token_attributes.py new file mode 100644 index 0000000000..4a354cd3f0 --- /dev/null +++ b/src/datadog_api_client/v2/model/full_service_access_token_attributes.py @@ -0,0 +1,88 @@ +# 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 List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +class FullServiceAccessTokenAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "created_at": (datetime,), + "expires_at": (datetime, none_type), + "key": (str,), + "name": (str,), + "public_portion": (str,), + "scopes": ([str],), + } + + attribute_map = { + "created_at": "created_at", + "expires_at": "expires_at", + "key": "key", + "name": "name", + "public_portion": "public_portion", + "scopes": "scopes", + } + read_only_vars = { + "created_at", + "expires_at", + "key", + "public_portion", + } + + def __init__( + self_, + created_at: Union[datetime, UnsetType] = unset, + expires_at: Union[datetime, none_type, UnsetType] = unset, + key: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + public_portion: Union[str, UnsetType] = unset, + scopes: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes of a full access token, including the token key. + + :param created_at: Creation date of the access token. + :type created_at: datetime, optional + + :param expires_at: Expiration date of the access token. + :type expires_at: datetime, none_type, optional + + :param key: The access token key. Only returned upon creation. + :type key: str, optional + + :param name: Name of the access token. + :type name: str, optional + + :param public_portion: The public portion of the access token. + :type public_portion: str, optional + + :param scopes: Array of scopes granted to the access token. + :type scopes: [str], optional + """ + if created_at is not unset: + kwargs["created_at"] = created_at + if expires_at is not unset: + kwargs["expires_at"] = expires_at + if key is not unset: + kwargs["key"] = key + if name is not unset: + kwargs["name"] = name + if public_portion is not unset: + kwargs["public_portion"] = public_portion + if scopes is not unset: + kwargs["scopes"] = scopes + 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 efff865020..faffe264e7 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 @@ -14,18 +14,18 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.personal_access_token import PersonalAccessToken + from datadog_api_client.v2.model.access_token_list_item import AccessTokenListItem from datadog_api_client.v2.model.personal_access_token_response_meta import PersonalAccessTokenResponseMeta class ListPersonalAccessTokensResponse(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_list_item import AccessTokenListItem from datadog_api_client.v2.model.personal_access_token_response_meta import PersonalAccessTokenResponseMeta return { - "data": ([PersonalAccessToken],), + "data": ([AccessTokenListItem],), "meta": (PersonalAccessTokenResponseMeta,), } @@ -36,17 +36,17 @@ def openapi_types(_): def __init__( self_, - data: Union[List[PersonalAccessToken], UnsetType] = unset, + data: Union[List[AccessTokenListItem], UnsetType] = unset, meta: Union[PersonalAccessTokenResponseMeta, UnsetType] = unset, **kwargs, ): """ - Response for a list of personal access tokens. + Response for a list of access tokens. Includes both personal and service access tokens. - :param data: Array of personal access tokens. - :type data: [PersonalAccessToken], optional + :param data: Array of access tokens. Includes both personal and service access tokens. + :type data: [AccessTokenListItem], optional - :param meta: Additional information related to the personal access token response. + :param meta: Additional information related to the access token response. :type meta: PersonalAccessTokenResponseMeta, optional """ if data is not unset: 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 new file mode 100644 index 0000000000..96814f500a --- /dev/null +++ b/src/datadog_api_client/v2/model/list_service_access_tokens_response.py @@ -0,0 +1,56 @@ +# 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 List, 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 import ServiceAccessToken + from datadog_api_client.v2.model.service_access_token_response_meta import ServiceAccessTokenResponseMeta + + +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.service_access_token_response_meta import ServiceAccessTokenResponseMeta + + return { + "data": ([ServiceAccessToken],), + "meta": (ServiceAccessTokenResponseMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__( + self_, + data: Union[List[ServiceAccessToken], UnsetType] = unset, + meta: Union[ServiceAccessTokenResponseMeta, UnsetType] = unset, + **kwargs, + ): + """ + Response for a list of access tokens. + + :param data: Array of access tokens. + :type data: [ServiceAccessToken], optional + + :param meta: Additional information related to the access token response. + :type meta: ServiceAccessTokenResponseMeta, optional + """ + if data is not unset: + kwargs["data"] = data + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/personal_access_token.py b/src/datadog_api_client/v2/model/personal_access_token.py index ee8440aa93..7272f6d238 100644 --- a/src/datadog_api_client/v2/model/personal_access_token.py +++ b/src/datadog_api_client/v2/model/personal_access_token.py @@ -49,15 +49,15 @@ def __init__( **kwargs, ): """ - Datadog personal access token. + Datadog access token. - :param attributes: Attributes of a personal access token. + :param attributes: Attributes of an access token. :type attributes: PersonalAccessTokenAttributes, optional - :param id: ID of the personal access token. + :param id: ID of the access token. :type id: str, optional - :param relationships: Resources related to the personal access token. + :param relationships: Resources related to the access token. :type relationships: PersonalAccessTokenRelationships, optional :param type: Personal access tokens resource type. diff --git a/src/datadog_api_client/v2/model/personal_access_token_attributes.py b/src/datadog_api_client/v2/model/personal_access_token_attributes.py index 94bdf38d93..36b2b9030b 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_attributes.py +++ b/src/datadog_api_client/v2/model/personal_access_token_attributes.py @@ -57,27 +57,27 @@ def __init__( **kwargs, ): """ - Attributes of a personal access token. + Attributes of an access token. - :param created_at: Creation date of the personal access token. + :param created_at: Creation date of the access token. :type created_at: datetime, optional - :param expires_at: Expiration date of the personal access token. + :param expires_at: Expiration date of the access token. :type expires_at: datetime, none_type, optional - :param last_used_at: Date the personal access token was last used. + :param last_used_at: Date the access token was last used. :type last_used_at: datetime, none_type, optional - :param modified_at: Date of last modification of the personal access token. + :param modified_at: Date of last modification of the access token. :type modified_at: datetime, none_type, optional - :param name: Name of the personal access token. + :param name: Name of the access token. :type name: str, optional - :param public_portion: The public portion of the personal access token. + :param public_portion: The public portion of the access token. :type public_portion: str, optional - :param scopes: Array of scopes granted to the personal access token. + :param scopes: Array of scopes granted to the access token. :type scopes: [str], optional """ if created_at is not unset: diff --git a/src/datadog_api_client/v2/model/personal_access_token_create_attributes.py b/src/datadog_api_client/v2/model/personal_access_token_create_attributes.py index d3e22e73b8..c60fad15ed 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_create_attributes.py +++ b/src/datadog_api_client/v2/model/personal_access_token_create_attributes.py @@ -29,15 +29,15 @@ def openapi_types(_): def __init__(self_, expires_at: datetime, name: str, scopes: List[str], **kwargs): """ - Attributes used to create a personal access token. + Attributes used to create an access token. - :param expires_at: Expiration date of the personal access token. Must be at least 24 hours in the future. + :param expires_at: Expiration date of the access token. Must be at least 24 hours in the future. :type expires_at: datetime - :param name: Name of the personal access token. + :param name: Name of the access token. :type name: str - :param scopes: Array of scopes to grant the personal access token. + :param scopes: Array of scopes to grant the access token. :type scopes: [str] """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/personal_access_token_create_data.py b/src/datadog_api_client/v2/model/personal_access_token_create_data.py index fdf23e8740..2e4847181e 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_create_data.py +++ b/src/datadog_api_client/v2/model/personal_access_token_create_data.py @@ -36,9 +36,9 @@ def openapi_types(_): def __init__(self_, attributes: PersonalAccessTokenCreateAttributes, type: PersonalAccessTokensType, **kwargs): """ - Object used to create a personal access token. + Object used to create an access token. - :param attributes: Attributes used to create a personal access token. + :param attributes: Attributes used to create an access token. :type attributes: PersonalAccessTokenCreateAttributes :param type: Personal access tokens resource type. diff --git a/src/datadog_api_client/v2/model/personal_access_token_create_request.py b/src/datadog_api_client/v2/model/personal_access_token_create_request.py index fcbba3fe92..ba68033a9a 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_create_request.py +++ b/src/datadog_api_client/v2/model/personal_access_token_create_request.py @@ -30,9 +30,9 @@ def openapi_types(_): def __init__(self_, data: PersonalAccessTokenCreateData, **kwargs): """ - Request used to create a personal access token. + Request used to create an access token. - :param data: Object used to create a personal access token. + :param data: Object used to create an access token. :type data: PersonalAccessTokenCreateData """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/personal_access_token_create_response.py b/src/datadog_api_client/v2/model/personal_access_token_create_response.py index 431ee0ccaa..85861b7120 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_create_response.py +++ b/src/datadog_api_client/v2/model/personal_access_token_create_response.py @@ -32,9 +32,9 @@ def openapi_types(_): def __init__(self_, data: Union[FullPersonalAccessToken, UnsetType] = unset, **kwargs): """ - Response for creating a personal access token. Includes the token key. + Response for creating an access token. Includes the token key. - :param data: Datadog personal access token, including the token key. + :param data: Datadog access token, including the token key. :type data: FullPersonalAccessToken, optional """ if data is not unset: 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 1848f8c884..2b76301c40 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 @@ -32,7 +32,7 @@ def openapi_types(_): def __init__(self_, owned_by: Union[RelationshipToUser, UnsetType] = unset, **kwargs): """ - Resources related to the personal access token. + Resources related to the access token. :param owned_by: Relationship to user. :type owned_by: RelationshipToUser, optional 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 7b60d894aa..64976aac63 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 @@ -32,9 +32,9 @@ def openapi_types(_): def __init__(self_, data: Union[PersonalAccessToken, UnsetType] = unset, **kwargs): """ - Response for retrieving a personal access token. + Response for retrieving an access token. - :param data: Datadog personal access token. + :param data: Datadog access token. :type data: PersonalAccessToken, optional """ if data is not unset: diff --git a/src/datadog_api_client/v2/model/personal_access_token_response_meta.py b/src/datadog_api_client/v2/model/personal_access_token_response_meta.py index 1cddc860b9..db653c29dc 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_response_meta.py +++ b/src/datadog_api_client/v2/model/personal_access_token_response_meta.py @@ -34,7 +34,7 @@ def openapi_types(_): def __init__(self_, page: Union[PersonalAccessTokenResponseMetaPage, UnsetType] = unset, **kwargs): """ - Additional information related to the personal access token response. + Additional information related to the access token response. :param page: Pagination information. :type page: PersonalAccessTokenResponseMetaPage, optional diff --git a/src/datadog_api_client/v2/model/personal_access_token_response_meta_page.py b/src/datadog_api_client/v2/model/personal_access_token_response_meta_page.py index 28d4a894ee..0aad92fe05 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_response_meta_page.py +++ b/src/datadog_api_client/v2/model/personal_access_token_response_meta_page.py @@ -28,7 +28,7 @@ def __init__(self_, total_filtered_count: Union[int, UnsetType] = unset, **kwarg """ Pagination information. - :param total_filtered_count: Total filtered personal access token count. + :param total_filtered_count: Total filtered access token count. :type total_filtered_count: int, optional """ if total_filtered_count is not unset: diff --git a/src/datadog_api_client/v2/model/personal_access_token_update_attributes.py b/src/datadog_api_client/v2/model/personal_access_token_update_attributes.py index 731e6364a4..3d2cbc5964 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_update_attributes.py +++ b/src/datadog_api_client/v2/model/personal_access_token_update_attributes.py @@ -28,12 +28,12 @@ def openapi_types(_): def __init__(self_, name: Union[str, UnsetType] = unset, scopes: Union[List[str], UnsetType] = unset, **kwargs): """ - Attributes used to update a personal access token. + Attributes used to update an access token. - :param name: Name of the personal access token. + :param name: Name of the access token. :type name: str, optional - :param scopes: Array of scopes to grant the personal access token. + :param scopes: Array of scopes to grant the access token. :type scopes: [str], optional """ if name is not unset: diff --git a/src/datadog_api_client/v2/model/personal_access_token_update_data.py b/src/datadog_api_client/v2/model/personal_access_token_update_data.py index 59d8576eb9..839d62525d 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_update_data.py +++ b/src/datadog_api_client/v2/model/personal_access_token_update_data.py @@ -40,12 +40,12 @@ def __init__( self_, attributes: PersonalAccessTokenUpdateAttributes, id: str, type: PersonalAccessTokensType, **kwargs ): """ - Object used to update a personal access token. + Object used to update an access token. - :param attributes: Attributes used to update a personal access token. + :param attributes: Attributes used to update an access token. :type attributes: PersonalAccessTokenUpdateAttributes - :param id: ID of the personal access token. + :param id: ID of the access token. :type id: str :param type: Personal access tokens resource type. diff --git a/src/datadog_api_client/v2/model/personal_access_token_update_request.py b/src/datadog_api_client/v2/model/personal_access_token_update_request.py index 531001f149..85b5dfe9bc 100644 --- a/src/datadog_api_client/v2/model/personal_access_token_update_request.py +++ b/src/datadog_api_client/v2/model/personal_access_token_update_request.py @@ -30,9 +30,9 @@ def openapi_types(_): def __init__(self_, data: PersonalAccessTokenUpdateData, **kwargs): """ - Request used to update a personal access token. + Request used to update an access token. - :param data: Object used to update a personal access token. + :param data: Object used to update an access token. :type data: PersonalAccessTokenUpdateData """ super().__init__(kwargs) 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 1ca1e9c40e..2bd4f0d216 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"]. + :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"]. :type value: str """ @@ -27,6 +27,8 @@ class PersonalAccessTokensSort(ModelSimple): "-created_at", "expires_at", "-expires_at", + "last_used_at", + "-last_used_at", } NAME_ASCENDING: ClassVar["PersonalAccessTokensSort"] NAME_DESCENDING: ClassVar["PersonalAccessTokensSort"] @@ -34,6 +36,8 @@ class PersonalAccessTokensSort(ModelSimple): CREATED_AT_DESCENDING: ClassVar["PersonalAccessTokensSort"] EXPIRES_AT_ASCENDING: ClassVar["PersonalAccessTokensSort"] EXPIRES_AT_DESCENDING: ClassVar["PersonalAccessTokensSort"] + LAST_USED_AT_ASCENDING: ClassVar["PersonalAccessTokensSort"] + LAST_USED_AT_DESCENDING: ClassVar["PersonalAccessTokensSort"] @cached_property def openapi_types(_): @@ -48,3 +52,5 @@ def openapi_types(_): PersonalAccessTokensSort.CREATED_AT_DESCENDING = PersonalAccessTokensSort("-created_at") PersonalAccessTokensSort.EXPIRES_AT_ASCENDING = PersonalAccessTokensSort("expires_at") 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") diff --git a/src/datadog_api_client/v2/model/relationship_to_access_token_owner.py b/src/datadog_api_client/v2/model/relationship_to_access_token_owner.py new file mode 100644 index 0000000000..a1574cbb89 --- /dev/null +++ b/src/datadog_api_client/v2/model/relationship_to_access_token_owner.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.relationship_to_access_token_owner_data import RelationshipToAccessTokenOwnerData + + +class RelationshipToAccessTokenOwner(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_access_token_owner_data import ( + RelationshipToAccessTokenOwnerData, + ) + + return { + "data": (RelationshipToAccessTokenOwnerData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RelationshipToAccessTokenOwnerData, **kwargs): + """ + Relationship to the access token's owner. + + :param data: Relationship to the access token's owner. + :type data: RelationshipToAccessTokenOwnerData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/relationship_to_access_token_owner_data.py b/src/datadog_api_client/v2/model/relationship_to_access_token_owner_data.py new file mode 100644 index 0000000000..1c65020369 --- /dev/null +++ b/src/datadog_api_client/v2/model/relationship_to_access_token_owner_data.py @@ -0,0 +1,46 @@ +# 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.access_token_owner_type import AccessTokenOwnerType + + +class RelationshipToAccessTokenOwnerData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.access_token_owner_type import AccessTokenOwnerType + + return { + "id": (str,), + "type": (AccessTokenOwnerType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: AccessTokenOwnerType, **kwargs): + """ + Relationship to the access token's owner. + + :param id: A unique identifier that represents the owner. + :type id: str + + :param type: Owner resource type. Either a user or a service account. + :type type: AccessTokenOwnerType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/relationship_to_service_account.py b/src/datadog_api_client/v2/model/relationship_to_service_account.py new file mode 100644 index 0000000000..0248283a71 --- /dev/null +++ b/src/datadog_api_client/v2/model/relationship_to_service_account.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.relationship_to_service_account_data import RelationshipToServiceAccountData + + +class RelationshipToServiceAccount(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.relationship_to_service_account_data import RelationshipToServiceAccountData + + return { + "data": (RelationshipToServiceAccountData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: RelationshipToServiceAccountData, **kwargs): + """ + Relationship to service account. + + :param data: Relationship to service account object. + :type data: RelationshipToServiceAccountData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/relationship_to_service_account_data.py b/src/datadog_api_client/v2/model/relationship_to_service_account_data.py new file mode 100644 index 0000000000..88ed95bf64 --- /dev/null +++ b/src/datadog_api_client/v2/model/relationship_to_service_account_data.py @@ -0,0 +1,46 @@ +# 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.service_account_type import ServiceAccountType + + +class RelationshipToServiceAccountData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_account_type import ServiceAccountType + + return { + "id": (str,), + "type": (ServiceAccountType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: ServiceAccountType, **kwargs): + """ + Relationship to service account object. + + :param id: A unique identifier that represents the service account. + :type id: str + + :param type: Service account resource type. + :type type: ServiceAccountType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_access_token.py b/src/datadog_api_client/v2/model/service_access_token.py new file mode 100644 index 0000000000..851588aa5f --- /dev/null +++ b/src/datadog_api_client/v2/model/service_access_token.py @@ -0,0 +1,74 @@ +# 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.service_access_token_relationships import ServiceAccessTokenRelationships + from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType + + +class ServiceAccessToken(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_access_token_attributes import ServiceAccessTokenAttributes + from datadog_api_client.v2.model.service_access_token_relationships import ServiceAccessTokenRelationships + from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType + + return { + "attributes": (ServiceAccessTokenAttributes,), + "id": (str,), + "relationships": (ServiceAccessTokenRelationships,), + "type": (ServiceAccessTokensType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: Union[ServiceAccessTokenAttributes, UnsetType] = unset, + id: Union[str, UnsetType] = unset, + relationships: Union[ServiceAccessTokenRelationships, UnsetType] = unset, + type: Union[ServiceAccessTokensType, UnsetType] = unset, + **kwargs, + ): + """ + Datadog access token. + + :param attributes: Attributes of an access token. + :type attributes: ServiceAccessTokenAttributes, optional + + :param id: ID of the access token. + :type id: str, optional + + :param relationships: Resources related to the access token. + :type relationships: ServiceAccessTokenRelationships, optional + + :param type: Service access tokens resource type. + :type type: ServiceAccessTokensType, optional + """ + if attributes is not unset: + kwargs["attributes"] = attributes + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_access_token_attributes.py b/src/datadog_api_client/v2/model/service_access_token_attributes.py new file mode 100644 index 0000000000..0b4e64e70c --- /dev/null +++ b/src/datadog_api_client/v2/model/service_access_token_attributes.py @@ -0,0 +1,97 @@ +# 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 List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, + none_type, + unset, + UnsetType, +) + + +class ServiceAccessTokenAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "created_at": (datetime,), + "expires_at": (datetime, none_type), + "last_used_at": (datetime, none_type), + "modified_at": (datetime, none_type), + "name": (str,), + "public_portion": (str,), + "scopes": ([str],), + } + + attribute_map = { + "created_at": "created_at", + "expires_at": "expires_at", + "last_used_at": "last_used_at", + "modified_at": "modified_at", + "name": "name", + "public_portion": "public_portion", + "scopes": "scopes", + } + read_only_vars = { + "created_at", + "expires_at", + "last_used_at", + "modified_at", + "public_portion", + } + + def __init__( + self_, + created_at: Union[datetime, UnsetType] = unset, + expires_at: Union[datetime, none_type, UnsetType] = unset, + last_used_at: Union[datetime, none_type, UnsetType] = unset, + modified_at: Union[datetime, none_type, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + public_portion: Union[str, UnsetType] = unset, + scopes: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Attributes of an access token. + + :param created_at: Creation date of the access token. + :type created_at: datetime, optional + + :param expires_at: Expiration date of the access token. + :type expires_at: datetime, none_type, optional + + :param last_used_at: Date the access token was last used. + :type last_used_at: datetime, none_type, optional + + :param modified_at: Date of last modification of the access token. + :type modified_at: datetime, none_type, optional + + :param name: Name of the access token. + :type name: str, optional + + :param public_portion: The public portion of the access token. + :type public_portion: str, optional + + :param scopes: Array of scopes granted to the access token. + :type scopes: [str], optional + """ + if created_at is not unset: + kwargs["created_at"] = created_at + if expires_at is not unset: + kwargs["expires_at"] = expires_at + if last_used_at is not unset: + kwargs["last_used_at"] = last_used_at + if modified_at is not unset: + kwargs["modified_at"] = modified_at + if name is not unset: + kwargs["name"] = name + if public_portion is not unset: + kwargs["public_portion"] = public_portion + if scopes is not unset: + kwargs["scopes"] = scopes + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_access_token_create_response.py b/src/datadog_api_client/v2/model/service_access_token_create_response.py new file mode 100644 index 0000000000..421978064a --- /dev/null +++ b/src/datadog_api_client/v2/model/service_access_token_create_response.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.full_service_access_token import FullServiceAccessToken + + +class ServiceAccessTokenCreateResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.full_service_access_token import FullServiceAccessToken + + return { + "data": (FullServiceAccessToken,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[FullServiceAccessToken, UnsetType] = unset, **kwargs): + """ + Response for creating an access token. Includes the token key. + + :param data: Datadog access token, including the token key. + :type data: FullServiceAccessToken, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) 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 new file mode 100644 index 0000000000..568e87e5b6 --- /dev/null +++ b/src/datadog_api_client/v2/model/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 ServiceAccessTokenRelationships(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/service_access_token_response.py b/src/datadog_api_client/v2/model/service_access_token_response.py new file mode 100644 index 0000000000..b453a89d4a --- /dev/null +++ b/src/datadog_api_client/v2/model/service_access_token_response.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.service_access_token import ServiceAccessToken + + +class ServiceAccessTokenResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_access_token import ServiceAccessToken + + return { + "data": (ServiceAccessToken,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[ServiceAccessToken, UnsetType] = unset, **kwargs): + """ + Response for retrieving an access token. + + :param data: Datadog access token. + :type data: ServiceAccessToken, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_access_token_response_meta.py b/src/datadog_api_client/v2/model/service_access_token_response_meta.py new file mode 100644 index 0000000000..7b2017ecbb --- /dev/null +++ b/src/datadog_api_client/v2/model/service_access_token_response_meta.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 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_response_meta_page import ServiceAccessTokenResponseMetaPage + + +class ServiceAccessTokenResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_access_token_response_meta_page import ( + ServiceAccessTokenResponseMetaPage, + ) + + return { + "page": (ServiceAccessTokenResponseMetaPage,), + } + + attribute_map = { + "page": "page", + } + + def __init__(self_, page: Union[ServiceAccessTokenResponseMetaPage, UnsetType] = unset, **kwargs): + """ + Additional information related to the access token response. + + :param page: Pagination information. + :type page: ServiceAccessTokenResponseMetaPage, optional + """ + if page is not unset: + kwargs["page"] = page + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_access_token_response_meta_page.py b/src/datadog_api_client/v2/model/service_access_token_response_meta_page.py new file mode 100644 index 0000000000..4732c91948 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_access_token_response_meta_page.py @@ -0,0 +1,36 @@ +# 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 + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ServiceAccessTokenResponseMetaPage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "total_filtered_count": (int,), + } + + attribute_map = { + "total_filtered_count": "total_filtered_count", + } + + def __init__(self_, total_filtered_count: Union[int, UnsetType] = unset, **kwargs): + """ + Pagination information. + + :param total_filtered_count: Total filtered access token count. + :type total_filtered_count: int, optional + """ + if total_filtered_count is not unset: + kwargs["total_filtered_count"] = total_filtered_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_access_tokens_type.py b/src/datadog_api_client/v2/model/service_access_tokens_type.py new file mode 100644 index 0000000000..e4a9efa325 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_access_tokens_type.py @@ -0,0 +1,35 @@ +# 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 ServiceAccessTokensType(ModelSimple): + """ + Service access tokens resource type. + + :param value: If omitted defaults to "service_access_tokens". Must be one of ["service_access_tokens"]. + :type value: str + """ + + allowed_values = { + "service_access_tokens", + } + SERVICE_ACCESS_TOKENS: ClassVar["ServiceAccessTokensType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ServiceAccessTokensType.SERVICE_ACCESS_TOKENS = ServiceAccessTokensType("service_access_tokens") diff --git a/src/datadog_api_client/v2/model/service_account_access_token_create_data.py b/src/datadog_api_client/v2/model/service_account_access_token_create_data.py index 9afa038925..8ee8f4e844 100644 --- a/src/datadog_api_client/v2/model/service_account_access_token_create_data.py +++ b/src/datadog_api_client/v2/model/service_account_access_token_create_data.py @@ -15,7 +15,7 @@ from datadog_api_client.v2.model.service_account_access_token_create_attributes import ( ServiceAccountAccessTokenCreateAttributes, ) - from datadog_api_client.v2.model.personal_access_tokens_type import PersonalAccessTokensType + from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType class ServiceAccountAccessTokenCreateData(ModelNormal): @@ -24,11 +24,11 @@ def openapi_types(_): from datadog_api_client.v2.model.service_account_access_token_create_attributes import ( ServiceAccountAccessTokenCreateAttributes, ) - from datadog_api_client.v2.model.personal_access_tokens_type import PersonalAccessTokensType + from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType return { "attributes": (ServiceAccountAccessTokenCreateAttributes,), - "type": (PersonalAccessTokensType,), + "type": (ServiceAccessTokensType,), } attribute_map = { @@ -36,17 +36,15 @@ def openapi_types(_): "type": "type", } - def __init__( - self_, attributes: ServiceAccountAccessTokenCreateAttributes, type: PersonalAccessTokensType, **kwargs - ): + def __init__(self_, attributes: ServiceAccountAccessTokenCreateAttributes, type: ServiceAccessTokensType, **kwargs): """ Object used to create a service account access token. :param attributes: Attributes used to create a service account access token. :type attributes: ServiceAccountAccessTokenCreateAttributes - :param type: Personal access tokens resource type. - :type type: PersonalAccessTokensType + :param type: Service access tokens resource type. + :type type: ServiceAccessTokensType """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_account_access_token_update_attributes.py b/src/datadog_api_client/v2/model/service_account_access_token_update_attributes.py new file mode 100644 index 0000000000..a191c35f93 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_account_access_token_update_attributes.py @@ -0,0 +1,43 @@ +# 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 List, Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ServiceAccountAccessTokenUpdateAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "name": (str,), + "scopes": ([str],), + } + + attribute_map = { + "name": "name", + "scopes": "scopes", + } + + def __init__(self_, name: Union[str, UnsetType] = unset, scopes: Union[List[str], UnsetType] = unset, **kwargs): + """ + Attributes used to update a service account access token. + + :param name: Name of the access token. + :type name: str, optional + + :param scopes: Array of scopes to grant the access token. + :type scopes: [str], optional + """ + if name is not unset: + kwargs["name"] = name + if scopes is not unset: + kwargs["scopes"] = scopes + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/service_account_access_token_update_data.py b/src/datadog_api_client/v2/model/service_account_access_token_update_data.py new file mode 100644 index 0000000000..99553fb980 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_account_access_token_update_data.py @@ -0,0 +1,60 @@ +# 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.service_account_access_token_update_attributes import ( + ServiceAccountAccessTokenUpdateAttributes, + ) + from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType + + +class ServiceAccountAccessTokenUpdateData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_account_access_token_update_attributes import ( + ServiceAccountAccessTokenUpdateAttributes, + ) + from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType + + return { + "attributes": (ServiceAccountAccessTokenUpdateAttributes,), + "id": (str,), + "type": (ServiceAccessTokensType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, attributes: ServiceAccountAccessTokenUpdateAttributes, id: str, type: ServiceAccessTokensType, **kwargs + ): + """ + Object used to update a service account access token. + + :param attributes: Attributes used to update a service account access token. + :type attributes: ServiceAccountAccessTokenUpdateAttributes + + :param id: ID of the access token. + :type id: str + + :param type: Service access tokens resource type. + :type type: ServiceAccessTokensType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/service_account_access_token_update_request.py b/src/datadog_api_client/v2/model/service_account_access_token_update_request.py new file mode 100644 index 0000000000..5816f8ce9c --- /dev/null +++ b/src/datadog_api_client/v2/model/service_account_access_token_update_request.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 TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.service_account_access_token_update_data import ServiceAccountAccessTokenUpdateData + + +class ServiceAccountAccessTokenUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.service_account_access_token_update_data import ( + ServiceAccountAccessTokenUpdateData, + ) + + return { + "data": (ServiceAccountAccessTokenUpdateData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: ServiceAccountAccessTokenUpdateData, **kwargs): + """ + Request used to update a service account access token. + + :param data: Object used to update a service account access token. + :type data: ServiceAccountAccessTokenUpdateData + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/service_account_type.py b/src/datadog_api_client/v2/model/service_account_type.py new file mode 100644 index 0000000000..3409cd15a3 --- /dev/null +++ b/src/datadog_api_client/v2/model/service_account_type.py @@ -0,0 +1,35 @@ +# 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 ServiceAccountType(ModelSimple): + """ + Service account resource type. + + :param value: If omitted defaults to "service_account". Must be one of ["service_account"]. + :type value: str + """ + + allowed_values = { + "service_account", + } + SERVICE_ACCOUNT: ClassVar["ServiceAccountType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +ServiceAccountType.SERVICE_ACCOUNT = ServiceAccountType("service_account") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index cea5bec21d..ddce61d117 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -126,6 +126,10 @@ from datadog_api_client.v2.model.aws_regions_include_only import AWSRegionsIncludeOnly from datadog_api_client.v2.model.aws_resources_config import AWSResourcesConfig from datadog_api_client.v2.model.aws_traces_config import AWSTracesConfig +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_tokens_type import AccessTokensType from datadog_api_client.v2.model.account_filtering_config import AccountFilteringConfig from datadog_api_client.v2.model.action_connection_attributes import ActionConnectionAttributes from datadog_api_client.v2.model.action_connection_attributes_update import ActionConnectionAttributesUpdate @@ -2698,6 +2702,8 @@ 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_service_access_token import FullServiceAccessToken +from datadog_api_client.v2.model.full_service_access_token_attributes import FullServiceAccessTokenAttributes 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 @@ -3913,6 +3919,7 @@ from datadog_api_client.v2.model.list_scorecard_scores_response import ListScorecardScoresResponse from datadog_api_client.v2.model.list_scorecards_response import ListScorecardsResponse from datadog_api_client.v2.model.list_security_findings_response import ListSecurityFindingsResponse +from datadog_api_client.v2.model.list_service_access_tokens_response import ListServiceAccessTokensResponse from datadog_api_client.v2.model.list_tags_response import ListTagsResponse from datadog_api_client.v2.model.list_tags_response_data import ListTagsResponseData from datadog_api_client.v2.model.list_tags_response_data_attributes import ListTagsResponseDataAttributes @@ -5887,6 +5894,8 @@ from datadog_api_client.v2.model.relation_to_entity import RelationToEntity from datadog_api_client.v2.model.relation_type import RelationType from datadog_api_client.v2.model.relationship_item import RelationshipItem +from datadog_api_client.v2.model.relationship_to_access_token_owner import RelationshipToAccessTokenOwner +from datadog_api_client.v2.model.relationship_to_access_token_owner_data import RelationshipToAccessTokenOwnerData from datadog_api_client.v2.model.relationship_to_incident import RelationshipToIncident from datadog_api_client.v2.model.relationship_to_incident_attachment import RelationshipToIncidentAttachment from datadog_api_client.v2.model.relationship_to_incident_attachment_data import RelationshipToIncidentAttachmentData @@ -5936,6 +5945,8 @@ from datadog_api_client.v2.model.relationship_to_saml_assertion_attribute_data import ( RelationshipToSAMLAssertionAttributeData, ) +from datadog_api_client.v2.model.relationship_to_service_account import RelationshipToServiceAccount +from datadog_api_client.v2.model.relationship_to_service_account_data import RelationshipToServiceAccountData from datadog_api_client.v2.model.relationship_to_team import RelationshipToTeam from datadog_api_client.v2.model.relationship_to_team_data import RelationshipToTeamData from datadog_api_client.v2.model.relationship_to_team_link_data import RelationshipToTeamLinkData @@ -7075,6 +7086,14 @@ from datadog_api_client.v2.model.sensitive_data_scanner_text_replacement_type import ( SensitiveDataScannerTextReplacementType, ) +from datadog_api_client.v2.model.service_access_token import ServiceAccessToken +from datadog_api_client.v2.model.service_access_token_attributes import ServiceAccessTokenAttributes +from datadog_api_client.v2.model.service_access_token_create_response import ServiceAccessTokenCreateResponse +from datadog_api_client.v2.model.service_access_token_relationships import ServiceAccessTokenRelationships +from datadog_api_client.v2.model.service_access_token_response import ServiceAccessTokenResponse +from datadog_api_client.v2.model.service_access_token_response_meta import ServiceAccessTokenResponseMeta +from datadog_api_client.v2.model.service_access_token_response_meta_page import ServiceAccessTokenResponseMetaPage +from datadog_api_client.v2.model.service_access_tokens_type import ServiceAccessTokensType from datadog_api_client.v2.model.service_account_access_token_create_attributes import ( ServiceAccountAccessTokenCreateAttributes, ) @@ -7082,9 +7101,17 @@ from datadog_api_client.v2.model.service_account_access_token_create_request import ( ServiceAccountAccessTokenCreateRequest, ) +from datadog_api_client.v2.model.service_account_access_token_update_attributes import ( + ServiceAccountAccessTokenUpdateAttributes, +) +from datadog_api_client.v2.model.service_account_access_token_update_data import ServiceAccountAccessTokenUpdateData +from datadog_api_client.v2.model.service_account_access_token_update_request import ( + ServiceAccountAccessTokenUpdateRequest, +) from datadog_api_client.v2.model.service_account_create_attributes import ServiceAccountCreateAttributes from datadog_api_client.v2.model.service_account_create_data import ServiceAccountCreateData from datadog_api_client.v2.model.service_account_create_request import ServiceAccountCreateRequest +from datadog_api_client.v2.model.service_account_type import ServiceAccountType from datadog_api_client.v2.model.service_definition_create_response import ServiceDefinitionCreateResponse from datadog_api_client.v2.model.service_definition_data import ServiceDefinitionData from datadog_api_client.v2.model.service_definition_data_attributes import ServiceDefinitionDataAttributes @@ -8588,6 +8615,10 @@ "AWSRegionsIncludeOnly", "AWSResourcesConfig", "AWSTracesConfig", + "AccessTokenListItem", + "AccessTokenListItemRelationships", + "AccessTokenOwnerType", + "AccessTokensType", "AccountFilteringConfig", "ActionConnectionAttributes", "ActionConnectionAttributesUpdate", @@ -10536,6 +10567,8 @@ "FullCustomFrameworkDataAttributes", "FullPersonalAccessToken", "FullPersonalAccessTokenAttributes", + "FullServiceAccessToken", + "FullServiceAccessTokenAttributes", "GCPCredentials", "GCPCredentialsUpdate", "GCPIntegration", @@ -11459,6 +11492,7 @@ "ListScorecardScoresResponse", "ListScorecardsResponse", "ListSecurityFindingsResponse", + "ListServiceAccessTokensResponse", "ListTagsResponse", "ListTagsResponseData", "ListTagsResponseDataAttributes", @@ -12683,6 +12717,8 @@ "RelationToEntity", "RelationType", "RelationshipItem", + "RelationshipToAccessTokenOwner", + "RelationshipToAccessTokenOwnerData", "RelationshipToIncident", "RelationshipToIncidentAttachment", "RelationshipToIncidentAttachmentData", @@ -12718,6 +12754,8 @@ "RelationshipToRuleDataObject", "RelationshipToSAMLAssertionAttribute", "RelationshipToSAMLAssertionAttributeData", + "RelationshipToServiceAccount", + "RelationshipToServiceAccountData", "RelationshipToTeam", "RelationshipToTeamData", "RelationshipToTeamLinkData", @@ -13421,12 +13459,24 @@ "SensitiveDataScannerSuppressions", "SensitiveDataScannerTextReplacement", "SensitiveDataScannerTextReplacementType", + "ServiceAccessToken", + "ServiceAccessTokenAttributes", + "ServiceAccessTokenCreateResponse", + "ServiceAccessTokenRelationships", + "ServiceAccessTokenResponse", + "ServiceAccessTokenResponseMeta", + "ServiceAccessTokenResponseMetaPage", + "ServiceAccessTokensType", "ServiceAccountAccessTokenCreateAttributes", "ServiceAccountAccessTokenCreateData", "ServiceAccountAccessTokenCreateRequest", + "ServiceAccountAccessTokenUpdateAttributes", + "ServiceAccountAccessTokenUpdateData", + "ServiceAccountAccessTokenUpdateRequest", "ServiceAccountCreateAttributes", "ServiceAccountCreateData", "ServiceAccountCreateRequest", + "ServiceAccountType", "ServiceDefinitionCreateResponse", "ServiceDefinitionData", "ServiceDefinitionDataAttributes", diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_access_token_for_a_service_account_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_an_access_token_for_a_service_account_returns_created_response.frozen index 7ccf87f4bd..3b342ca6ea 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_an_access_token_for_a_service_account_returns_created_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_create_an_access_token_for_a_service_account_returns_created_response.frozen @@ -1 +1 @@ -2026-04-16T20:03:06.304Z \ No newline at end of file +2026-05-28T14:36:43.282Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_an_access_token_for_a_service_account_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_an_access_token_for_a_service_account_returns_created_response.yaml index 9058ede130..c1a2855113 100644 --- a/tests/v2/cassettes/test_scenarios/test_create_an_access_token_for_a_service_account_returns_created_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_create_an_access_token_for_a_service_account_returns_created_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"email":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786@datadoghq.com","service_account":true,"title":"user + body: '{"data":{"attributes":{"email":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1779979003@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: accept: @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/service_accounts response: body: - string: '{"data":{"type":"users","id":"498cce13-39cf-11f1-9928-be1871753dee","attributes":{"uuid":"498cce13-39cf-11f1-9928-be1871753dee","name":null,"handle":"498cce13-39cf-11f1-9928-be1871753dee","created_at":"2026-04-16T20:03:08.017467+00:00","modified_at":"2026-04-16T20:03:08.017467+00:00","email":"test-create_an_access_token_for_a_service_account_returns_created_response-1776369786@datadoghq.com","icon":"https://secure.gravatar.com/avatar/ed167ebfacd06c99ea70d4c121f5a7f1?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"a6a9f992-5aa2-11f1-8c27-ea4c41923911","attributes":{"uuid":"a6a9f992-5aa2-11f1-8c27-ea4c41923911","name":null,"handle":"a6a9f992-5aa2-11f1-8c27-ea4c41923911","created_at":"2026-05-28T14:36:45.255584+00:00","modified_at":"2026-05-28T14:36:45.255584+00:00","email":"test-create_an_access_token_for_a_service_account_returns_created_response-1779979003@datadoghq.com","icon":"https://secure.gravatar.com/avatar/a1a6182d465264feebf3b6d627a99b67?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -22,17 +22,17 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + body: '{"data":{"attributes":{"name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1779979003","scopes":["dashboards_read"]},"type":"service_access_tokens"}}' headers: accept: - application/json content-type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/a6a9f992-5aa2-11f1-8c27-ea4c41923911/access_tokens response: body: - string: '{"data":{"id":"88337232-8552-4495-987c-1cfed567d461","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:08.381725456Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1776369786","public_portion":"ddpat_490SyfYQqhqnr008BTjQWn","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"498cce13-39cf-11f1-9928-be1871753dee","type":"users"}}}}}' + string: '{"data":{"id":"7767e407-9c67-4ede-902e-c4b1f3782352","type":"service_access_tokens","attributes":{"created_at":"2026-05-28T14:36:45.736320584Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxXxxxxxxxXxxx","name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1779979003","public_portion":"ddsat_3dJZ2IClhMOwsx0xC01NBK","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"a6a9f992-5aa2-11f1-8c27-ea4c41923911","type":"service_account"}}}}}' headers: content-type: - application/vnd.api+json @@ -45,7 +45,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/498cce13-39cf-11f1-9928-be1871753dee/access_tokens/88337232-8552-4495-987c-1cfed567d461 + uri: https://api.datadoghq.com/api/v2/service_accounts/a6a9f992-5aa2-11f1-8c27-ea4c41923911/access_tokens/7767e407-9c67-4ede-902e-c4b1f3782352 response: body: string: '' @@ -59,7 +59,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/498cce13-39cf-11f1-9928-be1871753dee + uri: https://api.datadoghq.com/api/v2/users/a6a9f992-5aa2-11f1-8c27-ea4c41923911 response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_access_token_for_a_service_account_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_an_access_token_for_a_service_account_returns_ok_response.frozen index 767a9f9c25..ac6f957711 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_an_access_token_for_a_service_account_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_get_an_access_token_for_a_service_account_returns_ok_response.frozen @@ -1 +1 @@ -2026-04-16T20:03:09.123Z \ No newline at end of file +2026-05-28T14:36:46.627Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_access_token_for_a_service_account_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_an_access_token_for_a_service_account_returns_ok_response.yaml index f4dd3f079e..528edcb052 100644 --- a/tests/v2/cassettes/test_scenarios/test_get_an_access_token_for_a_service_account_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_get_an_access_token_for_a_service_account_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"email":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789@datadoghq.com","service_account":true,"title":"user + body: '{"data":{"attributes":{"email":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1779979006@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: accept: @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/service_accounts response: body: - string: '{"data":{"type":"users","id":"4a56376d-39cf-11f1-9a29-2eb65349fc01","attributes":{"uuid":"4a56376d-39cf-11f1-9a29-2eb65349fc01","name":null,"handle":"4a56376d-39cf-11f1-9a29-2eb65349fc01","created_at":"2026-04-16T20:03:09.337439+00:00","modified_at":"2026-04-16T20:03:09.337439+00:00","email":"test-get_an_access_token_for_a_service_account_returns_ok_response-1776369789@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7473377b9dced0689feddb50f5d82d29?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c","attributes":{"uuid":"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c","name":null,"handle":"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c","created_at":"2026-05-28T14:36:46.886919+00:00","modified_at":"2026-05-28T14:36:46.886919+00:00","email":"test-get_an_access_token_for_a_service_account_returns_ok_response-1779979006@datadoghq.com","icon":"https://secure.gravatar.com/avatar/eaa658a03758d4761147dd7431d1c8f5?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -22,17 +22,17 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + body: '{"data":{"attributes":{"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1779979006","scopes":["dashboards_read"]},"type":"service_access_tokens"}}' headers: accept: - application/json content-type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c/access_tokens response: body: - string: '{"data":{"id":"b84d8c2c-b88c-4f72-82ef-fc09dddd1153","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:09.695802251Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","public_portion":"ddpat_5bm1hhcTKQzH22hPiJgkEN","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4a56376d-39cf-11f1-9a29-2eb65349fc01","type":"users"}}}}}' + string: '{"data":{"id":"0abefcae-90ed-4670-94ab-7cea6ca9fb6f","type":"service_access_tokens","attributes":{"created_at":"2026-05-28T14:36:47.296135174Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxXxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1779979006","public_portion":"ddsat_0KHCgRdjSyb8EMXtz1E5Cp","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c","type":"service_account"}}}}}' headers: content-type: - application/vnd.api+json @@ -45,10 +45,10 @@ interactions: accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153 + uri: https://api.datadoghq.com/api/v2/service_accounts/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/0abefcae-90ed-4670-94ab-7cea6ca9fb6f response: body: - string: '{"data":{"id":"b84d8c2c-b88c-4f72-82ef-fc09dddd1153","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:09.695802Z","expires_at":null,"last_used_at":null,"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1776369789","public_portion":"ddpat_5bm1hhcTKQzH22hPiJgkEN","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4a56376d-39cf-11f1-9a29-2eb65349fc01","type":"users"}}}}}' + string: '{"data":{"id":"0abefcae-90ed-4670-94ab-7cea6ca9fb6f","type":"service_access_tokens","attributes":{"created_at":"2026-05-28T14:36:47.296135Z","expires_at":null,"last_used_at":null,"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1779979006","public_portion":"ddsat_0KHCgRdjSyb8EMXtz1E5Cp","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"a7a2e511-5aa2-11f1-80a5-eec0508b7e6c","type":"service_account"}}}}}' headers: content-type: - application/vnd.api+json @@ -61,7 +61,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/4a56376d-39cf-11f1-9a29-2eb65349fc01/access_tokens/b84d8c2c-b88c-4f72-82ef-fc09dddd1153 + uri: https://api.datadoghq.com/api/v2/service_accounts/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/0abefcae-90ed-4670-94ab-7cea6ca9fb6f response: body: string: '' @@ -75,7 +75,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/4a56376d-39cf-11f1-9a29-2eb65349fc01 + uri: https://api.datadoghq.com/api/v2/users/a7a2e511-5aa2-11f1-80a5-eec0508b7e6c response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_revoke_an_access_token_for_a_service_account_returns_no_content_response.frozen b/tests/v2/cassettes/test_scenarios/test_revoke_an_access_token_for_a_service_account_returns_no_content_response.frozen index 4a8602fd91..f03d2b6c83 100644 --- a/tests/v2/cassettes/test_scenarios/test_revoke_an_access_token_for_a_service_account_returns_no_content_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_revoke_an_access_token_for_a_service_account_returns_no_content_response.frozen @@ -1 +1 @@ -2026-04-16T20:03:12.932Z \ No newline at end of file +2026-05-28T14:36:48.422Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_revoke_an_access_token_for_a_service_account_returns_no_content_response.yaml b/tests/v2/cassettes/test_scenarios/test_revoke_an_access_token_for_a_service_account_returns_no_content_response.yaml index 73008a5d7b..612898b52d 100644 --- a/tests/v2/cassettes/test_scenarios/test_revoke_an_access_token_for_a_service_account_returns_no_content_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_revoke_an_access_token_for_a_service_account_returns_no_content_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"email":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792@datadoghq.com","service_account":true,"title":"user + body: '{"data":{"attributes":{"email":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1779979008@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: accept: @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/service_accounts response: body: - string: '{"data":{"type":"users","id":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","attributes":{"uuid":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","name":null,"handle":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","created_at":"2026-04-16T20:03:13.136998+00:00","modified_at":"2026-04-16T20:03:13.136998+00:00","email":"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1776369792@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7586d09a6a08e32a963f425a34463a4d?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"a8b64d35-5aa2-11f1-80a5-eec0508b7e6c","attributes":{"uuid":"a8b64d35-5aa2-11f1-80a5-eec0508b7e6c","name":null,"handle":"a8b64d35-5aa2-11f1-80a5-eec0508b7e6c","created_at":"2026-05-28T14:36:48.691799+00:00","modified_at":"2026-05-28T14:36:48.691799+00:00","email":"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1779979008@datadoghq.com","icon":"https://secure.gravatar.com/avatar/80f71434c485335573c82ccfeff519ef?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -22,17 +22,17 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + body: '{"data":{"attributes":{"name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1779979008","scopes":["dashboards_read"]},"type":"service_access_tokens"}}' headers: accept: - application/json content-type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c/access_tokens response: body: - string: '{"data":{"id":"a5b5e3c3-2b58-448b-a1b1-5c97f16837a6","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:13.505344652Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1776369792","public_portion":"ddpat_52grBIAi4zKGY0uxhjLVVW","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4c99fbee-39cf-11f1-beb2-cad70c641dfa","type":"users"}}}}}' + string: '{"data":{"id":"7829a158-515b-4c28-b649-eca6529a02b7","type":"service_access_tokens","attributes":{"created_at":"2026-05-28T14:36:49.115287243Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1779979008","public_portion":"ddsat_3ek6Sznp1LswenIQzJ44yl","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"a8b64d35-5aa2-11f1-80a5-eec0508b7e6c","type":"service_account"}}}}}' headers: content-type: - application/vnd.api+json @@ -45,7 +45,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6 + uri: https://api.datadoghq.com/api/v2/service_accounts/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/7829a158-515b-4c28-b649-eca6529a02b7 response: body: string: '' @@ -59,7 +59,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/4c99fbee-39cf-11f1-beb2-cad70c641dfa/access_tokens/a5b5e3c3-2b58-448b-a1b1-5c97f16837a6 + uri: https://api.datadoghq.com/api/v2/service_accounts/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c/access_tokens/7829a158-515b-4c28-b649-eca6529a02b7 response: body: string: '' @@ -73,7 +73,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/4c99fbee-39cf-11f1-beb2-cad70c641dfa + uri: https://api.datadoghq.com/api/v2/users/a8b64d35-5aa2-11f1-80a5-eec0508b7e6c response: body: string: '' diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_access_token_for_a_service_account_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_an_access_token_for_a_service_account_returns_ok_response.frozen index 58278ff6c0..283bf60d09 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_an_access_token_for_a_service_account_returns_ok_response.frozen +++ b/tests/v2/cassettes/test_scenarios/test_update_an_access_token_for_a_service_account_returns_ok_response.frozen @@ -1 +1 @@ -2026-04-16T20:03:14.527Z \ No newline at end of file +2026-05-28T14:36:50.607Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_an_access_token_for_a_service_account_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_an_access_token_for_a_service_account_returns_ok_response.yaml index 260224fe85..4651681644 100644 --- a/tests/v2/cassettes/test_scenarios/test_update_an_access_token_for_a_service_account_returns_ok_response.yaml +++ b/tests/v2/cassettes/test_scenarios/test_update_an_access_token_for_a_service_account_returns_ok_response.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"data":{"attributes":{"email":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794@datadoghq.com","service_account":true,"title":"user + body: '{"data":{"attributes":{"email":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1779979010@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: accept: @@ -11,7 +11,7 @@ interactions: uri: https://api.datadoghq.com/api/v2/service_accounts response: body: - string: '{"data":{"type":"users","id":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","attributes":{"uuid":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","name":null,"handle":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","created_at":"2026-04-16T20:03:14.742691+00:00","modified_at":"2026-04-16T20:03:14.742691+00:00","email":"test-update_an_access_token_for_a_service_account_returns_ok_response-1776369794@datadoghq.com","icon":"https://secure.gravatar.com/avatar/05aacae415f13819561258b03c973881?s=48&d=retro","title":"user + string: '{"data":{"type":"users","id":"aa1d5972-5aa2-11f1-94cc-52d8072c8863","attributes":{"uuid":"aa1d5972-5aa2-11f1-94cc-52d8072c8863","name":null,"handle":"aa1d5972-5aa2-11f1-94cc-52d8072c8863","created_at":"2026-05-28T14:36:51.044856+00:00","modified_at":"2026-05-28T14:36:51.044856+00:00","email":"test-update_an_access_token_for_a_service_account_returns_ok_response-1779979010@datadoghq.com","icon":"https://secure.gravatar.com/avatar/5a4f64a0801adb0c3e3a456f8540dde0?s=48&d=retro","title":"user title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} ' @@ -22,17 +22,17 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + body: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1779979010","scopes":["dashboards_read"]},"type":"service_access_tokens"}}' headers: accept: - application/json content-type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens + uri: https://api.datadoghq.com/api/v2/service_accounts/aa1d5972-5aa2-11f1-94cc-52d8072c8863/access_tokens response: body: - string: '{"data":{"id":"eafa3dd9-430d-4075-a183-63171c7f3de5","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:15.138533237Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxx","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794","public_portion":"ddpat_79OZ2nUHcB3McO399ZaVVt","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","type":"users"}}}}}' + string: '{"data":{"id":"87e35e26-368c-479b-85bd-1036f303736e","type":"service_access_tokens","attributes":{"created_at":"2026-05-28T14:36:51.482285572Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1779979010","public_portion":"ddsat_48Ps23zLj44c8YDq0ApfDS","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"aa1d5972-5aa2-11f1-94cc-52d8072c8863","type":"service_account"}}}}}' headers: content-type: - application/vnd.api+json @@ -40,17 +40,17 @@ interactions: code: 201 message: Created - request: - body: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794-updated"},"id":"eafa3dd9-430d-4075-a183-63171c7f3de5","type":"personal_access_tokens"}}' + body: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1779979010-updated"},"id":"87e35e26-368c-479b-85bd-1036f303736e","type":"service_access_tokens"}}' headers: accept: - application/json content-type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5 + uri: https://api.datadoghq.com/api/v2/service_accounts/aa1d5972-5aa2-11f1-94cc-52d8072c8863/access_tokens/87e35e26-368c-479b-85bd-1036f303736e response: body: - string: '{"data":{"id":"eafa3dd9-430d-4075-a183-63171c7f3de5","type":"personal_access_tokens","attributes":{"created_at":"2026-04-16T20:03:15.138533Z","expires_at":null,"last_used_at":null,"modified_at":"2026-04-16T20:03:15.375809Z","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1776369794-updated","public_portion":"ddpat_79OZ2nUHcB3McO399ZaVVt","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4","type":"users"}}}}}' + string: '{"data":{"id":"87e35e26-368c-479b-85bd-1036f303736e","type":"service_access_tokens","attributes":{"created_at":"2026-05-28T14:36:51.482285Z","expires_at":null,"last_used_at":null,"modified_at":"2026-05-28T14:36:51.792511Z","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1779979010-updated","public_portion":"ddsat_48Ps23zLj44c8YDq0ApfDS","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"aa1d5972-5aa2-11f1-94cc-52d8072c8863","type":"service_account"}}}}}' headers: content-type: - application/vnd.api+json @@ -63,7 +63,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4/access_tokens/eafa3dd9-430d-4075-a183-63171c7f3de5 + uri: https://api.datadoghq.com/api/v2/service_accounts/aa1d5972-5aa2-11f1-94cc-52d8072c8863/access_tokens/87e35e26-368c-479b-85bd-1036f303736e response: body: string: '' @@ -77,7 +77,7 @@ interactions: accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/4d8efdef-39cf-11f1-bf73-ce6d1c25b9b4 + uri: https://api.datadoghq.com/api/v2/users/aa1d5972-5aa2-11f1-94cc-52d8072c8863 response: body: string: '' diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 7139a86ede..24058ecf5e 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -1344,7 +1344,7 @@ }, { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"scopes\": [\"dashboards_read\"]\n },\n \"type\": \"personal_access_tokens\"\n }\n}" + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"scopes\": [\"dashboards_read\"]\n },\n \"type\": \"service_access_tokens\"\n }\n}" } ], "step": "there is a valid \"service_account_access_token\" for \"service_account_user\"", diff --git a/tests/v2/features/key_management.feature b/tests/v2/features/key_management.feature index b27f150393..4043183b7d 100644 --- a/tests/v2/features/key_management.feature +++ b/tests/v2/features/key_management.feature @@ -245,7 +245,7 @@ Feature: Key Management Scenario: Get a personal access token returns "Not Found" response Given a valid "appKeyAuth" key in the system And new "GetPersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -254,7 +254,7 @@ Feature: Key Management Given a valid "appKeyAuth" key in the system And there is a valid "personal_access_token" in the system And new "GetPersonalAccessToken" request - And request contains "pat_id" parameter from "personal_access_token.data.id" + And request contains "token_id" parameter from "personal_access_token.data.id" When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "personal_access_tokens" @@ -278,6 +278,20 @@ Feature: Key Management And the response "data[0].type" is equal to "api_keys" And the response "data[0].attributes" has field "date_last_used" + @generated @skip @team:DataDog/credentials-management + Scenario: Get all access tokens returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "ListPersonalAccessTokens" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/credentials-management + Scenario: Get all access tokens returns "OK" response + Given a valid "appKeyAuth" key in the system + And new "ListPersonalAccessTokens" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/credentials-management Scenario: Get all application keys owned by current user returns "Bad Request" response Given a valid "appKeyAuth" key in the system @@ -325,13 +339,6 @@ Feature: Key Management And the response "data[0].type" is equal to "application_keys" And the response "data[0].attributes" has field "last_used_at" - @generated @skip @team:DataDog/credentials-management - Scenario: Get all personal access tokens returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "ListPersonalAccessTokens" request - When the request is sent - Then the response status is 400 Bad Request - @team:DataDog/credentials-management Scenario: Get all personal access tokens returns "OK" response Given a valid "appKeyAuth" key in the system @@ -396,7 +403,7 @@ Feature: Key Management Given a valid "appKeyAuth" key in the system And there is a valid "personal_access_token" in the system And new "RevokePersonalAccessToken" request - And request contains "pat_id" parameter from "personal_access_token.data.id" + And request contains "token_id" parameter from "personal_access_token.data.id" When the request is sent Then the response status is 204 No Content @@ -404,7 +411,7 @@ Feature: Key Management Scenario: Revoke a personal access token returns "Not Found" response Given a valid "appKeyAuth" key in the system And new "RevokePersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -412,7 +419,7 @@ Feature: Key Management Scenario: Update a personal access token returns "Bad Request" response Given a valid "appKeyAuth" key in the system And new "UpdatePersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -421,7 +428,7 @@ Feature: Key Management Scenario: Update a personal access token returns "Not Found" response Given a valid "appKeyAuth" key in the system And new "UpdatePersonalAccessToken" request - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" parameter from "REPLACE.ME" And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -431,7 +438,7 @@ Feature: Key Management Given a valid "appKeyAuth" key in the system And there is a valid "personal_access_token" in the system And new "UpdatePersonalAccessToken" request - And request contains "pat_id" parameter from "personal_access_token.data.id" + And request contains "token_id" parameter from "personal_access_token.data.id" And body with value {"data": {"type": "personal_access_tokens", "id": "{{ personal_access_token.data.id }}", "attributes": {"name": "{{ unique }}-updated"}}} When the request is sent Then the response status is 200 OK diff --git a/tests/v2/features/service_accounts.feature b/tests/v2/features/service_accounts.feature index fa8c81440e..9b64bed996 100644 --- a/tests/v2/features/service_accounts.feature +++ b/tests/v2/features/service_accounts.feature @@ -33,7 +33,7 @@ Feature: Service Accounts Scenario: Create an access token for a service account returns "Bad Request" response Given new "CreateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "Service Account Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "personal_access_tokens"}} + And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "Service Account Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "service_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -42,10 +42,10 @@ Feature: Service Accounts Given there is a valid "service_account_user" in the system And new "CreateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And body with value {"data": {"type": "personal_access_tokens", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read"]}}} + And body with value {"data": {"type": "service_access_tokens", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read"]}}} When the request is sent Then the response status is 201 Created - And the response "data.type" is equal to "personal_access_tokens" + And the response "data.type" is equal to "service_access_tokens" And the response "data.attributes.name" is equal to "{{ unique }}" And the response "data.relationships.owned_by.data.id" has the same value as "service_account_user.data.id" @@ -53,7 +53,7 @@ Feature: Service Accounts Scenario: Create an access token for a service account returns "Not Found" response Given new "CreateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "Service Account Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "personal_access_tokens"}} + And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "Service Account Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "service_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -142,7 +142,7 @@ Feature: Service Accounts Scenario: Get an access token for a service account returns "Not Found" response Given new "GetServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -152,11 +152,11 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "GetServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_id" parameter from "service_account_access_token.data.id" + And request contains "token_id" parameter from "service_account_access_token.data.id" When the request is sent Then the response status is 200 OK And the response "data.attributes.name" has the same value as "service_account_access_token.data.attributes.name" - And the response "data.type" is equal to "personal_access_tokens" + And the response "data.type" is equal to "service_access_tokens" And the response "data.id" is equal to "{{ service_account_access_token.data.id }}" @generated @skip @team:DataDog/credentials-management @team:DataDog/org-management @@ -232,7 +232,7 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "RevokeServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_id" parameter from "service_account_access_token.data.id" + And request contains "token_id" parameter from "service_account_access_token.data.id" When the request is sent Then the response status is 204 No Content @@ -240,7 +240,7 @@ Feature: Service Accounts Scenario: Revoke an access token for a service account returns "Not Found" response Given new "RevokeServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_id" parameter from "REPLACE.ME" + And request contains "token_id" parameter from "REPLACE.ME" When the request is sent Then the response status is 404 Not Found @@ -248,8 +248,8 @@ Feature: Service Accounts Scenario: Update an access token for a service account returns "Bad Request" response Given new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} + And request contains "token_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "Updated Service Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "service_access_tokens"}} When the request is sent Then the response status is 400 Bad Request @@ -257,8 +257,8 @@ Feature: Service Accounts Scenario: Update an access token for a service account returns "Not Found" response Given new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "REPLACE.ME" - And request contains "pat_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Updated Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "personal_access_tokens"}} + And request contains "token_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "Updated Service Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "id": "00112233-4455-6677-8899-aabbccddeeff", "type": "service_access_tokens"}} When the request is sent Then the response status is 404 Not Found @@ -268,10 +268,10 @@ Feature: Service Accounts And there is a valid "service_account_access_token" for "service_account_user" And new "UpdateServiceAccountAccessToken" request And request contains "service_account_id" parameter from "service_account_user.data.id" - And request contains "pat_id" parameter from "service_account_access_token.data.id" - And body with value {"data": {"id": "{{ service_account_access_token.data.id }}", "type": "personal_access_tokens", "attributes": {"name": "{{ service_account_access_token.data.attributes.name }}-updated"}}} + And request contains "token_id" parameter from "service_account_access_token.data.id" + And body with value {"data": {"id": "{{ service_account_access_token.data.id }}", "type": "service_access_tokens", "attributes": {"name": "{{ service_account_access_token.data.attributes.name }}-updated"}}} When the request is sent Then the response status is 200 OK And the response "data.attributes.name" is equal to "{{ service_account_access_token.data.attributes.name }}-updated" - And the response "data.type" is equal to "personal_access_tokens" + And the response "data.type" is equal to "service_access_tokens" And the response "data.id" is equal to "{{ service_account_access_token.data.id }}" diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index b6003df868..6307f5135f 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -5196,7 +5196,7 @@ "operationId": "RevokePersonalAccessToken", "parameters": [ { - "name": "pat_id", + "name": "token_id", "source": "data.id" } ], @@ -6975,7 +6975,7 @@ "source": "data.relationships.owned_by.data.id" }, { - "name": "pat_id", + "name": "token_id", "source": "data.id" } ],