From d2e79a532c9d51502a82a5bd40d22a8cf5e2ebb5 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 3 Apr 2026 22:47:34 +0000 Subject: [PATCH] Regenerate client from commit 53c92ba of spec repo --- .generator/schemas/v2/openapi.yaml | 748 ++++++++++++++++++ ...cess-token-returns-Created-response.frozen | 1 + ...-access-token-returns-Created-response.yml | 40 + ...cess-token-returns-Created-response.frozen | 1 + ...-access-token-returns-Created-response.yml | 82 ++ ...al-access-token-returns-OK-response.frozen | 1 + ...sonal-access-token-returns-OK-response.yml | 58 ++ ...l-access-tokens-returns-OK-response.frozen | 1 + ...onal-access-tokens-returns-OK-response.yml | 58 ++ ...s-token-returns-No-Content-response.frozen | 1 + ...cess-token-returns-No-Content-response.yml | 56 ++ ...al-access-token-returns-OK-response.frozen | 1 + ...sonal-access-token-returns-OK-response.yml | 62 ++ ...service-account-returns-OK-response.frozen | 2 +- ...-a-service-account-returns-OK-response.yml | 44 +- ...ce-account-returns-Created-response.frozen | 1 + ...rvice-account-returns-Created-response.yml | 82 ++ ...ce-account-returns-Created-response.frozen | 2 +- ...rvice-account-returns-Created-response.yml | 24 +- ...ce-account-returns-Created-response.frozen | 2 +- ...rvice-account-returns-Created-response.yml | 30 +- ...account-returns-No-Content-response.frozen | 2 +- ...ce-account-returns-No-Content-response.yml | 28 +- ...service-account-returns-OK-response.frozen | 2 +- ...is-service-account-returns-OK-response.yml | 32 +- ...service-account-returns-OK-response.frozen | 1 + ...-a-service-account-returns-OK-response.yml | 100 +++ ...service-account-returns-OK-response.frozen | 2 +- ...is-service-account-returns-OK-response.yml | 30 +- ...service-account-returns-OK-response.frozen | 1 + ...-a-service-account-returns-OK-response.yml | 62 ++ ...service-account-returns-OK-response.frozen | 2 +- ...is-service-account-returns-OK-response.yml | 16 +- ...account-returns-No-Content-response.frozen | 1 + ...ce-account-returns-No-Content-response.yml | 98 +++ ...service-account-returns-OK-response.frozen | 1 + ...-a-service-account-returns-OK-response.yml | 104 +++ .../CreatePersonalAccessToken.rb | 18 + .../key-management/GetPersonalAccessToken.rb | 8 + .../ListPersonalAccessTokens.rb | 5 + .../RevokePersonalAccessToken.rb | 8 + .../UpdatePersonalAccessToken.rb | 18 + .../CreateServiceAccountAccessToken.rb | 20 + ...ateServiceAccountAccessToken_4212922277.rb | 20 + .../GetServiceAccountAccessToken.rb | 11 + .../ListServiceAccountAccessTokens.rb | 8 + .../RevokeServiceAccountAccessToken.rb | 11 + .../UpdateServiceAccountAccessToken.rb | 22 + features/scenarios_model_mapping.rb | 44 ++ features/v2/given.json | 28 + features/v2/key_management.feature | 78 ++ features/v2/personal_access_tokens.feature | 98 +++ features/v2/service_accounts.feature | 122 +++ features/v2/undo.json | 78 ++ lib/datadog_api_client/inflector.rb | 21 + .../v2/api/key_management_api.rb | 344 ++++++++ .../v2/api/service_accounts_api.rb | 366 +++++++++ .../v2/models/full_personal_access_token.rb | 135 ++++ .../full_personal_access_token_attributes.rb | 167 ++++ .../list_personal_access_tokens_response.rb | 117 +++ .../v2/models/personal_access_token.rb | 135 ++++ .../personal_access_token_attributes.rb | 186 +++++ ...personal_access_token_create_attributes.rb | 167 ++++ .../personal_access_token_create_data.rb | 144 ++++ .../personal_access_token_create_request.rb | 123 +++ .../personal_access_token_create_response.rb | 105 +++ .../personal_access_token_relationships.rb | 105 +++ .../models/personal_access_token_response.rb | 105 +++ .../personal_access_token_response_meta.rb | 105 +++ ...ersonal_access_token_response_meta_page.rb | 105 +++ ...personal_access_token_update_attributes.rb | 117 +++ .../personal_access_token_update_data.rb | 165 ++++ .../personal_access_token_update_request.rb | 123 +++ .../v2/models/personal_access_tokens_sort.rb | 31 + .../v2/models/personal_access_tokens_type.rb | 26 + ..._account_access_token_create_attributes.rb | 156 ++++ ...ervice_account_access_token_create_data.rb | 144 ++++ ...ice_account_access_token_create_request.rb | 123 +++ 78 files changed, 5585 insertions(+), 106 deletions(-) create mode 100644 cassettes/features/v2/personal_access_tokens/Create-a-personal-access-token-returns-Created-response.frozen create mode 100644 cassettes/features/v2/personal_access_tokens/Create-a-personal-access-token-returns-Created-response.yml create mode 100644 cassettes/features/v2/personal_access_tokens/Create-a-service-account-access-token-returns-Created-response.frozen create mode 100644 cassettes/features/v2/personal_access_tokens/Create-a-service-account-access-token-returns-Created-response.yml create mode 100644 cassettes/features/v2/personal_access_tokens/Get-a-personal-access-token-returns-OK-response.frozen create mode 100644 cassettes/features/v2/personal_access_tokens/Get-a-personal-access-token-returns-OK-response.yml create mode 100644 cassettes/features/v2/personal_access_tokens/Get-all-personal-access-tokens-returns-OK-response.frozen create mode 100644 cassettes/features/v2/personal_access_tokens/Get-all-personal-access-tokens-returns-OK-response.yml create mode 100644 cassettes/features/v2/personal_access_tokens/Revoke-a-personal-access-token-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/personal_access_tokens/Revoke-a-personal-access-token-returns-No-Content-response.yml create mode 100644 cassettes/features/v2/personal_access_tokens/Update-a-personal-access-token-returns-OK-response.frozen create mode 100644 cassettes/features/v2/personal_access_tokens/Update-a-personal-access-token-returns-OK-response.yml create mode 100644 cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen create mode 100644 cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml create mode 100644 cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen create mode 100644 cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml create mode 100644 cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.frozen create mode 100644 cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.yml create mode 100644 cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml create mode 100644 cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen create mode 100644 cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml create mode 100644 examples/v2/key-management/CreatePersonalAccessToken.rb create mode 100644 examples/v2/key-management/GetPersonalAccessToken.rb create mode 100644 examples/v2/key-management/ListPersonalAccessTokens.rb create mode 100644 examples/v2/key-management/RevokePersonalAccessToken.rb create mode 100644 examples/v2/key-management/UpdatePersonalAccessToken.rb create mode 100644 examples/v2/service-accounts/CreateServiceAccountAccessToken.rb create mode 100644 examples/v2/service-accounts/CreateServiceAccountAccessToken_4212922277.rb create mode 100644 examples/v2/service-accounts/GetServiceAccountAccessToken.rb create mode 100644 examples/v2/service-accounts/ListServiceAccountAccessTokens.rb create mode 100644 examples/v2/service-accounts/RevokeServiceAccountAccessToken.rb create mode 100644 examples/v2/service-accounts/UpdateServiceAccountAccessToken.rb create mode 100644 features/v2/personal_access_tokens.feature create mode 100644 lib/datadog_api_client/v2/models/full_personal_access_token.rb create mode 100644 lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/list_personal_access_tokens_response.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_create_response.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_response.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_response_meta.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_response_meta_page.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_token_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_tokens_sort.rb create mode 100644 lib/datadog_api_client/v2/models/personal_access_tokens_type.rb create mode 100644 lib/datadog_api_client/v2/models/service_account_access_token_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/service_account_access_token_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/service_account_access_token_create_request.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 45672b441bd8..aee5d1a3323a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -951,6 +951,41 @@ components: required: true schema: type: string + PersonalAccessTokenID: + description: The UUID of the personal access token. + in: path + name: pat_uuid + 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. + in: query + name: filter[owner_uuid] + required: false + schema: + items: + example: "00000000-0000-1234-0000-000000000000" + type: string + type: array + PersonalAccessTokensFilterParameter: + description: Filter personal access tokens by the specified string. + in: query + name: filter + required: false + schema: + type: string + PersonalAccessTokensSortParameter: + description: |- + Personal 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 + name: sort + required: false + schema: + $ref: "#/components/schemas/PersonalAccessTokensSort" ProductName: description: Name of the product to be deleted, either `logs` or `rum`. in: path @@ -27300,6 +27335,62 @@ components: - name - requirements type: object + FullPersonalAccessToken: + description: Datadog personal access token, including the token key. + properties: + attributes: + $ref: "#/components/schemas/FullPersonalAccessTokenAttributes" + id: + description: ID of the personal access token. + type: string + relationships: + $ref: "#/components/schemas/PersonalAccessTokenRelationships" + type: + $ref: "#/components/schemas/PersonalAccessTokensType" + type: object + FullPersonalAccessTokenAttributes: + description: Attributes of a full personal access token, including the token key. + properties: + alias: + description: The alias (short identifier) of the personal access token. + example: "2H9MCNMBM8FQjQ16YucXkX" + readOnly: true + type: string + created_at: + description: Creation date of the personal 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. + example: "2025-12-31T23:59:59+00:00" + format: date-time + readOnly: true + type: string + key: + description: The personal access token key. Only returned upon creation. + readOnly: true + type: string + name: + description: Name of the personal access token. + example: "My Personal Access Token" + type: string + public_portion: + description: The public portion of the personal access token. + example: "ddpat_abc123" + readOnly: true + type: string + scopes: + description: Array of scopes granted to the personal access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + type: object GCPCredentials: description: The definition of the `GCPCredentials` object. oneOf: @@ -37152,6 +37243,17 @@ components: $ref: "#/components/schemas/OnCallNotificationRulesIncluded" type: array type: object + ListPersonalAccessTokensResponse: + description: Response for a list of personal access tokens. + properties: + data: + description: Array of personal access tokens. + items: + $ref: "#/components/schemas/PersonalAccessToken" + type: array + meta: + $ref: "#/components/schemas/PersonalAccessTokenResponseMeta" + type: object ListPipelinesResponse: description: Represents the response payload containing a list of pipelines and associated metadata. properties: @@ -48767,6 +48869,217 @@ components: type: string x-enum-varnames: - PERMISSIONS + PersonalAccessToken: + description: Datadog personal access token. + properties: + attributes: + $ref: "#/components/schemas/PersonalAccessTokenAttributes" + id: + description: ID of the personal access token. + type: string + relationships: + $ref: "#/components/schemas/PersonalAccessTokenRelationships" + type: + $ref: "#/components/schemas/PersonalAccessTokensType" + type: object + PersonalAccessTokenAttributes: + description: Attributes of a personal access token. + properties: + alias: + description: The alias (short identifier) of the personal access token. + example: "2H9MCNMBM8FQjQ16YucXkX" + readOnly: true + type: string + created_at: + description: Creation date of the personal 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. + example: "2025-12-31T23:59:59+00:00" + format: date-time + readOnly: true + type: string + last_used_at: + description: Date the personal 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. + 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" + type: string + public_portion: + description: The public portion of the personal access token. + example: "ddpat_abc123" + readOnly: true + type: string + scopes: + description: Array of scopes granted to the personal access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + type: object + PersonalAccessTokenCreateAttributes: + description: Attributes used to create a personal access token. + properties: + expires_at: + description: Expiration date of the personal 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. + example: "My Personal Access Token" + type: string + scopes: + description: Array of scopes to grant the personal access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + required: + - name + - scopes + - expires_at + type: object + PersonalAccessTokenCreateData: + description: Object used to create a personal access token. + properties: + attributes: + $ref: "#/components/schemas/PersonalAccessTokenCreateAttributes" + type: + $ref: "#/components/schemas/PersonalAccessTokensType" + required: + - attributes + - type + type: object + PersonalAccessTokenCreateRequest: + description: Request used to create a personal access token. + properties: + data: + $ref: "#/components/schemas/PersonalAccessTokenCreateData" + required: + - data + type: object + PersonalAccessTokenCreateResponse: + description: Response for creating a personal access token. Includes the token key. + properties: + data: + $ref: "#/components/schemas/FullPersonalAccessToken" + type: object + PersonalAccessTokenRelationships: + description: Resources related to the personal access token. + properties: + owned_by: + $ref: "#/components/schemas/RelationshipToUser" + type: object + PersonalAccessTokenResponse: + description: Response for retrieving a personal access token. + properties: + data: + $ref: "#/components/schemas/PersonalAccessToken" + type: object + PersonalAccessTokenResponseMeta: + description: Additional information related to the personal access token response. + properties: + page: + $ref: "#/components/schemas/PersonalAccessTokenResponseMetaPage" + type: object + PersonalAccessTokenResponseMetaPage: + description: Pagination information. + properties: + total_filtered_count: + description: Total filtered personal access token count. + format: int64 + type: integer + type: object + PersonalAccessTokenUpdateAttributes: + description: Attributes used to update a personal access token. + properties: + name: + description: Name of the personal access token. + example: "Updated Personal Access Token" + type: string + scopes: + description: Array of scopes to grant the personal access token. + example: + - "dashboards_read" + - "dashboards_write" + items: + description: Name of scope. + type: string + type: array + type: object + PersonalAccessTokenUpdateData: + description: Object used to update a personal access token. + properties: + attributes: + $ref: "#/components/schemas/PersonalAccessTokenUpdateAttributes" + id: + description: ID of the personal access token. + example: "00112233-4455-6677-8899-aabbccddeeff" + type: string + type: + $ref: "#/components/schemas/PersonalAccessTokensType" + required: + - attributes + - id + - type + type: object + PersonalAccessTokenUpdateRequest: + description: Request used to update a personal access token. + properties: + data: + $ref: "#/components/schemas/PersonalAccessTokenUpdateData" + required: + - data + type: object + PersonalAccessTokensSort: + default: name + description: Sorting options + enum: + - name + - -name + - created_at + - -created_at + - expires_at + - -expires_at + type: string + x-enum-varnames: + - NAME_ASCENDING + - NAME_DESCENDING + - CREATED_AT_ASCENDING + - CREATED_AT_DESCENDING + - EXPIRES_AT_ASCENDING + - EXPIRES_AT_DESCENDING + PersonalAccessTokensType: + default: personal_access_tokens + description: Personal access tokens resource type. + enum: + - personal_access_tokens + example: personal_access_tokens + type: string + x-enum-varnames: + - PERSONAL_ACCESS_TOKENS Playlist: description: A single RUM replay playlist resource returned by create, update, or get operations. properties: @@ -60809,6 +61122,50 @@ components: - REPLACEMENT_STRING - PARTIAL_REPLACEMENT_FROM_BEGINNING - PARTIAL_REPLACEMENT_FROM_END + ServiceAccountAccessTokenCreateAttributes: + description: Attributes used to create a service account access token. + properties: + expires_at: + description: Expiration date of the access token. Optional for service account tokens. + example: "2025-12-31T23:59:59+00:00" + format: date-time + type: string + name: + description: Name of the access token. + example: "Service Account 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 + required: + - name + - scopes + type: object + ServiceAccountAccessTokenCreateData: + description: Object used to create a service account access token. + properties: + attributes: + $ref: "#/components/schemas/ServiceAccountAccessTokenCreateAttributes" + type: + $ref: "#/components/schemas/PersonalAccessTokensType" + required: + - attributes + - type + type: object + ServiceAccountAccessTokenCreateRequest: + description: Request used to create a service account access token. + properties: + data: + $ref: "#/components/schemas/ServiceAccountAccessTokenCreateData" + required: + - data + type: object ServiceAccountCreateAttributes: description: Attributes of the created user. properties: @@ -96619,6 +96976,195 @@ paths: operator: OR permissions: - user_access_read + /api/v2/personal_access_tokens: + get: + description: List all personal 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" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListPersonalAccessTokensResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all personal access tokens + tags: + - Key Management + "x-permission": + operator: OR + permissions: + - user_app_keys + - org_app_keys_read + post: + description: Create a personal access token for the current user. + operationId: CreatePersonalAccessToken + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PersonalAccessTokenCreateRequest" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/PersonalAccessTokenCreateResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a personal access token + tags: + - Key Management + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - user_app_keys + /api/v2/personal_access_tokens/{pat_uuid}: + delete: + description: Revoke a specific personal access token. + operationId: RevokePersonalAccessToken + parameters: + - $ref: "#/components/parameters/PersonalAccessTokenID" + responses: + "204": + description: No Content + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Revoke a personal access token + tags: + - Key Management + "x-permission": + operator: OR + permissions: + - user_app_keys + - org_app_keys_write + get: + description: Get a specific personal access token by its UUID. + operationId: GetPersonalAccessToken + parameters: + - $ref: "#/components/parameters/PersonalAccessTokenID" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PersonalAccessTokenResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a personal access token + tags: + - Key Management + "x-permission": + operator: OR + permissions: + - user_app_keys + - org_app_keys_read + patch: + description: Update a specific personal access token. + operationId: UpdatePersonalAccessToken + parameters: + - $ref: "#/components/parameters/PersonalAccessTokenID" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PersonalAccessTokenUpdateRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PersonalAccessTokenResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a personal access token + tags: + - Key Management + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - user_app_keys + - org_app_keys_write /api/v2/posture_management/findings: get: description: |- @@ -105192,6 +105738,208 @@ paths: operator: OR permissions: - service_account_write + /api/v2/service_accounts/{service_account_id}/access_tokens: + get: + description: List all access tokens for a specific service account. + operationId: ListServiceAccountAccessTokens + parameters: + - $ref: "#/components/parameters/ServiceAccountID" + - $ref: "#/components/parameters/PageSize" + - $ref: "#/components/parameters/PageNumber" + - $ref: "#/components/parameters/PersonalAccessTokensSortParameter" + - $ref: "#/components/parameters/PersonalAccessTokensFilterParameter" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ListPersonalAccessTokensResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List access tokens for a service account + tags: + - Service Accounts + "x-permission": + operator: OR + permissions: + - service_account_write + post: + description: Create an access token for a service account. + operationId: CreateServiceAccountAccessToken + parameters: + - $ref: "#/components/parameters/ServiceAccountID" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ServiceAccountAccessTokenCreateRequest" + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/PersonalAccessTokenCreateResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create an access token for a service account + tags: + - Service Accounts + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - service_account_write + /api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}: + delete: + description: Revoke a specific access token for a service account. + operationId: RevokeServiceAccountAccessToken + parameters: + - $ref: "#/components/parameters/ServiceAccountID" + - $ref: "#/components/parameters/PersonalAccessTokenID" + responses: + "204": + description: No Content + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Revoke an access token for a service account + tags: + - Service Accounts + "x-permission": + operator: OR + permissions: + - service_account_write + get: + description: Get a specific access token for a service account by its UUID. + operationId: GetServiceAccountAccessToken + parameters: + - $ref: "#/components/parameters/ServiceAccountID" + - $ref: "#/components/parameters/PersonalAccessTokenID" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PersonalAccessTokenResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an access token for a service account + tags: + - Service Accounts + "x-permission": + operator: OR + permissions: + - service_account_write + patch: + description: Update a specific access token for a service account. + operationId: UpdateServiceAccountAccessToken + parameters: + - $ref: "#/components/parameters/ServiceAccountID" + - $ref: "#/components/parameters/PersonalAccessTokenID" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/PersonalAccessTokenUpdateRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/PersonalAccessTokenResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update an access token for a service account + tags: + - Service Accounts + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - service_account_write /api/v2/service_accounts/{service_account_id}/application_keys: get: description: List all application keys available for this service account. diff --git a/cassettes/features/v2/personal_access_tokens/Create-a-personal-access-token-returns-Created-response.frozen b/cassettes/features/v2/personal_access_tokens/Create-a-personal-access-token-returns-Created-response.frozen new file mode 100644 index 000000000000..0e8d0e96ccd9 --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Create-a-personal-access-token-returns-Created-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:27.916Z \ No newline at end of file diff --git a/cassettes/features/v2/personal_access_tokens/Create-a-personal-access-token-returns-Created-response.yml b/cassettes/features/v2/personal_access_tokens/Create-a-personal-access-token-returns-Created-response.yml new file mode 100644 index 000000000000..8e5179738138 --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Create-a-personal-access-token-returns-Created-response.yml @@ -0,0 +1,40 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:27 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"expires_at":"2027-04-03T21:03:27.916Z","name":"Test-Create_a_personal_access_token_returns_Created_response-1775250207","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/personal_access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4acd86c7-0b9d-4118-9461-485094f0d3d9","type":"personal_access_tokens","attributes":{"alias":"2H9MCNMBM8FQjQ16YucXkX","created_at":"2026-04-03T21:03:28.105263095Z","expires_at":"2027-04-03T21:03:27.916Z","key":"xxxxx_xxxxxxxxxxxxxxxxxxxXxX_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Create_a_personal_access_token_returns_Created_response-1775250207","public_portion":"2H9MCNMBM8FQjQ16YucXkX","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:27 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/personal_access_tokens/4acd86c7-0b9d-4118-9461-485094f0d3d9 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/personal_access_tokens/Create-a-service-account-access-token-returns-Created-response.frozen b/cassettes/features/v2/personal_access_tokens/Create-a-service-account-access-token-returns-Created-response.frozen new file mode 100644 index 000000000000..2f8a6f0b9e96 --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Create-a-service-account-access-token-returns-Created-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:30.155Z \ No newline at end of file diff --git a/cassettes/features/v2/personal_access_tokens/Create-a-service-account-access-token-returns-Created-response.yml b/cassettes/features/v2/personal_access_tokens/Create-a-service-account-access-token-returns-Created-response.yml new file mode 100644 index 000000000000..0ebf0d169378 --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Create-a-service-account-access-token-returns-Created-response.yml @@ -0,0 +1,82 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:30 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Create_a_service_account_access_token_returns_Created_response-1775250210@datadoghq.com","service_account":true,"title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"users","id":"9140f182-2fa0-11f1-aa8f-eea1be72dca6","attributes":{"uuid":"9140f182-2fa0-11f1-aa8f-eea1be72dca6","name":null,"handle":"9140f182-2fa0-11f1-aa8f-eea1be72dca6","created_at":"2026-04-03T21:03:30.342186+00:00","modified_at":"2026-04-03T21:03:30.342186+00:00","email":"test-create_a_service_account_access_token_returns_created_response-1775250210@datadoghq.com","icon":"https://secure.gravatar.com/avatar/809c18f1349366dd8e11d2eddd048cb1?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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:30 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Test-Create_a_service_account_access_token_returns_Created_response-1775250210","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts/9140f182-2fa0-11f1-aa8f-eea1be72dca6/access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"39c3faad-fa0f-4118-a95e-f38250eb5343","type":"personal_access_tokens","attributes":{"alias":"1l07m08lcK2rROp95DXB4t","created_at":"2026-04-03T21:03:30.63247746Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxXxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Create_a_service_account_access_token_returns_Created_response-1775250210","public_portion":"1l07m08lcK2rROp95DXB4t","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"9140f182-2fa0-11f1-aa8f-eea1be72dca6","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:30 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/service_accounts/9140f182-2fa0-11f1-aa8f-eea1be72dca6/access_tokens/39c3faad-fa0f-4118-a95e-f38250eb5343 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 03 Apr 2026 21:03:30 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/9140f182-2fa0-11f1-aa8f-eea1be72dca6 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/personal_access_tokens/Get-a-personal-access-token-returns-OK-response.frozen b/cassettes/features/v2/personal_access_tokens/Get-a-personal-access-token-returns-OK-response.frozen new file mode 100644 index 000000000000..7642b0dbf6a3 --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Get-a-personal-access-token-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:28.808Z \ No newline at end of file diff --git a/cassettes/features/v2/personal_access_tokens/Get-a-personal-access-token-returns-OK-response.yml b/cassettes/features/v2/personal_access_tokens/Get-a-personal-access-token-returns-OK-response.yml new file mode 100644 index 000000000000..5d228ed0ece4 --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Get-a-personal-access-token-returns-OK-response.yml @@ -0,0 +1,58 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:28 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"expires_at":"2027-04-03T21:03:28.808Z","name":"Test-Get_a_personal_access_token_returns_OK_response-1775250208","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/personal_access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c05c3fb9-496b-46cd-a490-5a663485f581","type":"personal_access_tokens","attributes":{"alias":"5qygRojZc6mCZ8pk5VYBfd","created_at":"2026-04-03T21:03:29.01777755Z","expires_at":"2027-04-03T21:03:28.808Z","key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Get_a_personal_access_token_returns_OK_response-1775250208","public_portion":"5qygRojZc6mCZ8pk5VYBfd","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:28 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/personal_access_tokens/c05c3fb9-496b-46cd-a490-5a663485f581 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c05c3fb9-496b-46cd-a490-5a663485f581","type":"personal_access_tokens","attributes":{"alias":"5qygRojZc6mCZ8pk5VYBfd","created_at":"2026-04-03T21:03:29.017777Z","expires_at":"2027-04-03T21:03:28.808Z","last_used_at":null,"name":"Test-Get_a_personal_access_token_returns_OK_response-1775250208","public_portion":"5qygRojZc6mCZ8pk5VYBfd","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 03 Apr 2026 21:03:28 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/personal_access_tokens/c05c3fb9-496b-46cd-a490-5a663485f581 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/personal_access_tokens/Get-all-personal-access-tokens-returns-OK-response.frozen b/cassettes/features/v2/personal_access_tokens/Get-all-personal-access-tokens-returns-OK-response.frozen new file mode 100644 index 000000000000..d73e002368cb --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Get-all-personal-access-tokens-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:28.249Z \ No newline at end of file diff --git a/cassettes/features/v2/personal_access_tokens/Get-all-personal-access-tokens-returns-OK-response.yml b/cassettes/features/v2/personal_access_tokens/Get-all-personal-access-tokens-returns-OK-response.yml new file mode 100644 index 000000000000..684b82733b6d --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Get-all-personal-access-tokens-returns-OK-response.yml @@ -0,0 +1,58 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:28 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"expires_at":"2027-04-03T21:03:28.249Z","name":"Test-Get_all_personal_access_tokens_returns_OK_response-1775250208","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/personal_access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"bc6be4ba-34c0-412e-a5e3-2ace86a34ff9","type":"personal_access_tokens","attributes":{"alias":"5jXrclwFWbjCs2UcUHRngH","created_at":"2026-04-03T21:03:28.434136399Z","expires_at":"2027-04-03T21:03:28.249Z","key":"xxxxx_xxXxxxxxxxxxxxxxxxxxxx_xxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Get_all_personal_access_tokens_returns_OK_response-1775250208","public_portion":"5jXrclwFWbjCs2UcUHRngH","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:28 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/personal_access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"7ac0ee9a-f707-450f-b588-a52f9e9f208a","type":"personal_access_tokens","attributes":{"alias":"3jdEVpOJCWBbZT8Xc1CBLO","created_at":"2026-04-03T12:19:47.125448Z","expires_at":"2026-04-04T12:19:47Z","last_used_at":"2026-04-03T13:45:02.412946626Z","name":"dd_auth_cli-LoY3-YJ8TUCCuxSHfQFr1lluuwJv6ANADcjnPKyaN4o","public_portion":"3jdEVpOJCWBbZT8Xc1CBLO","scopes":["admin","standard","logs_read_index_data","logs_modify_indexes","logs_live_tail","logs_write_exclusion_filters","logs_write_pipelines","logs_write_processors","logs_write_archives","logs_generate_metrics","dashboards_read","dashboards_write","dashboards_public_share","monitors_read","monitors_write","monitors_downtime","logs_read_data","logs_read_archives","security_monitoring_rules_read","security_monitoring_rules_write","security_monitoring_signals_read","security_monitoring_signals_write","user_access_invite","user_access_manage","user_app_keys","org_app_keys_read","org_app_keys_write","synthetics_private_location_read","synthetics_private_location_write","billing_read","billing_edit","usage_read","usage_edit","metric_tags_write","logs_write_historical_view","audit_logs_read","api_keys_read","api_keys_write","synthetics_global_variable_read","synthetics_global_variable_write","synthetics_read","synthetics_write","synthetics_default_settings_read","synthetics_default_settings_write","logs_write_facets","service_account_write","integrations_api","apm_read","apm_retention_filter_read","apm_retention_filter_write","apm_service_ingest_read","apm_service_ingest_write","apm_apdex_manage_write","apm_tag_management_write","apm_primary_operation_write","audit_logs_write","rum_apps_write","debugger_write","debugger_read","data_scanner_read","data_scanner_write","org_management","security_monitoring_filters_read","security_monitoring_filters_write","incident_read","incident_write","incident_settings_read","incident_settings_write","metrics_read","timeseries_query","events_read","appsec_event_rule_read","appsec_event_rule_write","rum_apps_read","rum_session_replay_read","security_monitoring_notification_profiles_read","security_monitoring_notification_profiles_write","apm_generate_metrics","security_monitoring_cws_agent_rules_read","security_monitoring_cws_agent_rules_write","apm_pipelines_write","apm_pipelines_read","observability_pipelines_read","observability_pipelines_write","workflows_read","workflows_write","workflows_run","connections_read","connections_write","notebooks_read","notebooks_write","logs_delete_data","rum_generate_metrics","aws_configurations_manage","azure_configurations_manage","gcp_configurations_manage","manage_integrations","usage_notifications_read","usage_notifications_write","generate_dashboard_reports","slos_read","slos_write","slos_corrections","monitor_config_policy_write","apm_service_catalog_write","apm_service_catalog_read","logs_write_forwarding_rules","watchdog_insights_read","connections_resolve","user_access_read","appsec_protect_read","appsec_protect_write","appsec_activation_read","appsec_activation_write","apps_run","apps_write","cases_read","cases_write","apm_remote_configuration_write","apm_remote_configuration_read","ci_visibility_read","ci_visibility_write","ci_provider_settings_write","ci_visibility_settings_write","continuous_profiler_read","teams_read","teams_manage","security_monitoring_findings_read","incident_notification_settings_read","incident_notification_settings_write","ci_ingestion_control_write","error_tracking_write","watchdog_alerts_write","saved_views_write","client_tokens_read","client_tokens_write","event_correlation_config_read","event_correlation_config_write","event_config_write","security_monitoring_findings_write","cloud_cost_management_read","cloud_cost_management_write","host_tags_write","ci_visibility_pipelines_write","quality_gate_rules_read","quality_gate_rules_write","metrics_metadata_write","rum_delete_data","appsec_vm_write","reference_tables_write","rum_playlist_write","observability_pipelines_delete","observability_pipelines_deploy","processes_generate_metrics","api_keys_delete","agent_flare_collection","org_connections_write","org_connections_read","facets_write","security_monitoring_suppressions_read","security_monitoring_suppressions_write","static_analysis_settings_write","create_webhooks","cd_visibility_read","ndm_netflow_port_mappings_write","appsec_vm_read","debugger_capture_variables","error_tracking_settings_write","error_tracking_exclusion_filters_write","integrations_read","apm_api_catalog_write","apm_api_catalog_read","containers_generate_image_metrics","rum_extend_retention","on_prem_runner_read","on_prem_runner_use","on_prem_runner_write","dora_settings_write","agent_upgrade_write","continuous_profiler_pgo_read","oci_configurations_manage","aws_configuration_read","azure_configuration_read","gcp_configuration_read","oci_configuration_read","hosts_read","aws_configuration_edit","azure_configuration_edit","gcp_configuration_edit","oci_configuration_edit","llm_observability_read","flex_logs_config_write","reference_tables_read","fleet_policies_write","orchestration_custom_resource_definitions_write","code_analysis_read","orchestration_workload_scaling_write","llm_observability_write","observability_pipelines_capture_read","observability_pipelines_capture_write","apps_datastore_read","apps_datastore_write","apps_datastore_manage","security_pipelines_read","security_pipelines_write","connection_groups_write","quality_gates_evaluations_read","connection_groups_read","security_monitoring_cws_agent_rules_actions","rum_retention_filters_read","rum_retention_filters_write","ddsql_editor_read","disaster_recovery_status_read","disaster_recovery_status_write","rum_settings_write","test_optimization_read","test_optimization_write","test_optimization_settings_write","security_comments_write","security_comments_read","dashboards_invite_share","dashboards_embed_share","embeddable_graphs_share","logs_read_workspaces","logs_write_workspaces","audience_management_read","audience_management_write","logs_read_config","on_call_read","on_call_write","on_call_page","dora_metrics_read","error_tracking_read","on_call_respond","process_tags_read","process_tags_write","network_connections_read","serverless_aws_instrumentation_read","serverless_aws_instrumentation_write","coterm_write","coterm_read","data_streams_monitoring_capture_messages","cloudcraft_read","ndm_device_profiles_view","ndm_device_profiles_edit","generate_log_reports","manage_log_reports","ndm_devices_read","ndm_device_tags_write","bits_investigations_read","sheets_read","sheets_write","status_pages_settings_read","status_pages_settings_write","status_pages_incident_write","on_call_admin","orchestration_autoscaling_manage","code_coverage_read","cases_shared_settings_write","repo_info_read","repo_settings_write","product_analytics_apps_write","actions_interface_run","ai_guard_evaluate","generate_ccm_report_schedules","manage_ccm_report_schedules","user_self_profile_read","governance_console_read","data_scanner_unmask","apps_form_read","apps_form_manage","user_self_profile_write","dora_metrics_write","bits_investigations_write","debugger_write_pre_prod","network_health_insights_read","security_monitoring_datasets_read","security_monitoring_datasets_write","feature_flag_config_write","feature_flag_config_read","feature_flag_environment_config_write","feature_flag_environment_config_read","assistant_access","dbm_read","ndm_geomap_locations_write","ndm_device_config_read","dbm_parameterized_queries_read","apm_service_renaming_write","deployment_gates_read","deployment_gates_write","deployment_gates_evaluate","product_analytics_saved_widgets_read","product_analytics_saved_widgets_write","mcp_write","mcp_read","external_provider_status_notifications_read","external_provider_status_notifications_write","governance_console_write","bits_security_analyst_write","bits_security_analyst_config_write","feature_flag_approvals_override","infrastructure_resource_policies_read","infrastructure_resource_policies_write","agent_builder_read","agent_builder_write","agent_builder_run","product_analytics_settings_read","product_analytics_settings_write","product_analytics_experiments_read","product_analytics_experiments_write","product_analytics_metrics_read","product_analytics_metrics_write","product_analytics_certified_metrics_write","product_analytics_warehouse_model_write","data_streams_kafka_produce_message","org_group_read","org_group_write","apm_recommendations_notification_rules_read","apm_recommendations_notification_rules_write","status_pages_public_page_publish","status_pages_internal_page_publish","product_dashboards_write"]},"relationships":{"owned_by":{"data":{"id":"48e5159f-e308-11ef-bcfc-2666505bfd8f","type":"users"}}}},{"id":"717da798-83bd-4f68-8b0a-dfa98c65bddb","type":"personal_access_tokens","attributes":{"alias":"3S9YYEuPThXA4AbPGMcqjr","created_at":"2026-04-02T20:01:42.043142Z","expires_at":null,"last_used_at":null,"name":"Test-Create_a_service_account_access_token_returns_Created_response-1775160101","public_portion":"3S9YYEuPThXA4AbPGMcqjr","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"c465e3ca-2ece-11f1-b6f0-363c69093c72","type":"users"}}}},{"id":"bc6be4ba-34c0-412e-a5e3-2ace86a34ff9","type":"personal_access_tokens","attributes":{"alias":"5jXrclwFWbjCs2UcUHRngH","created_at":"2026-04-03T21:03:28.434136Z","expires_at":"2027-04-03T21:03:28.249Z","last_used_at":null,"name":"Test-Get_all_personal_access_tokens_returns_OK_response-1775250208","public_portion":"5jXrclwFWbjCs2UcUHRngH","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}],"meta":{"page":{"total_filtered_count":3}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 03 Apr 2026 21:03:28 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/personal_access_tokens/bc6be4ba-34c0-412e-a5e3-2ace86a34ff9 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/personal_access_tokens/Revoke-a-personal-access-token-returns-No-Content-response.frozen b/cassettes/features/v2/personal_access_tokens/Revoke-a-personal-access-token-returns-No-Content-response.frozen new file mode 100644 index 000000000000..c6d7ebb2cc0c --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Revoke-a-personal-access-token-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:29.642Z \ No newline at end of file diff --git a/cassettes/features/v2/personal_access_tokens/Revoke-a-personal-access-token-returns-No-Content-response.yml b/cassettes/features/v2/personal_access_tokens/Revoke-a-personal-access-token-returns-No-Content-response.yml new file mode 100644 index 000000000000..1813009c15bd --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Revoke-a-personal-access-token-returns-No-Content-response.yml @@ -0,0 +1,56 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:29 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"expires_at":"2027-04-03T21:03:29.642Z","name":"Test-Revoke_a_personal_access_token_returns_No_Content_response-1775250209","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/personal_access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"58aa40d5-3478-40c9-b7c6-b312a98aa205","type":"personal_access_tokens","attributes":{"alias":"2hJ86WNzxxAq0kue3PHK8T","created_at":"2026-04-03T21:03:29.846574885Z","expires_at":"2027-04-03T21:03:29.642Z","key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxXxxxxxx","name":"Test-Revoke_a_personal_access_token_returns_No_Content_response-1775250209","public_portion":"2hJ86WNzxxAq0kue3PHK8T","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:29 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/personal_access_tokens/58aa40d5-3478-40c9-b7c6-b312a98aa205 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 03 Apr 2026 21:03:29 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/personal_access_tokens/58aa40d5-3478-40c9-b7c6-b312a98aa205 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/personal_access_tokens/Update-a-personal-access-token-returns-OK-response.frozen b/cassettes/features/v2/personal_access_tokens/Update-a-personal-access-token-returns-OK-response.frozen new file mode 100644 index 000000000000..ab789a2aa508 --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Update-a-personal-access-token-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:29.264Z \ No newline at end of file diff --git a/cassettes/features/v2/personal_access_tokens/Update-a-personal-access-token-returns-OK-response.yml b/cassettes/features/v2/personal_access_tokens/Update-a-personal-access-token-returns-OK-response.yml new file mode 100644 index 000000000000..9d47abcf76d5 --- /dev/null +++ b/cassettes/features/v2/personal_access_tokens/Update-a-personal-access-token-returns-OK-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:29 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"expires_at":"2027-04-03T21:03:29.264Z","name":"Test-Update_a_personal_access_token_returns_OK_response-1775250209","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/personal_access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"62ef326f-92d6-424b-a000-d7212e2568fd","type":"personal_access_tokens","attributes":{"alias":"30gYny15czuas9ipvuFUOD","created_at":"2026-04-03T21:03:29.373074209Z","expires_at":"2027-04-03T21:03:29.264Z","key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxXxxxxxxxxxxxxxxxxxxxXxxxxxxxxx","name":"Test-Update_a_personal_access_token_returns_OK_response-1775250209","public_portion":"30gYny15czuas9ipvuFUOD","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:29 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Test-Update_a_personal_access_token_returns_OK_response-1775250209-updated"},"id":"62ef326f-92d6-424b-a000-d7212e2568fd","type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/personal_access_tokens/62ef326f-92d6-424b-a000-d7212e2568fd + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"62ef326f-92d6-424b-a000-d7212e2568fd","type":"personal_access_tokens","attributes":{"alias":"30gYny15czuas9ipvuFUOD","created_at":"2026-04-03T21:03:29.373074Z","expires_at":"2027-04-03T21:03:29.264Z","last_used_at":null,"modified_at":"2026-04-03T21:03:29.522659Z","name":"Test-Update_a_personal_access_token_returns_OK_response-1775250209-updated","public_portion":"30gYny15czuas9ipvuFUOD","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 03 Apr 2026 21:03:29 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/personal_access_tokens/62ef326f-92d6-424b-a000-d7212e2568fd + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_accounts/Create-a-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/Create-a-service-account-returns-OK-response.frozen index 7536a9c5b3e7..f23457e15367 100644 --- a/cassettes/features/v2/service_accounts/Create-a-service-account-returns-OK-response.frozen +++ b/cassettes/features/v2/service_accounts/Create-a-service-account-returns-OK-response.frozen @@ -1 +1 @@ -2023-01-30T14:58:54.329Z \ No newline at end of file +2026-04-03T21:02:55.411Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Create-a-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/Create-a-service-account-returns-OK-response.yml index babf1b8649cd..0cf897e3d06b 100644 --- a/cassettes/features/v2/service_accounts/Create-a-service-account-returns-OK-response.yml +++ b/cassettes/features/v2/service_accounts/Create-a-service-account-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Mon, 30 Jan 2023 14:58:54 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:55 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Create_a_service_account_returns_OK_response-1675090734"},"type":"roles"}}' + string: '{"data":{"attributes":{"name":"Test-Create_a_service_account_returns_OK_response-1775250175"},"type":"roles"}}' headers: Accept: - application/json @@ -14,21 +14,19 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"roles","id":"9d7c873e-a0ae-11ed-975e-da7ad0900002","attributes":{"name":"Test-Create_a_service_account_returns_OK_response-1675090734","created_at":"2023-01-30T14:58:54.528421+00:00","modified_at":"2023-01-30T14:58:54.566829+00:00"},"relationships":{"permissions":{"data":[{"type":"permissions","id":"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2"},{"type":"permissions","id":"4441648c-d8b1-11e9-a77a-1b899a04b304"},{"type":"permissions","id":"417ba636-2dce-11eb-84c0-6bce5b0d9de0"},{"type":"permissions","id":"12efc20e-d36c-11eb-a9b8-da7ad0900002"},{"type":"permissions","id":"7605ef24-f376-11eb-b90b-da7ad0900002"},{"type":"permissions","id":"b6bf9ac6-9a59-11ec-8480-da7ad0900002"},{"type":"permissions","id":"f8e941cf-e746-11ec-b22d-da7ad0900002"},{"type":"permissions","id":"6c5ad874-7aff-11ed-a5cd-da7ad0900002"}]}}}} - - ' + string: '{"data":{"id":"7c8dd40e-2fa0-11f1-b1d4-da7ad0900002","type":"roles","attributes":{"created_at":"2026-04-03T21:02:55.623363Z","modified_at":"2026-04-03T21:02:55.613643Z","name":"Test-Create_a_service_account_returns_OK_response-1775250175","team_count":0,"user_count":0},"relationships":{"permissions":{"data":[{"id":"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2","type":"permissions"},{"id":"4441648c-d8b1-11e9-a77a-1b899a04b304","type":"permissions"},{"id":"417ba636-2dce-11eb-84c0-6bce5b0d9de0","type":"permissions"},{"id":"12efc20e-d36c-11eb-a9b8-da7ad0900002","type":"permissions"},{"id":"7605ef24-f376-11eb-b90b-da7ad0900002","type":"permissions"},{"id":"b6bf9ac6-9a59-11ec-8480-da7ad0900002","type":"permissions"},{"id":"f8e941cf-e746-11ec-b22d-da7ad0900002","type":"permissions"},{"id":"6c5ad874-7aff-11ed-a5cd-da7ad0900002","type":"permissions"},{"id":"a8b4d6e8-4ea4-11ee-b482-da7ad0900002","type":"permissions"},{"id":"50c270de-69ee-11ee-9151-da7ad0900002","type":"permissions"}]}}}}' headers: Content-Type: - - application/json + - application/vnd.api+json status: code: 200 message: OK -- recorded_at: Mon, 30 Jan 2023 14:58:54 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:55 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Create_a_service_account_returns_OK_response-1675090734@datadoghq.com","name":"Test - API Client","service_account":true},"relationships":{"roles":{"data":[{"id":"9d7c873e-a0ae-11ed-975e-da7ad0900002","type":"roles"}]}},"type":"users"}}' + string: '{"data":{"attributes":{"email":"Test-Create_a_service_account_returns_OK_response-1775250175@datadoghq.com","name":"Test + API Client","service_account":true},"relationships":{"roles":{"data":[{"id":"7c8dd40e-2fa0-11f1-b1d4-da7ad0900002","type":"roles"}]}},"type":"users"}}' headers: Accept: - application/json @@ -39,11 +37,11 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"9d9c0565-a0ae-11ed-88af-be56a8628f3f","attributes":{"name":"Test - API Client","handle":"9d9c0565-a0ae-11ed-88af-be56a8628f3f","created_at":"2023-01-30T14:58:54.736093+00:00","modified_at":"2023-01-30T14:58:54.738680+00:00","email":"test-create_a_service_account_returns_ok_response-1675090734@datadoghq.com","icon":"https://secure.gravatar.com/avatar/5bf68b66c63c55ddb80602fc2d183c28?s=48&d=retro","title":null,"verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[{"type":"roles","id":"9d7c873e-a0ae-11ed-975e-da7ad0900002"}]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}},"included":[{"type":"roles","id":"9d7c873e-a0ae-11ed-975e-da7ad0900002","attributes":{"name":"Test-Create_a_service_account_returns_OK_response-1675090734","created_at":"2023-01-30T14:58:54.528421+00:00","modified_at":"2023-01-30T14:58:54.566829+00:00"},"relationships":{"permissions":{"data":[{"type":"permissions","id":"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2"},{"type":"permissions","id":"4441648c-d8b1-11e9-a77a-1b899a04b304"},{"type":"permissions","id":"417ba636-2dce-11eb-84c0-6bce5b0d9de0"},{"type":"permissions","id":"12efc20e-d36c-11eb-a9b8-da7ad0900002"},{"type":"permissions","id":"7605ef24-f376-11eb-b90b-da7ad0900002"},{"type":"permissions","id":"b6bf9ac6-9a59-11ec-8480-da7ad0900002"},{"type":"permissions","id":"f8e941cf-e746-11ec-b22d-da7ad0900002"},{"type":"permissions","id":"6c5ad874-7aff-11ed-a5cd-da7ad0900002"}]}}},{"type":"permissions","id":"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2","attributes":{"name":"dashboards_read","display_name":"Dashboards + string: '{"data":{"type":"users","id":"7cefc5f1-2fa0-11f1-991f-62f4bfc595d0","attributes":{"uuid":"7cefc5f1-2fa0-11f1-991f-62f4bfc595d0","name":"Test + API Client","handle":"7cefc5f1-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:02:56.255800+00:00","modified_at":"2026-04-03T21:02:56.255800+00:00","email":"test-create_a_service_account_returns_ok_response-1775250175@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7ee42950f6c7a4eaae0f7a4b3bfd4fc5?s=48&d=retro","title":null,"verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active","last_login_time":null},"relationships":{"roles":{"data":[{"type":"roles","id":"7c8dd40e-2fa0-11f1-b1d4-da7ad0900002"}]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}},"included":[{"type":"roles","id":"7c8dd40e-2fa0-11f1-b1d4-da7ad0900002","attributes":{"name":"Test-Create_a_service_account_returns_OK_response-1775250175","managed":false,"created_at":"2026-04-03T21:02:55.623363+00:00","modified_at":"2026-04-03T21:02:55.613643+00:00"},"relationships":{"permissions":{"data":[{"type":"permissions","id":"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2"},{"type":"permissions","id":"4441648c-d8b1-11e9-a77a-1b899a04b304"},{"type":"permissions","id":"417ba636-2dce-11eb-84c0-6bce5b0d9de0"},{"type":"permissions","id":"12efc20e-d36c-11eb-a9b8-da7ad0900002"},{"type":"permissions","id":"7605ef24-f376-11eb-b90b-da7ad0900002"},{"type":"permissions","id":"b6bf9ac6-9a59-11ec-8480-da7ad0900002"},{"type":"permissions","id":"f8e941cf-e746-11ec-b22d-da7ad0900002"},{"type":"permissions","id":"6c5ad874-7aff-11ed-a5cd-da7ad0900002"},{"type":"permissions","id":"a8b4d6e8-4ea4-11ee-b482-da7ad0900002"},{"type":"permissions","id":"50c270de-69ee-11ee-9151-da7ad0900002"}]}}},{"type":"permissions","id":"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2","attributes":{"name":"dashboards_read","display_name":"Dashboards Read","description":"View dashboards.","created":"2019-09-10T14:39:51.955175+00:00","group_name":"Dashboards","display_type":"read","restricted":true}},{"type":"permissions","id":"4441648c-d8b1-11e9-a77a-1b899a04b304","attributes":{"name":"monitors_read","display_name":"Monitors Read","description":"View monitors.","created":"2019-09-16T18:39:07.744297+00:00","group_name":"Monitors","display_type":"read","restricted":true}},{"type":"permissions","id":"417ba636-2dce-11eb-84c0-6bce5b0d9de0","attributes":{"name":"apm_read","display_name":"APM - Read","description":"Read and query APM and Trace Analytics.","created":"2020-11-23T20:55:45.006110+00:00","group_name":"APM","display_type":"read","restricted":true}},{"type":"permissions","id":"12efc20e-d36c-11eb-a9b8-da7ad0900002","attributes":{"name":"incident_read","display_name":"Incident + Read","description":"Read and query APM and Trace Analytics.","created":"2020-11-23T20:55:45.006110+00:00","group_name":"APM","display_type":"read","restricted":true}},{"type":"permissions","id":"12efc20e-d36c-11eb-a9b8-da7ad0900002","attributes":{"name":"incident_read","display_name":"Incidents Read","description":"View incidents in Datadog.","created":"2021-06-22T15:11:09.255499+00:00","group_name":"Case and Incident Management","display_type":"read","restricted":true}},{"type":"permissions","id":"7605ef24-f376-11eb-b90b-da7ad0900002","attributes":{"name":"rum_apps_read","display_name":"RUM Apps Read","description":"View RUM Applications data.","created":"2021-08-02T09:46:07.671535+00:00","group_name":"Real @@ -51,8 +49,14 @@ http_interactions: Read","description":"View notebooks.","created":"2022-03-02T18:51:05.040950+00:00","group_name":"Notebooks","display_type":"read","restricted":true}},{"type":"permissions","id":"f8e941cf-e746-11ec-b22d-da7ad0900002","attributes":{"name":"slos_read","display_name":"SLOs Read","description":"View SLOs and status corrections.","created":"2022-06-08T16:20:55.142591+00:00","group_name":"Service Level Objectives","display_type":"read","restricted":true}},{"type":"permissions","id":"6c5ad874-7aff-11ed-a5cd-da7ad0900002","attributes":{"name":"ci_visibility_read","display_name":"CI - Visibility Read","description":"View CI Visibility.","created":"2022-12-13T16:01:37.149406+00:00","group_name":"CI - Visibility","display_type":"read","restricted":true}}]} + Visibility Read","description":"View CI Visibility.","created":"2022-12-13T16:01:37.149406+00:00","group_name":"Software + Delivery","display_type":"read","restricted":true}},{"type":"permissions","id":"a8b4d6e8-4ea4-11ee-b482-da7ad0900002","attributes":{"name":"cd_visibility_read","display_name":"CD + Visibility Read","description":"View CD Visibility.","created":"2023-09-09T00:06:00.708335+00:00","group_name":"Software + Delivery","display_type":"read","restricted":true}},{"type":"permissions","id":"50c270de-69ee-11ee-9151-da7ad0900002","attributes":{"name":"appsec_vm_read","display_name":"Vulnerability + Management Read","description":"View infrastructure, application code and + library vulnerabilities. This does not restrict access to the vulnerability + data source through the API or inventory SQL.","created":"2023-10-13T17:31:17.311029+00:00","group_name":"Cloud + Security Platform","display_type":"read","restricted":true}}]} ' headers: @@ -61,14 +65,14 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Mon, 30 Jan 2023 14:58:54 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:55 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/9d9c0565-a0ae-11ed-88af-be56a8628f3f + uri: https://api.datadoghq.com/api/v2/users/7cefc5f1-2fa0-11f1-991f-62f4bfc595d0 response: body: encoding: UTF-8 @@ -77,21 +81,19 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Mon, 30 Jan 2023 14:58:54 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:55 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/roles/9d7c873e-a0ae-11ed-975e-da7ad0900002 + uri: https://api.datadoghq.com/api/v2/roles/7c8dd40e-2fa0-11f1-b1d4-da7ad0900002 response: body: encoding: UTF-8 string: '' - headers: - Content-Type: - - text/html; charset=utf-8 + headers: {} status: code: 204 message: No Content diff --git a/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen new file mode 100644 index 000000000000..b457d0ec92cf --- /dev/null +++ b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:02:56.793Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml new file mode 100644 index 000000000000..13371f7137f7 --- /dev/null +++ b/cassettes/features/v2/service_accounts/Create-an-access-token-for-a-service-account-returns-Created-response.yml @@ -0,0 +1,82 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:02:56 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176@datadoghq.com","service_account":true,"title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"users","id":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","attributes":{"uuid":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","name":null,"handle":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:02:56.980609+00:00","modified_at":"2026-04-03T21:02:56.980609+00:00","email":"test-create_an_access_token_for_a_service_account_returns_created_response-1775250176@datadoghq.com","icon":"https://secure.gravatar.com/avatar/1a703b50769c96d7b84a5470f474ef74?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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:02:56 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0/access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"6f2491f5-8c3f-45a3-962a-5f769b95e806","type":"personal_access_tokens","attributes":{"alias":"3NirNJ5Y2qB4Fmac8B4wnm","created_at":"2026-04-03T21:02:57.288351972Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxXxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Create_an_access_token_for_a_service_account_returns_Created_response-1775250176","public_portion":"3NirNJ5Y2qB4Fmac8B4wnm","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:02:56 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/service_accounts/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0/access_tokens/6f2491f5-8c3f-45a3-962a-5f769b95e806 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 03 Apr 2026 21:02:56 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/7d5e5ea9-2fa0-11f1-991f-62f4bfc595d0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_accounts/Create-an-application-key-for-this-service-account-returns-Created-response.frozen b/cassettes/features/v2/service_accounts/Create-an-application-key-for-this-service-account-returns-Created-response.frozen index ea2a5c5179d2..4240edad9a3f 100644 --- a/cassettes/features/v2/service_accounts/Create-an-application-key-for-this-service-account-returns-Created-response.frozen +++ b/cassettes/features/v2/service_accounts/Create-an-application-key-for-this-service-account-returns-Created-response.frozen @@ -1 +1 @@ -2023-10-12T10:11:47.418Z \ No newline at end of file +2026-04-03T21:02:58.272Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Create-an-application-key-for-this-service-account-returns-Created-response.yml b/cassettes/features/v2/service_accounts/Create-an-application-key-for-this-service-account-returns-Created-response.yml index 97cdb7de3798..396168f00e53 100644 --- a/cassettes/features/v2/service_accounts/Create-an-application-key-for-this-service-account-returns-Created-response.yml +++ b/cassettes/features/v2/service_accounts/Create-an-application-key-for-this-service-account-returns-Created-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 12 Oct 2023 10:11:47 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:58 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Create_an_application_key_for_this_service_account_returns_Created_response-1697105507@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-Create_an_application_key_for_this_service_account_returns_Created_response-1775250178@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"c0ea5a28-68e7-11ee-af78-7221d1e45f66","attributes":{"name":null,"handle":"c0ea5a28-68e7-11ee-af78-7221d1e45f66","created_at":"2023-10-12T10:11:47.838233+00:00","modified_at":"2023-10-12T10:11:47.838233+00:00","email":"test-create_an_application_key_for_this_service_account_returns_created_response-1697105507@datadoghq.com","icon":"https://secure.gravatar.com/avatar/45057f7ed4c5662bd175fd2657bf58f2?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + string: '{"data":{"type":"users","id":"7e44d257-2fa0-11f1-96b6-7a9b8860a1d7","attributes":{"uuid":"7e44d257-2fa0-11f1-96b6-7a9b8860a1d7","name":null,"handle":"7e44d257-2fa0-11f1-96b6-7a9b8860a1d7","created_at":"2026-04-03T21:02:58.490890+00:00","modified_at":"2026-04-03T21:02:58.490890+00:00","email":"test-create_an_application_key_for_this_service_account_returns_created_response-1775250178@datadoghq.com","icon":"https://secure.gravatar.com/avatar/f39de85ea89e472ea78a6e034df61719?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"}}}}} ' headers: @@ -25,36 +25,36 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 12 Oct 2023 10:11:47 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:58 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Create_an_application_key_for_this_service_account_returns_Created_response-1697105507"},"type":"application_keys"}}' + string: '{"data":{"attributes":{"name":"Test-Create_an_application_key_for_this_service_account_returns_Created_response-1775250178"},"type":"application_keys"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/c0ea5a28-68e7-11ee-af78-7221d1e45f66/application_keys + uri: https://api.datadoghq.com/api/v2/service_accounts/7e44d257-2fa0-11f1-96b6-7a9b8860a1d7/application_keys response: body: encoding: UTF-8 - string: '{"data":{"type":"application_keys","id":"6315ab43-ce92-4130-b6d2-94ceb5f7142a","attributes":{"name":"Test-Create_an_application_key_for_this_service_account_returns_Created_response-1697105507","created_at":"2023-10-12T10:11:48.340554+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"c0ea5a28-68e7-11ee-af78-7221d1e45f66"}},"leak_information":{"data":null}}}}' + string: '{"data":{"type":"application_keys","id":"da50bc1d-fc06-459f-9d89-5de3211fe853","attributes":{"name":"Test-Create_an_application_key_for_this_service_account_returns_Created_response-1775250178","created_at":"2026-04-03T21:02:58.799343+00:00","last4":"xxxx","key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"7e44d257-2fa0-11f1-96b6-7a9b8860a1d7"}},"leak_information":{"data":null}}}}' headers: Content-Type: - application/json status: code: 201 message: Created -- recorded_at: Thu, 12 Oct 2023 10:11:47 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:58 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/c0ea5a28-68e7-11ee-af78-7221d1e45f66/application_keys/6315ab43-ce92-4130-b6d2-94ceb5f7142a + uri: https://api.datadoghq.com/api/v2/service_accounts/7e44d257-2fa0-11f1-96b6-7a9b8860a1d7/application_keys/da50bc1d-fc06-459f-9d89-5de3211fe853 response: body: encoding: UTF-8 @@ -65,14 +65,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 12 Oct 2023 10:11:47 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:58 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/c0ea5a28-68e7-11ee-af78-7221d1e45f66 + uri: https://api.datadoghq.com/api/v2/users/7e44d257-2fa0-11f1-96b6-7a9b8860a1d7 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Create-an-application-key-with-scopes-for-this-service-account-returns-Created-response.frozen b/cassettes/features/v2/service_accounts/Create-an-application-key-with-scopes-for-this-service-account-returns-Created-response.frozen index da6baa113b99..035283d8a528 100644 --- a/cassettes/features/v2/service_accounts/Create-an-application-key-with-scopes-for-this-service-account-returns-Created-response.frozen +++ b/cassettes/features/v2/service_accounts/Create-an-application-key-with-scopes-for-this-service-account-returns-Created-response.frozen @@ -1 +1 @@ -2022-05-12T09:53:20.809Z \ No newline at end of file +2026-04-03T21:02:59.524Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Create-an-application-key-with-scopes-for-this-service-account-returns-Created-response.yml b/cassettes/features/v2/service_accounts/Create-an-application-key-with-scopes-for-this-service-account-returns-Created-response.yml index 0262469d65f0..e131b8e48b3e 100644 --- a/cassettes/features/v2/service_accounts/Create-an-application-key-with-scopes-for-this-service-account-returns-Created-response.yml +++ b/cassettes/features/v2/service_accounts/Create-an-application-key-with-scopes-for-this-service-account-returns-Created-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 12 May 2022 09:53:20 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:59 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Create_an_application_key_with_scopes_for_this_service_account_returns_Created_response-1652349200@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-Create_an_application_key_with_scopes_for_this_service_account_returns_Created_response-1775250179@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,60 +15,64 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"fbebe517-c0ed-45a9-b3c9-4377cbe04efd","attributes":{"name":null,"handle":"fbebe517-c0ed-45a9-b3c9-4377cbe04efd","created_at":"2022-05-12T09:53:21.271368+00:00","modified_at":"2022-05-12T09:53:21.302672+00:00","email":"test-create_an_application_key_with_scopes_for_this_service_account_returns_created_response-1652349200@datadoghq.com","icon":"https://secure.gravatar.com/avatar/cdd87aef7fe7eed9427d1e53ac7219c2?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}}' + string: '{"data":{"type":"users","id":"7f012bdc-2fa0-11f1-ba00-fae4928ee5de","attributes":{"uuid":"7f012bdc-2fa0-11f1-ba00-fae4928ee5de","name":null,"handle":"7f012bdc-2fa0-11f1-ba00-fae4928ee5de","created_at":"2026-04-03T21:02:59.725268+00:00","modified_at":"2026-04-03T21:02:59.725268+00:00","email":"test-create_an_application_key_with_scopes_for_this_service_account_returns_created_response-1775250179@datadoghq.com","icon":"https://secure.gravatar.com/avatar/9af71986d5e58afac7d7355d0b0e062e?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"}}}}} + + ' headers: Content-Type: - application/json status: code: 201 message: Created -- recorded_at: Thu, 12 May 2022 09:53:20 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:59 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Create_an_application_key_with_scopes_for_this_service_account_returns_Created_response-1652349200","scopes":["dashboards_read","dashboards_write","dashboards_public_share"]},"type":"application_keys"}}' + string: '{"data":{"attributes":{"name":"Test-Create_an_application_key_with_scopes_for_this_service_account_returns_Created_response-1775250179","scopes":["dashboards_read","dashboards_write","dashboards_public_share"]},"type":"application_keys"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/fbebe517-c0ed-45a9-b3c9-4377cbe04efd/application_keys + uri: https://api.datadoghq.com/api/v2/service_accounts/7f012bdc-2fa0-11f1-ba00-fae4928ee5de/application_keys response: body: encoding: UTF-8 - string: '{"data":{"type":"application_keys","id":"e01199cd-849e-4fb8-ae34-af8b6a8cd129","attributes":{"name":"Test-Create_an_application_key_with_scopes_for_this_service_account_returns_Created_response-1652349200","created_at":"2022-05-12T09:53:22.022194+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":["dashboards_read","dashboards_write","dashboards_public_share"]},"relationships":{"owned_by":{"data":{"type":"users","id":"fbebe517-c0ed-45a9-b3c9-4377cbe04efd"}},"leak_information":{"data":null}}}}' + string: '{"data":{"type":"application_keys","id":"f0e43051-3cef-45ea-a3db-b8f82928f199","attributes":{"name":"Test-Create_an_application_key_with_scopes_for_this_service_account_returns_Created_response-1775250179","created_at":"2026-04-03T21:03:00.038479+00:00","last4":"xxxx","key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":["dashboards_read","dashboards_write","dashboards_public_share"]},"relationships":{"owned_by":{"data":{"type":"users","id":"7f012bdc-2fa0-11f1-ba00-fae4928ee5de"}},"leak_information":{"data":null}}}}' headers: Content-Type: - application/json status: code: 201 message: Created -- recorded_at: Thu, 12 May 2022 09:53:20 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:59 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/fbebe517-c0ed-45a9-b3c9-4377cbe04efd/application_keys/e01199cd-849e-4fb8-ae34-af8b6a8cd129 + uri: https://api.datadoghq.com/api/v2/service_accounts/7f012bdc-2fa0-11f1-ba00-fae4928ee5de/application_keys/f0e43051-3cef-45ea-a3db-b8f82928f199 response: body: encoding: UTF-8 string: '' - headers: {} + headers: + Content-Type: + - text/html; charset=utf-8 status: code: 204 message: No Content -- recorded_at: Thu, 12 May 2022 09:53:20 GMT +- recorded_at: Fri, 03 Apr 2026 21:02:59 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/fbebe517-c0ed-45a9-b3c9-4377cbe04efd + uri: https://api.datadoghq.com/api/v2/users/7f012bdc-2fa0-11f1-ba00-fae4928ee5de response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Delete-an-application-key-for-this-service-account-returns-No-Content-response.frozen b/cassettes/features/v2/service_accounts/Delete-an-application-key-for-this-service-account-returns-No-Content-response.frozen index 96b3901455ca..df4416a0cdbf 100644 --- a/cassettes/features/v2/service_accounts/Delete-an-application-key-for-this-service-account-returns-No-Content-response.frozen +++ b/cassettes/features/v2/service_accounts/Delete-an-application-key-for-this-service-account-returns-No-Content-response.frozen @@ -1 +1 @@ -2023-10-12T07:12:21.913Z \ No newline at end of file +2026-04-03T21:03:00.820Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Delete-an-application-key-for-this-service-account-returns-No-Content-response.yml b/cassettes/features/v2/service_accounts/Delete-an-application-key-for-this-service-account-returns-No-Content-response.yml index e169224c961a..375e145f8b6a 100644 --- a/cassettes/features/v2/service_accounts/Delete-an-application-key-for-this-service-account-returns-No-Content-response.yml +++ b/cassettes/features/v2/service_accounts/Delete-an-application-key-for-this-service-account-returns-No-Content-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 12 Oct 2023 07:12:21 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:00 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Delete_an_application_key_for_this_service_account_returns_No_Content_response-1697094741@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-Delete_an_application_key_for_this_service_account_returns_No_Content_response-1775250180@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"b0338c3c-68ce-11ee-9dc7-02a9eb8880d8","attributes":{"name":null,"handle":"b0338c3c-68ce-11ee-9dc7-02a9eb8880d8","created_at":"2023-10-12T07:12:22.378427+00:00","modified_at":"2023-10-12T07:12:22.378427+00:00","email":"test-delete_an_application_key_for_this_service_account_returns_no_content_response-1697094741@datadoghq.com","icon":"https://secure.gravatar.com/avatar/ed84f324d81c653aae4b87a2eb517a97?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + string: '{"data":{"type":"users","id":"7fcbc6f7-2fa0-11f1-ba00-fae4928ee5de","attributes":{"uuid":"7fcbc6f7-2fa0-11f1-ba00-fae4928ee5de","name":null,"handle":"7fcbc6f7-2fa0-11f1-ba00-fae4928ee5de","created_at":"2026-04-03T21:03:01.053065+00:00","modified_at":"2026-04-03T21:03:01.053065+00:00","email":"test-delete_an_application_key_for_this_service_account_returns_no_content_response-1775250180@datadoghq.com","icon":"https://secure.gravatar.com/avatar/4f6531a70f0027009464b13a2620fbad?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"}}}}} ' headers: @@ -25,36 +25,36 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 12 Oct 2023 07:12:21 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:00 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Delete_an_application_key_for_this_service_account_returns_No_Content_response-1697094741"},"type":"application_keys"}}' + string: '{"data":{"attributes":{"name":"Test-Delete_an_application_key_for_this_service_account_returns_No_Content_response-1775250180"},"type":"application_keys"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/b0338c3c-68ce-11ee-9dc7-02a9eb8880d8/application_keys + uri: https://api.datadoghq.com/api/v2/service_accounts/7fcbc6f7-2fa0-11f1-ba00-fae4928ee5de/application_keys response: body: encoding: UTF-8 - string: '{"data":{"type":"application_keys","id":"6a147414-e85c-4b92-829b-fff59f8bd8e0","attributes":{"name":"Test-Delete_an_application_key_for_this_service_account_returns_No_Content_response-1697094741","created_at":"2023-10-12T07:12:22.935154+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"b0338c3c-68ce-11ee-9dc7-02a9eb8880d8"}},"leak_information":{"data":null}}}}' + string: '{"data":{"type":"application_keys","id":"85819bfb-f419-4486-89b4-c48d1c564b76","attributes":{"name":"Test-Delete_an_application_key_for_this_service_account_returns_No_Content_response-1775250180","created_at":"2026-04-03T21:03:01.363576+00:00","last4":"xxxx","key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"7fcbc6f7-2fa0-11f1-ba00-fae4928ee5de"}},"leak_information":{"data":null}}}}' headers: Content-Type: - application/json status: code: 201 message: Created -- recorded_at: Thu, 12 Oct 2023 07:12:21 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:00 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/b0338c3c-68ce-11ee-9dc7-02a9eb8880d8/application_keys/6a147414-e85c-4b92-829b-fff59f8bd8e0 + uri: https://api.datadoghq.com/api/v2/service_accounts/7fcbc6f7-2fa0-11f1-ba00-fae4928ee5de/application_keys/85819bfb-f419-4486-89b4-c48d1c564b76 response: body: encoding: UTF-8 @@ -65,14 +65,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 12 Oct 2023 07:12:21 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:00 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/b0338c3c-68ce-11ee-9dc7-02a9eb8880d8/application_keys/6a147414-e85c-4b92-829b-fff59f8bd8e0 + uri: https://api.datadoghq.com/api/v2/service_accounts/7fcbc6f7-2fa0-11f1-ba00-fae4928ee5de/application_keys/85819bfb-f419-4486-89b4-c48d1c564b76 response: body: encoding: UTF-8 @@ -83,14 +83,14 @@ http_interactions: status: code: 404 message: Not Found -- recorded_at: Thu, 12 Oct 2023 07:12:21 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:00 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/b0338c3c-68ce-11ee-9dc7-02a9eb8880d8 + uri: https://api.datadoghq.com/api/v2/users/7fcbc6f7-2fa0-11f1-ba00-fae4928ee5de response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Edit-an-application-key-for-this-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/Edit-an-application-key-for-this-service-account-returns-OK-response.frozen index ba160164f033..d818df645afc 100644 --- a/cassettes/features/v2/service_accounts/Edit-an-application-key-for-this-service-account-returns-OK-response.frozen +++ b/cassettes/features/v2/service_accounts/Edit-an-application-key-for-this-service-account-returns-OK-response.frozen @@ -1 +1 @@ -2023-10-12T10:10:58.448Z \ No newline at end of file +2026-04-03T21:03:02.137Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Edit-an-application-key-for-this-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/Edit-an-application-key-for-this-service-account-returns-OK-response.yml index d5c62f9d23cd..4cd6d2e47c5d 100644 --- a/cassettes/features/v2/service_accounts/Edit-an-application-key-for-this-service-account-returns-OK-response.yml +++ b/cassettes/features/v2/service_accounts/Edit-an-application-key-for-this-service-account-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 12 Oct 2023 10:10:58 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:02 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1775250182@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"a3b86b00-68e7-11ee-b081-e2f0333fd1ce","attributes":{"name":null,"handle":"a3b86b00-68e7-11ee-b081-e2f0333fd1ce","created_at":"2023-10-12T10:10:58.857066+00:00","modified_at":"2023-10-12T10:10:58.857066+00:00","email":"test-edit_an_application_key_for_this_service_account_returns_ok_response-1697105458@datadoghq.com","icon":"https://secure.gravatar.com/avatar/00878614ca2acb0d68087ee17a33e3f4?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + string: '{"data":{"type":"users","id":"808ffc9c-2fa0-11f1-adcd-e60174513686","attributes":{"uuid":"808ffc9c-2fa0-11f1-adcd-e60174513686","name":null,"handle":"808ffc9c-2fa0-11f1-adcd-e60174513686","created_at":"2026-04-03T21:03:02.338940+00:00","modified_at":"2026-04-03T21:03:02.338940+00:00","email":"test-edit_an_application_key_for_this_service_account_returns_ok_response-1775250182@datadoghq.com","icon":"https://secure.gravatar.com/avatar/1663a4ece4c0ce2efa5db481f912a5db?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"}}}}} ' headers: @@ -25,58 +25,58 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 12 Oct 2023 10:10:58 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:02 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458"},"type":"application_keys"}}' + string: '{"data":{"attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1775250182"},"type":"application_keys"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/a3b86b00-68e7-11ee-b081-e2f0333fd1ce/application_keys + uri: https://api.datadoghq.com/api/v2/service_accounts/808ffc9c-2fa0-11f1-adcd-e60174513686/application_keys response: body: encoding: UTF-8 - string: '{"data":{"type":"application_keys","id":"8dca4456-bd90-4cb4-a182-5868501d8a9b","attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458","created_at":"2023-10-12T10:10:59.392476+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"a3b86b00-68e7-11ee-b081-e2f0333fd1ce"}},"leak_information":{"data":null}}}}' + string: '{"data":{"type":"application_keys","id":"a624627a-ebfc-4af4-8101-5ca4619fdbad","attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1775250182","created_at":"2026-04-03T21:03:02.629516+00:00","last4":"xxxx","key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"808ffc9c-2fa0-11f1-adcd-e60174513686"}},"leak_information":{"data":null}}}}' headers: Content-Type: - application/json status: code: 201 message: Created -- recorded_at: Thu, 12 Oct 2023 10:10:58 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:02 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458-updated"},"id":"8dca4456-bd90-4cb4-a182-5868501d8a9b","type":"application_keys"}}' + string: '{"data":{"attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1775250182-updated"},"id":"a624627a-ebfc-4af4-8101-5ca4619fdbad","type":"application_keys"}}' headers: Accept: - application/json Content-Type: - application/json method: PATCH - uri: https://api.datadoghq.com/api/v2/service_accounts/a3b86b00-68e7-11ee-b081-e2f0333fd1ce/application_keys/8dca4456-bd90-4cb4-a182-5868501d8a9b + uri: https://api.datadoghq.com/api/v2/service_accounts/808ffc9c-2fa0-11f1-adcd-e60174513686/application_keys/a624627a-ebfc-4af4-8101-5ca4619fdbad response: body: encoding: UTF-8 - string: '{"data":{"type":"application_keys","id":"8dca4456-bd90-4cb4-a182-5868501d8a9b","attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1697105458-updated","created_at":"2023-10-12T10:10:59.392477+00:00","last4":"xxxx","scopes":null},"relationships":{"leak_information":{"data":null}}}}' + string: '{"data":{"type":"application_keys","id":"a624627a-ebfc-4af4-8101-5ca4619fdbad","attributes":{"name":"Test-Edit_an_application_key_for_this_service_account_returns_OK_response-1775250182-updated","created_at":"2026-04-03T21:03:02.629516+00:00","last4":"xxxx","scopes":null},"relationships":{"leak_information":{"data":null}}}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 12 Oct 2023 10:10:58 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:02 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/a3b86b00-68e7-11ee-b081-e2f0333fd1ce/application_keys/8dca4456-bd90-4cb4-a182-5868501d8a9b + uri: https://api.datadoghq.com/api/v2/service_accounts/808ffc9c-2fa0-11f1-adcd-e60174513686/application_keys/a624627a-ebfc-4af4-8101-5ca4619fdbad response: body: encoding: UTF-8 @@ -87,14 +87,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 12 Oct 2023 10:10:58 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:02 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/a3b86b00-68e7-11ee-b081-e2f0333fd1ce + uri: https://api.datadoghq.com/api/v2/users/808ffc9c-2fa0-11f1-adcd-e60174513686 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen new file mode 100644 index 000000000000..55c4828532cb --- /dev/null +++ b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:03.500Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml new file mode 100644 index 000000000000..910ba24b8527 --- /dev/null +++ b/cassettes/features/v2/service_accounts/Get-an-access-token-for-a-service-account-returns-OK-response.yml @@ -0,0 +1,100 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183@datadoghq.com","service_account":true,"title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"users","id":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","attributes":{"uuid":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","name":null,"handle":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:03:03.714879+00:00","modified_at":"2026-04-03T21:03:03.714879+00:00","email":"test-get_an_access_token_for_a_service_account_returns_ok_response-1775250183@datadoghq.com","icon":"https://secure.gravatar.com/avatar/bb3c6df0d99066bbe05cf7dff99b5561?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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"f2362958-1e67-414b-985d-d3196afd9315","type":"personal_access_tokens","attributes":{"alias":"7N2tUOwxIjSF8QziOBIpVd","created_at":"2026-04-03T21:03:04.002376467Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183","public_portion":"7N2tUOwxIjSF8QziOBIpVd","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens/f2362958-1e67-414b-985d-d3196afd9315 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"f2362958-1e67-414b-985d-d3196afd9315","type":"personal_access_tokens","attributes":{"alias":"7N2tUOwxIjSF8QziOBIpVd","created_at":"2026-04-03T21:03:04.002376Z","expires_at":null,"last_used_at":null,"name":"Test-Get_an_access_token_for_a_service_account_returns_OK_response-1775250183","public_portion":"7N2tUOwxIjSF8QziOBIpVd","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"8161ef90-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/service_accounts/8161ef90-2fa0-11f1-991f-62f4bfc595d0/access_tokens/f2362958-1e67-414b-985d-d3196afd9315 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 03 Apr 2026 21:03:03 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/8161ef90-2fa0-11f1-991f-62f4bfc595d0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_accounts/Get-one-application-key-for-this-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/Get-one-application-key-for-this-service-account-returns-OK-response.frozen index 8b52406f3747..6177feb9a8ca 100644 --- a/cassettes/features/v2/service_accounts/Get-one-application-key-for-this-service-account-returns-OK-response.frozen +++ b/cassettes/features/v2/service_accounts/Get-one-application-key-for-this-service-account-returns-OK-response.frozen @@ -1 +1 @@ -2023-10-12T07:18:33.140Z \ No newline at end of file +2026-04-03T21:03:04.603Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Get-one-application-key-for-this-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/Get-one-application-key-for-this-service-account-returns-OK-response.yml index 624b0642bed5..3be177be22fa 100644 --- a/cassettes/features/v2/service_accounts/Get-one-application-key-for-this-service-account-returns-OK-response.yml +++ b/cassettes/features/v2/service_accounts/Get-one-application-key-for-this-service-account-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 12 Oct 2023 07:18:33 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:04 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1697095113@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1775250184@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"8d6f1427-68cf-11ee-b38b-b697d9f51e5c","attributes":{"name":null,"handle":"8d6f1427-68cf-11ee-b38b-b697d9f51e5c","created_at":"2023-10-12T07:18:33.545035+00:00","modified_at":"2023-10-12T07:18:33.545035+00:00","email":"test-get_one_application_key_for_this_service_account_returns_ok_response-1697095113@datadoghq.com","icon":"https://secure.gravatar.com/avatar/675597cb6c88dc2642385e567f57b727?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + string: '{"data":{"type":"users","id":"821dac45-2fa0-11f1-be7d-4ae93322f3b6","attributes":{"uuid":"821dac45-2fa0-11f1-be7d-4ae93322f3b6","name":null,"handle":"821dac45-2fa0-11f1-be7d-4ae93322f3b6","created_at":"2026-04-03T21:03:04.945216+00:00","modified_at":"2026-04-03T21:03:04.945216+00:00","email":"test-get_one_application_key_for_this_service_account_returns_ok_response-1775250184@datadoghq.com","icon":"https://secure.gravatar.com/avatar/215ce36092d8e62b4bb9ee4cb9684778?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"}}}}} ' headers: @@ -25,54 +25,54 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 12 Oct 2023 07:18:33 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:04 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"name":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1697095113"},"type":"application_keys"}}' + string: '{"data":{"attributes":{"name":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1775250184"},"type":"application_keys"}}' headers: Accept: - application/json Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/service_accounts/8d6f1427-68cf-11ee-b38b-b697d9f51e5c/application_keys + uri: https://api.datadoghq.com/api/v2/service_accounts/821dac45-2fa0-11f1-be7d-4ae93322f3b6/application_keys response: body: encoding: UTF-8 - string: '{"data":{"type":"application_keys","id":"490b7601-a457-449c-8d8c-72c848e669d5","attributes":{"name":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1697095113","created_at":"2023-10-12T07:18:34.052468+00:00","last4":"xxxx","key":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"8d6f1427-68cf-11ee-b38b-b697d9f51e5c"}},"leak_information":{"data":null}}}}' + string: '{"data":{"type":"application_keys","id":"b5c97dad-de58-4c31-a8a9-2b86917e6cb6","attributes":{"name":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1775250184","created_at":"2026-04-03T21:03:05.262442+00:00","last4":"xxxx","key":"xxxxx_xxxxxxxxxxxxxxxXxxxxxxxxxxxxxxxxxx","scopes":null},"relationships":{"owned_by":{"data":{"type":"users","id":"821dac45-2fa0-11f1-be7d-4ae93322f3b6"}},"leak_information":{"data":null}}}}' headers: Content-Type: - application/json status: code: 201 message: Created -- recorded_at: Thu, 12 Oct 2023 07:18:33 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:04 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/service_accounts/8d6f1427-68cf-11ee-b38b-b697d9f51e5c/application_keys/490b7601-a457-449c-8d8c-72c848e669d5 + uri: https://api.datadoghq.com/api/v2/service_accounts/821dac45-2fa0-11f1-be7d-4ae93322f3b6/application_keys/b5c97dad-de58-4c31-a8a9-2b86917e6cb6 response: body: encoding: UTF-8 - string: '{"data":{"type":"application_keys","id":"490b7601-a457-449c-8d8c-72c848e669d5","attributes":{"name":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1697095113","created_at":"2023-10-12T07:18:34.052468+00:00","last4":"xxxx","scopes":null},"relationships":{"leak_information":{"data":null}}}}' + string: '{"data":{"type":"application_keys","id":"b5c97dad-de58-4c31-a8a9-2b86917e6cb6","attributes":{"name":"Test-Get_one_application_key_for_this_service_account_returns_OK_response-1775250184","created_at":"2026-04-03T21:03:05.262443+00:00","last4":"xxxx","scopes":null,"last_used_at":null},"relationships":{"leak_information":{"data":null}}}}' headers: Content-Type: - application/json status: code: 200 message: OK -- recorded_at: Thu, 12 Oct 2023 07:18:33 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:04 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/service_accounts/8d6f1427-68cf-11ee-b38b-b697d9f51e5c/application_keys/490b7601-a457-449c-8d8c-72c848e669d5 + uri: https://api.datadoghq.com/api/v2/service_accounts/821dac45-2fa0-11f1-be7d-4ae93322f3b6/application_keys/b5c97dad-de58-4c31-a8a9-2b86917e6cb6 response: body: encoding: UTF-8 @@ -83,14 +83,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Thu, 12 Oct 2023 07:18:33 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:04 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/8d6f1427-68cf-11ee-b38b-b697d9f51e5c + uri: https://api.datadoghq.com/api/v2/users/821dac45-2fa0-11f1-be7d-4ae93322f3b6 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.frozen new file mode 100644 index 000000000000..6234af8a3e4b --- /dev/null +++ b/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:09.026Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.yml new file mode 100644 index 000000000000..d916c2ecb6e6 --- /dev/null +++ b/cassettes/features/v2/service_accounts/List-access-tokens-for-a-service-account-returns-OK-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:09 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-List_access_tokens_for_a_service_account_returns_OK_response-1775250189@datadoghq.com","service_account":true,"title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"users","id":"84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7","attributes":{"uuid":"84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7","name":null,"handle":"84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7","created_at":"2026-04-03T21:03:09.205232+00:00","modified_at":"2026-04-03T21:03:09.205232+00:00","email":"test-list_access_tokens_for_a_service_account_returns_ok_response-1775250189@datadoghq.com","icon":"https://secure.gravatar.com/avatar/816e106f74328dd4c20e98c116a9edeb?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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:09 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/service_accounts/84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7/access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":[],"meta":{"page":{"total_filtered_count":0}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 03 Apr 2026 21:03:09 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/84a7b33b-2fa0-11f1-96b6-7a9b8860a1d7 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_accounts/List-application-keys-for-this-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/List-application-keys-for-this-service-account-returns-OK-response.frozen index 7fa2e779bc0b..cb0c6e25b5ee 100644 --- a/cassettes/features/v2/service_accounts/List-application-keys-for-this-service-account-returns-OK-response.frozen +++ b/cassettes/features/v2/service_accounts/List-application-keys-for-this-service-account-returns-OK-response.frozen @@ -1 +1 @@ -2023-10-12T10:12:18.993Z \ No newline at end of file +2026-04-03T21:03:09.754Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/List-application-keys-for-this-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/List-application-keys-for-this-service-account-returns-OK-response.yml index c014b4c99532..f9cc9623c17f 100644 --- a/cassettes/features/v2/service_accounts/List-application-keys-for-this-service-account-returns-OK-response.yml +++ b/cassettes/features/v2/service_accounts/List-application-keys-for-this-service-account-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Thu, 12 Oct 2023 10:12:18 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:09 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"email":"Test-List_application_keys_for_this_service_account_returns_OK_response-1697105538@datadoghq.com","service_account":true,"title":"user + string: '{"data":{"attributes":{"email":"Test-List_application_keys_for_this_service_account_returns_OK_response-1775250189@datadoghq.com","service_account":true,"title":"user title"},"type":"users"}}' headers: Accept: @@ -15,8 +15,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"data":{"type":"users","id":"d3bd8ebd-68e7-11ee-8628-2e5a5b6c83f3","attributes":{"name":null,"handle":"d3bd8ebd-68e7-11ee-8628-2e5a5b6c83f3","created_at":"2023-10-12T10:12:19.421394+00:00","modified_at":"2023-10-12T10:12:19.421394+00:00","email":"test-list_application_keys_for_this_service_account_returns_ok_response-1697105538@datadoghq.com","icon":"https://secure.gravatar.com/avatar/79fd260ec49c01b5dde9172579034626?s=48&d=retro","title":"user - title","verified":true,"service_account":true,"disabled":false,"allowed_login_methods":[],"status":"Active"},"relationships":{"roles":{"data":[]},"org":{"data":{"type":"orgs","id":"4dee724d-00cc-11ea-a77b-570c9d03c6c5"}}}}} + string: '{"data":{"type":"users","id":"85197e38-2fa0-11f1-aa8f-eea1be72dca6","attributes":{"uuid":"85197e38-2fa0-11f1-aa8f-eea1be72dca6","name":null,"handle":"85197e38-2fa0-11f1-aa8f-eea1be72dca6","created_at":"2026-04-03T21:03:09.950991+00:00","modified_at":"2026-04-03T21:03:09.950991+00:00","email":"test-list_application_keys_for_this_service_account_returns_ok_response-1775250189@datadoghq.com","icon":"https://secure.gravatar.com/avatar/10bfb5e1516b0d10604b19a02e2d99f1?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"}}}}} ' headers: @@ -25,14 +25,14 @@ http_interactions: status: code: 201 message: Created -- recorded_at: Thu, 12 Oct 2023 10:12:18 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:09 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/service_accounts/d3bd8ebd-68e7-11ee-8628-2e5a5b6c83f3/application_keys + uri: https://api.datadoghq.com/api/v2/service_accounts/85197e38-2fa0-11f1-aa8f-eea1be72dca6/application_keys response: body: encoding: UTF-8 @@ -43,14 +43,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Thu, 12 Oct 2023 10:12:18 GMT +- recorded_at: Fri, 03 Apr 2026 21:03:09 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/users/d3bd8ebd-68e7-11ee-8628-2e5a5b6c83f3 + uri: https://api.datadoghq.com/api/v2/users/85197e38-2fa0-11f1-aa8f-eea1be72dca6 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen new file mode 100644 index 000000000000..fa38ba91a95f --- /dev/null +++ b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:10.520Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml new file mode 100644 index 000000000000..b7ff9e73fc45 --- /dev/null +++ b/cassettes/features/v2/service_accounts/Revoke-an-access-token-for-a-service-account-returns-No-Content-response.yml @@ -0,0 +1,98 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190@datadoghq.com","service_account":true,"title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"users","id":"860878b5-2fa0-11f1-991f-62f4bfc595d0","attributes":{"uuid":"860878b5-2fa0-11f1-991f-62f4bfc595d0","name":null,"handle":"860878b5-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:03:11.517157+00:00","modified_at":"2026-04-03T21:03:11.517157+00:00","email":"test-revoke_an_access_token_for_a_service_account_returns_no_content_response-1775250190@datadoghq.com","icon":"https://secure.gravatar.com/avatar/7d18813f3cbc71a5e46b1184fc3ad8fb?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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7346d75b-83f3-48ba-9186-899fc80bce16","type":"personal_access_tokens","attributes":{"alias":"3VWUVmuRsjFIKue2Uq9ii6","created_at":"2026-04-03T21:03:11.782016283Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Revoke_an_access_token_for_a_service_account_returns_No_Content_response-1775250190","public_portion":"3VWUVmuRsjFIKue2Uq9ii6","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"860878b5-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens/7346d75b-83f3-48ba-9186-899fc80bce16 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/service_accounts/860878b5-2fa0-11f1-991f-62f4bfc595d0/access_tokens/7346d75b-83f3-48ba-9186-899fc80bce16 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 03 Apr 2026 21:03:10 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/860878b5-2fa0-11f1-991f-62f4bfc595d0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen new file mode 100644 index 000000000000..6a894d59da19 --- /dev/null +++ b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-03T21:03:12.499Z \ No newline at end of file diff --git a/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml new file mode 100644 index 000000000000..84bb6a7f717c --- /dev/null +++ b/cassettes/features/v2/service_accounts/Update-an-access-token-for-a-service-account-returns-OK-response.yml @@ -0,0 +1,104 @@ +http_interactions: +- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"email":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192@datadoghq.com","service_account":true,"title":"user + title"},"type":"users"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts + response: + body: + encoding: UTF-8 + string: '{"data":{"type":"users","id":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","attributes":{"uuid":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","name":null,"handle":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","created_at":"2026-04-03T21:03:12.706435+00:00","modified_at":"2026-04-03T21:03:12.706435+00:00","email":"test-update_an_access_token_for_a_service_account_returns_ok_response-1775250192@datadoghq.com","icon":"https://secure.gravatar.com/avatar/8ef25c203ebdbe5e11acb74bd99ba7da?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"}}}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192","scopes":["dashboards_read"]},"type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9a7d27cc-4969-4a57-990c-03c23a9f2adc","type":"personal_access_tokens","attributes":{"alias":"4hW0tyOpjf5Dj84mZaXqwe","created_at":"2026-04-03T21:03:12.978132411Z","expires_at":null,"key":"xxxxx_xxxxxxxxxxxxxxxxxxXxxx_xxxxxXxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192","public_portion":"4hW0tyOpjf5Dj84mZaXqwe","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192-updated"},"id":"9a7d27cc-4969-4a57-990c-03c23a9f2adc","type":"personal_access_tokens"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens/9a7d27cc-4969-4a57-990c-03c23a9f2adc + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9a7d27cc-4969-4a57-990c-03c23a9f2adc","type":"personal_access_tokens","attributes":{"alias":"4hW0tyOpjf5Dj84mZaXqwe","created_at":"2026-04-03T21:03:12.978132Z","expires_at":null,"last_used_at":null,"modified_at":"2026-04-03T21:03:13.152078Z","name":"Test-Update_an_access_token_for_a_service_account_returns_OK_response-1775250192-updated","public_portion":"4hW0tyOpjf5Dj84mZaXqwe","scopes":["dashboards_read"]},"relationships":{"owned_by":{"data":{"id":"86bdf0d7-2fa0-11f1-991f-62f4bfc595d0","type":"users"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/service_accounts/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0/access_tokens/9a7d27cc-4969-4a57-990c-03c23a9f2adc + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 03 Apr 2026 21:03:12 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/users/86bdf0d7-2fa0-11f1-991f-62f4bfc595d0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/key-management/CreatePersonalAccessToken.rb b/examples/v2/key-management/CreatePersonalAccessToken.rb new file mode 100644 index 000000000000..5013a6e62ea9 --- /dev/null +++ b/examples/v2/key-management/CreatePersonalAccessToken.rb @@ -0,0 +1,18 @@ +# Create a personal access token returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::KeyManagementAPI.new + +body = DatadogAPIClient::V2::PersonalAccessTokenCreateRequest.new({ + data: DatadogAPIClient::V2::PersonalAccessTokenCreateData.new({ + type: DatadogAPIClient::V2::PersonalAccessTokensType::PERSONAL_ACCESS_TOKENS, + attributes: DatadogAPIClient::V2::PersonalAccessTokenCreateAttributes.new({ + name: "Example-Personal-Access-Token", + scopes: [ + "dashboards_read", + ], + expires_at: (Time.now + 365 * 86400), + }), + }), +}) +p api_instance.create_personal_access_token(body) diff --git a/examples/v2/key-management/GetPersonalAccessToken.rb b/examples/v2/key-management/GetPersonalAccessToken.rb new file mode 100644 index 000000000000..ec5c07223fb8 --- /dev/null +++ b/examples/v2/key-management/GetPersonalAccessToken.rb @@ -0,0 +1,8 @@ +# Get a personal access token returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::KeyManagementAPI.new + +# there is a valid "personal_access_token" in the system +PERSONAL_ACCESS_TOKEN_DATA_ID = ENV["PERSONAL_ACCESS_TOKEN_DATA_ID"] +p api_instance.get_personal_access_token(PERSONAL_ACCESS_TOKEN_DATA_ID) diff --git a/examples/v2/key-management/ListPersonalAccessTokens.rb b/examples/v2/key-management/ListPersonalAccessTokens.rb new file mode 100644 index 000000000000..72a58ce6b9a5 --- /dev/null +++ b/examples/v2/key-management/ListPersonalAccessTokens.rb @@ -0,0 +1,5 @@ +# Get all personal access tokens returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::KeyManagementAPI.new +p api_instance.list_personal_access_tokens() diff --git a/examples/v2/key-management/RevokePersonalAccessToken.rb b/examples/v2/key-management/RevokePersonalAccessToken.rb new file mode 100644 index 000000000000..175ccbba36f3 --- /dev/null +++ b/examples/v2/key-management/RevokePersonalAccessToken.rb @@ -0,0 +1,8 @@ +# Revoke a personal access token returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::KeyManagementAPI.new + +# there is a valid "personal_access_token" in the system +PERSONAL_ACCESS_TOKEN_DATA_ID = ENV["PERSONAL_ACCESS_TOKEN_DATA_ID"] +api_instance.revoke_personal_access_token(PERSONAL_ACCESS_TOKEN_DATA_ID) diff --git a/examples/v2/key-management/UpdatePersonalAccessToken.rb b/examples/v2/key-management/UpdatePersonalAccessToken.rb new file mode 100644 index 000000000000..d4c576a3ef64 --- /dev/null +++ b/examples/v2/key-management/UpdatePersonalAccessToken.rb @@ -0,0 +1,18 @@ +# Update a personal access token returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::KeyManagementAPI.new + +# there is a valid "personal_access_token" in the system +PERSONAL_ACCESS_TOKEN_DATA_ID = ENV["PERSONAL_ACCESS_TOKEN_DATA_ID"] + +body = DatadogAPIClient::V2::PersonalAccessTokenUpdateRequest.new({ + data: DatadogAPIClient::V2::PersonalAccessTokenUpdateData.new({ + type: DatadogAPIClient::V2::PersonalAccessTokensType::PERSONAL_ACCESS_TOKENS, + id: PERSONAL_ACCESS_TOKEN_DATA_ID, + attributes: DatadogAPIClient::V2::PersonalAccessTokenUpdateAttributes.new({ + name: "Example-Personal-Access-Token-updated", + }), + }), +}) +p api_instance.update_personal_access_token(PERSONAL_ACCESS_TOKEN_DATA_ID, body) diff --git a/examples/v2/service-accounts/CreateServiceAccountAccessToken.rb b/examples/v2/service-accounts/CreateServiceAccountAccessToken.rb new file mode 100644 index 000000000000..51f5ee744521 --- /dev/null +++ b/examples/v2/service-accounts/CreateServiceAccountAccessToken.rb @@ -0,0 +1,20 @@ +# Create an access token for a service account returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ServiceAccountsAPI.new + +# there is a valid "service_account_user" in the system +SERVICE_ACCOUNT_USER_DATA_ID = ENV["SERVICE_ACCOUNT_USER_DATA_ID"] + +body = DatadogAPIClient::V2::ServiceAccountAccessTokenCreateRequest.new({ + data: DatadogAPIClient::V2::ServiceAccountAccessTokenCreateData.new({ + type: DatadogAPIClient::V2::PersonalAccessTokensType::PERSONAL_ACCESS_TOKENS, + attributes: DatadogAPIClient::V2::ServiceAccountAccessTokenCreateAttributes.new({ + name: "Example-Service-Account", + scopes: [ + "dashboards_read", + ], + }), + }), +}) +p api_instance.create_service_account_access_token(SERVICE_ACCOUNT_USER_DATA_ID, body) diff --git a/examples/v2/service-accounts/CreateServiceAccountAccessToken_4212922277.rb b/examples/v2/service-accounts/CreateServiceAccountAccessToken_4212922277.rb new file mode 100644 index 000000000000..b8ab22924bed --- /dev/null +++ b/examples/v2/service-accounts/CreateServiceAccountAccessToken_4212922277.rb @@ -0,0 +1,20 @@ +# Create a service account access token returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::KeyManagementAPI.new + +# there is a valid "service_account_user" in the system +SERVICE_ACCOUNT_USER_DATA_ID = ENV["SERVICE_ACCOUNT_USER_DATA_ID"] + +body = DatadogAPIClient::V2::ServiceAccountAccessTokenCreateRequest.new({ + data: DatadogAPIClient::V2::ServiceAccountAccessTokenCreateData.new({ + type: DatadogAPIClient::V2::PersonalAccessTokensType::PERSONAL_ACCESS_TOKENS, + attributes: DatadogAPIClient::V2::ServiceAccountAccessTokenCreateAttributes.new({ + name: "Example-Personal-Access-Token", + scopes: [ + "dashboards_read", + ], + }), + }), +}) +p api_instance.create_service_account_access_token(SERVICE_ACCOUNT_USER_DATA_ID, body) diff --git a/examples/v2/service-accounts/GetServiceAccountAccessToken.rb b/examples/v2/service-accounts/GetServiceAccountAccessToken.rb new file mode 100644 index 000000000000..db27633430dd --- /dev/null +++ b/examples/v2/service-accounts/GetServiceAccountAccessToken.rb @@ -0,0 +1,11 @@ +# Get an access token for a service account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ServiceAccountsAPI.new + +# there is a valid "service_account_user" in the system +SERVICE_ACCOUNT_USER_DATA_ID = ENV["SERVICE_ACCOUNT_USER_DATA_ID"] + +# there is a valid "service_account_access_token" for "service_account_user" +SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID = ENV["SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID"] +p api_instance.get_service_account_access_token(SERVICE_ACCOUNT_USER_DATA_ID, SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID) diff --git a/examples/v2/service-accounts/ListServiceAccountAccessTokens.rb b/examples/v2/service-accounts/ListServiceAccountAccessTokens.rb new file mode 100644 index 000000000000..22b534aebf8b --- /dev/null +++ b/examples/v2/service-accounts/ListServiceAccountAccessTokens.rb @@ -0,0 +1,8 @@ +# List access tokens for a service account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ServiceAccountsAPI.new + +# there is a valid "service_account_user" in the system +SERVICE_ACCOUNT_USER_DATA_ID = ENV["SERVICE_ACCOUNT_USER_DATA_ID"] +p api_instance.list_service_account_access_tokens(SERVICE_ACCOUNT_USER_DATA_ID) diff --git a/examples/v2/service-accounts/RevokeServiceAccountAccessToken.rb b/examples/v2/service-accounts/RevokeServiceAccountAccessToken.rb new file mode 100644 index 000000000000..00b83b92810f --- /dev/null +++ b/examples/v2/service-accounts/RevokeServiceAccountAccessToken.rb @@ -0,0 +1,11 @@ +# Revoke an access token for a service account returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ServiceAccountsAPI.new + +# there is a valid "service_account_user" in the system +SERVICE_ACCOUNT_USER_DATA_ID = ENV["SERVICE_ACCOUNT_USER_DATA_ID"] + +# there is a valid "service_account_access_token" for "service_account_user" +SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID = ENV["SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID"] +api_instance.revoke_service_account_access_token(SERVICE_ACCOUNT_USER_DATA_ID, SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID) diff --git a/examples/v2/service-accounts/UpdateServiceAccountAccessToken.rb b/examples/v2/service-accounts/UpdateServiceAccountAccessToken.rb new file mode 100644 index 000000000000..91d24fd61a58 --- /dev/null +++ b/examples/v2/service-accounts/UpdateServiceAccountAccessToken.rb @@ -0,0 +1,22 @@ +# Update an access token for a service account returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ServiceAccountsAPI.new + +# there is a valid "service_account_user" in the system +SERVICE_ACCOUNT_USER_DATA_ID = ENV["SERVICE_ACCOUNT_USER_DATA_ID"] + +# there is a valid "service_account_access_token" for "service_account_user" +SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ATTRIBUTES_NAME = ENV["SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ATTRIBUTES_NAME"] +SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID = ENV["SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID"] + +body = DatadogAPIClient::V2::PersonalAccessTokenUpdateRequest.new({ + data: DatadogAPIClient::V2::PersonalAccessTokenUpdateData.new({ + id: SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, + type: DatadogAPIClient::V2::PersonalAccessTokensType::PERSONAL_ACCESS_TOKENS, + attributes: DatadogAPIClient::V2::PersonalAccessTokenUpdateAttributes.new({ + name: "My Personal Access Token-updated", + }), + }), +}) +p api_instance.update_service_account_access_token(SERVICE_ACCOUNT_USER_DATA_ID, SERVICE_ACCOUNT_ACCESS_TOKEN_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 864c22a81beb..ddeb11b64163 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1061,6 +1061,26 @@ "app_key_id" => "String", "body" => "ApplicationKeyUpdateRequest", }, + "v2.ListPersonalAccessTokens" => { + "page_size" => "Integer", + "page_number" => "Integer", + "sort" => "PersonalAccessTokensSort", + "filter" => "String", + "filter_owner_uuid" => "Array", + }, + "v2.CreatePersonalAccessToken" => { + "body" => "PersonalAccessTokenCreateRequest", + }, + "v2.RevokePersonalAccessToken" => { + "pat_uuid" => "String", + }, + "v2.GetPersonalAccessToken" => { + "pat_uuid" => "String", + }, + "v2.UpdatePersonalAccessToken" => { + "pat_uuid" => "String", + "body" => "PersonalAccessTokenUpdateRequest", + }, "v2.ListAPIs" => { "query" => "String", "page_limit" => "Integer", @@ -3705,6 +3725,30 @@ "v2.CreateServiceAccount" => { "body" => "ServiceAccountCreateRequest", }, + "v2.ListServiceAccountAccessTokens" => { + "service_account_id" => "String", + "page_size" => "Integer", + "page_number" => "Integer", + "sort" => "PersonalAccessTokensSort", + "filter" => "String", + }, + "v2.CreateServiceAccountAccessToken" => { + "service_account_id" => "String", + "body" => "ServiceAccountAccessTokenCreateRequest", + }, + "v2.RevokeServiceAccountAccessToken" => { + "service_account_id" => "String", + "pat_uuid" => "String", + }, + "v2.GetServiceAccountAccessToken" => { + "service_account_id" => "String", + "pat_uuid" => "String", + }, + "v2.UpdateServiceAccountAccessToken" => { + "service_account_id" => "String", + "pat_uuid" => "String", + "body" => "PersonalAccessTokenUpdateRequest", + }, "v2.ListServiceAccountApplicationKeys" => { "service_account_id" => "String", "page_size" => "Integer", diff --git a/features/v2/given.json b/features/v2/given.json index 8413be265af8..5d9d7c889960 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -929,6 +929,18 @@ "tag": "Roles", "operationId": "ListPermissions" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"scopes\": [\"dashboards_read\"],\n \"expires_at\": \"{{ timeISO('now+365d') }}\"\n },\n \"type\": \"personal_access_tokens\"\n }\n}" + } + ], + "step": "there is a valid \"personal_access_token\" in the system", + "key": "personal_access_token", + "tag": "Key Management", + "operationId": "CreatePersonalAccessToken" + }, { "parameters": [ { @@ -1243,6 +1255,22 @@ "tag": "Service Accounts", "operationId": "CreateServiceAccount" }, + { + "parameters": [ + { + "name": "service_account_id", + "value": "\"{{ service_account_user.data.id }}\"" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"scopes\": [\"dashboards_read\"]\n },\n \"type\": \"personal_access_tokens\"\n }\n}" + } + ], + "step": "there is a valid \"service_account_access_token\" for \"service_account_user\"", + "key": "service_account_access_token", + "tag": "Service Accounts", + "operationId": "CreateServiceAccountAccessToken" + }, { "parameters": [ { diff --git a/features/v2/key_management.feature b/features/v2/key_management.feature index 40daf9df54f4..bef357388c95 100644 --- a/features/v2/key_management.feature +++ b/features/v2/key_management.feature @@ -12,6 +12,20 @@ Feature: Key Management And a valid "appKeyAuth" key in the system And an instance of "KeyManagement" API + @generated @skip @team:DataDog/credentials-management + Scenario: Create a personal access token returns "Bad Request" response + Given new "CreatePersonalAccessToken" request + And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "My Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "personal_access_tokens"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/credentials-management + Scenario: Create a personal access token returns "Created" response + Given new "CreatePersonalAccessToken" request + And body with value {"data": {"attributes": {"expires_at": "2025-12-31T23:59:59+00:00", "name": "My Personal Access Token", "scopes": ["dashboards_read", "dashboards_write"]}, "type": "personal_access_tokens"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/credentials-management Scenario: Create an API key returns "Bad Request" response Given new "CreateAPIKey" request @@ -200,6 +214,20 @@ Feature: Key Management And the response "data.id" is equal to "{{ api_key.data.id }}" And the response "data.attributes" has field "date_last_used" + @generated @skip @team:DataDog/credentials-management + Scenario: Get a personal access token returns "Not Found" response + Given new "GetPersonalAccessToken" request + And request contains "pat_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/credentials-management + Scenario: Get a personal access token returns "OK" response + Given new "GetPersonalAccessToken" request + And request contains "pat_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/credentials-management Scenario: Get all API keys returns "Bad Request" response Given new "ListAPIKeys" request @@ -257,6 +285,18 @@ 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 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 personal access tokens returns "OK" response + Given new "ListPersonalAccessTokens" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/credentials-management Scenario: Get an application key returns "Bad Request" response Given new "GetApplicationKey" request @@ -301,3 +341,41 @@ Feature: Key Management And the response "data.attributes.name" is equal to "{{ application_key.data.attributes.name }}" And the response "data.attributes" has field "scopes" And the response "data.attributes" has field "last_used_at" + + @generated @skip @team:DataDog/credentials-management + Scenario: Revoke a personal access token returns "No Content" response + Given new "RevokePersonalAccessToken" request + And request contains "pat_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/credentials-management + Scenario: Revoke a personal access token returns "Not Found" response + Given new "RevokePersonalAccessToken" request + And request contains "pat_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/credentials-management + Scenario: Update a personal access token returns "Bad Request" response + Given new "UpdatePersonalAccessToken" request + And request contains "pat_uuid" 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 + + @generated @skip @team:DataDog/credentials-management + Scenario: Update a personal access token returns "Not Found" response + Given new "UpdatePersonalAccessToken" request + And request contains "pat_uuid" 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 + + @generated @skip @team:DataDog/credentials-management + Scenario: Update a personal access token returns "OK" response + Given new "UpdatePersonalAccessToken" request + And request contains "pat_uuid" 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 200 OK diff --git a/features/v2/personal_access_tokens.feature b/features/v2/personal_access_tokens.feature new file mode 100644 index 000000000000..78f13ba20966 --- /dev/null +++ b/features/v2/personal_access_tokens.feature @@ -0,0 +1,98 @@ +@endpoint(key-management) @endpoint(key-management-v2) +Feature: Personal Access Tokens + Manage personal access tokens (PATs) and service account access tokens (SATs) + for your organization. PATs provide scoped, time-limited access to the Datadog + API for individual users, while SATs provide the same for service accounts. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "KeyManagement" API + + @team:DataDog/credentials-management + Scenario: Create a personal access token returns "Created" response + Given new "CreatePersonalAccessToken" request + And body with value {"data": {"type": "personal_access_tokens", "attributes": {"name": "{{ unique }}", "scopes": ["dashboards_read"], "expires_at": "{{ timeISO('now+365d') }}"}}} + 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.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.scopes" is equal to ["dashboards_read"] + And the response "data.attributes" has field "key" + + @generated @skip @team:DataDog/credentials-management + Scenario: Create a personal access token returns "Bad Request" response + Given new "CreatePersonalAccessToken" request + And body with value {"data": {"type": "personal_access_tokens", "attributes": {"name": "", "scopes": ["dashboards_read"], "expires_at": "{{ timeISO('now+365d') }}"}}} + 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 there is a valid "personal_access_token" in the system + And new "ListPersonalAccessTokens" request + When the request is sent + Then the response status is 200 OK + And the response "data" has item with field "type" with value "personal_access_tokens" + + @team:DataDog/credentials-management + Scenario: Get a personal access token returns "OK" response + Given there is a valid "personal_access_token" in the system + And new "GetPersonalAccessToken" request + And request contains "pat_uuid" 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" + And the response "data.id" has the same value as "personal_access_token.data.id" + + @generated @skip @team:DataDog/credentials-management + Scenario: Get a personal access token returns "Not Found" response + Given new "GetPersonalAccessToken" request + And request contains "pat_uuid" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/credentials-management + Scenario: Update a personal access token returns "OK" response + Given there is a valid "personal_access_token" in the system + And new "UpdatePersonalAccessToken" request + And request contains "pat_uuid" 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 + And the response "data.attributes.name" is equal to "{{ unique }}-updated" + + @generated @skip @team:DataDog/credentials-management + Scenario: Update a personal access token returns "Not Found" response + Given new "UpdatePersonalAccessToken" request + And request contains "pat_uuid" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"type": "personal_access_tokens", "id": "00000000-0000-0000-0000-000000000000", "attributes": {"name": "updated"}}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/credentials-management + Scenario: Revoke a personal access token returns "No Content" response + Given there is a valid "personal_access_token" in the system + And new "RevokePersonalAccessToken" request + And request contains "pat_uuid" parameter from "personal_access_token.data.id" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/credentials-management + Scenario: Revoke a personal access token returns "Not Found" response + Given new "RevokePersonalAccessToken" request + And request contains "pat_uuid" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/credentials-management + Scenario: Create a service account access token returns "Created" response + 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"]}}} + 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.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes" has field "key" diff --git a/features/v2/service_accounts.feature b/features/v2/service_accounts.feature index 6e25db1e8f20..3842b478f5c6 100644 --- a/features/v2/service_accounts.feature +++ b/features/v2/service_accounts.feature @@ -29,6 +29,34 @@ Feature: Service Accounts And the response "data.attributes.service_account" is equal to true And the response "data.relationships.roles.data[0].id" is equal to "{{ role.data.id }}" + @generated @skip @team:DataDog/credentials-management + 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"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/credentials-management + Scenario: Create an access token for a service account returns "Created" response + 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"]}}} + 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.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" + + @generated @skip @team:DataDog/credentials-management + 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"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: Create an application key for this service account returns "Bad Request" response Given new "CreateServiceAccountApplicationKey" request @@ -110,6 +138,27 @@ Feature: Service Accounts And the response "data.type" is equal to "application_keys" And the response "data.id" is equal to "{{ service_account_application_key.data.id }}" + @generated @skip @team:DataDog/credentials-management + 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_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/credentials-management + Scenario: Get an access token for a service account returns "OK" response + Given there is a valid "service_account_user" in the system + 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_uuid" 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.id" is equal to "{{ service_account_access_token.data.id }}" + @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: Get one application key for this service account returns "Not Found" response Given new "GetServiceAccountApplicationKey" request @@ -131,6 +180,29 @@ Feature: Service Accounts And the response "data.type" is equal to "application_keys" And the response "data.id" is equal to "{{ service_account_application_key.data.id }}" + @generated @skip @team:DataDog/credentials-management + Scenario: List access tokens for a service account returns "Bad Request" response + Given new "ListServiceAccountAccessTokens" request + And request contains "service_account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/credentials-management + Scenario: List access tokens for a service account returns "Not Found" response + Given new "ListServiceAccountAccessTokens" request + And request contains "service_account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/credentials-management + Scenario: List access tokens for a service account returns "OK" response + Given there is a valid "service_account_user" in the system + And new "ListServiceAccountAccessTokens" request + And request contains "service_account_id" parameter from "service_account_user.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 0 + @generated @skip @team:DataDog/credentials-management @team:DataDog/team-aaa-identity Scenario: List application keys for this service account returns "Bad Request" response Given new "ListServiceAccountApplicationKeys" request @@ -153,3 +225,53 @@ Feature: Service Accounts When the request is sent Then the response status is 200 OK And the response "data" has length 0 + + @team:DataDog/credentials-management + Scenario: Revoke an access token for a service account returns "No Content" response + Given there is a valid "service_account_user" in the system + 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_uuid" parameter from "service_account_access_token.data.id" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/credentials-management + 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_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/credentials-management + 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_uuid" 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 + + @generated @skip @team:DataDog/credentials-management + 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_uuid" 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 + + @team:DataDog/credentials-management + Scenario: Update an access token for a service account returns "OK" response + Given there is a valid "service_account_user" in the system + 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_uuid" 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"}}} + 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.id" is equal to "{{ service_account_access_token.data.id }}" diff --git a/features/v2/undo.json b/features/v2/undo.json index 8b9940b568da..450f4891a852 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3970,6 +3970,43 @@ "type": "safe" } }, + "ListPersonalAccessTokens": { + "tag": "Key Management", + "undo": { + "type": "safe" + } + }, + "CreatePersonalAccessToken": { + "tag": "Key Management", + "undo": { + "operationId": "RevokePersonalAccessToken", + "parameters": [ + { + "name": "pat_uuid", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RevokePersonalAccessToken": { + "tag": "Key Management", + "undo": { + "type": "idempotent" + } + }, + "GetPersonalAccessToken": { + "tag": "Key Management", + "undo": { + "type": "safe" + } + }, + "UpdatePersonalAccessToken": { + "tag": "Key Management", + "undo": { + "type": "idempotent" + } + }, "ListFindings": { "tag": "Security Monitoring", "undo": { @@ -5404,6 +5441,47 @@ "type": "unsafe" } }, + "ListServiceAccountAccessTokens": { + "tag": "Service Accounts", + "undo": { + "type": "safe" + } + }, + "CreateServiceAccountAccessToken": { + "tag": "Service Accounts", + "undo": { + "operationId": "RevokeServiceAccountAccessToken", + "parameters": [ + { + "name": "service_account_id", + "source": "data.relationships.owned_by.data.id" + }, + { + "name": "pat_uuid", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "RevokeServiceAccountAccessToken": { + "tag": "Service Accounts", + "undo": { + "type": "idempotent" + } + }, + "GetServiceAccountAccessToken": { + "tag": "Service Accounts", + "undo": { + "type": "safe" + } + }, + "UpdateServiceAccountAccessToken": { + "tag": "Service Accounts", + "undo": { + "type": "idempotent" + } + }, "ListServiceAccountApplicationKeys": { "tag": "Service Accounts", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 2ef96f9dbe3b..0f2fe22a67b6 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2688,6 +2688,8 @@ def overrides "v2.full_application_key_attributes" => "FullApplicationKeyAttributes", "v2.full_custom_framework_data" => "FullCustomFrameworkData", "v2.full_custom_framework_data_attributes" => "FullCustomFrameworkDataAttributes", + "v2.full_personal_access_token" => "FullPersonalAccessToken", + "v2.full_personal_access_token_attributes" => "FullPersonalAccessTokenAttributes", "v2.gcp_credentials" => "GCPCredentials", "v2.gcp_credentials_update" => "GCPCredentialsUpdate", "v2.gcp_integration" => "GCPIntegration", @@ -3290,6 +3292,7 @@ def overrides "v2.list_kind_catalog_response" => "ListKindCatalogResponse", "v2.list_notification_channels_response" => "ListNotificationChannelsResponse", "v2.list_on_call_notification_rules_response" => "ListOnCallNotificationRulesResponse", + "v2.list_personal_access_tokens_response" => "ListPersonalAccessTokensResponse", "v2.list_pipelines_response" => "ListPipelinesResponse", "v2.list_pipelines_response_meta" => "ListPipelinesResponseMeta", "v2.list_powerpacks_response" => "ListPowerpacksResponse", @@ -4142,6 +4145,21 @@ def overrides "v2.permission_attributes" => "PermissionAttributes", "v2.permissions_response" => "PermissionsResponse", "v2.permissions_type" => "PermissionsType", + "v2.personal_access_token" => "PersonalAccessToken", + "v2.personal_access_token_attributes" => "PersonalAccessTokenAttributes", + "v2.personal_access_token_create_attributes" => "PersonalAccessTokenCreateAttributes", + "v2.personal_access_token_create_data" => "PersonalAccessTokenCreateData", + "v2.personal_access_token_create_request" => "PersonalAccessTokenCreateRequest", + "v2.personal_access_token_create_response" => "PersonalAccessTokenCreateResponse", + "v2.personal_access_token_relationships" => "PersonalAccessTokenRelationships", + "v2.personal_access_token_response" => "PersonalAccessTokenResponse", + "v2.personal_access_token_response_meta" => "PersonalAccessTokenResponseMeta", + "v2.personal_access_token_response_meta_page" => "PersonalAccessTokenResponseMetaPage", + "v2.personal_access_tokens_sort" => "PersonalAccessTokensSort", + "v2.personal_access_tokens_type" => "PersonalAccessTokensType", + "v2.personal_access_token_update_attributes" => "PersonalAccessTokenUpdateAttributes", + "v2.personal_access_token_update_data" => "PersonalAccessTokenUpdateData", + "v2.personal_access_token_update_request" => "PersonalAccessTokenUpdateRequest", "v2.playlist" => "Playlist", "v2.playlist_array" => "PlaylistArray", "v2.playlist_data" => "PlaylistData", @@ -4925,6 +4943,9 @@ def overrides "v2.sensitive_data_scanner_suppressions" => "SensitiveDataScannerSuppressions", "v2.sensitive_data_scanner_text_replacement" => "SensitiveDataScannerTextReplacement", "v2.sensitive_data_scanner_text_replacement_type" => "SensitiveDataScannerTextReplacementType", + "v2.service_account_access_token_create_attributes" => "ServiceAccountAccessTokenCreateAttributes", + "v2.service_account_access_token_create_data" => "ServiceAccountAccessTokenCreateData", + "v2.service_account_access_token_create_request" => "ServiceAccountAccessTokenCreateRequest", "v2.service_account_create_attributes" => "ServiceAccountCreateAttributes", "v2.service_account_create_data" => "ServiceAccountCreateData", "v2.service_account_create_request" => "ServiceAccountCreateRequest", diff --git a/lib/datadog_api_client/v2/api/key_management_api.rb b/lib/datadog_api_client/v2/api/key_management_api.rb index 76838462a2b4..8a6d256738c4 100644 --- a/lib/datadog_api_client/v2/api/key_management_api.rb +++ b/lib/datadog_api_client/v2/api/key_management_api.rb @@ -157,6 +157,73 @@ def create_current_user_application_key_with_http_info(body, opts = {}) return data, status_code, headers end + # Create a personal access token. + # + # @see #create_personal_access_token_with_http_info + def create_personal_access_token(body, opts = {}) + data, _status_code, _headers = create_personal_access_token_with_http_info(body, opts) + data + end + + # Create a personal access token. + # + # Create a personal access token for the current user. + # + # @param body [PersonalAccessTokenCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(PersonalAccessTokenCreateResponse, Integer, Hash)>] PersonalAccessTokenCreateResponse data, response status code and response headers + def create_personal_access_token_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: KeyManagementAPI.create_personal_access_token ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling KeyManagementAPI.create_personal_access_token" + end + # resource path + local_var_path = '/api/v2/personal_access_tokens' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'PersonalAccessTokenCreateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_personal_access_token, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: KeyManagementAPI#create_personal_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an API key. # # @see #delete_api_key_with_http_info @@ -552,6 +619,71 @@ def get_current_user_application_key_with_http_info(app_key_id, opts = {}) return data, status_code, headers end + # Get a personal access token. + # + # @see #get_personal_access_token_with_http_info + def get_personal_access_token(pat_uuid, opts = {}) + data, _status_code, _headers = get_personal_access_token_with_http_info(pat_uuid, opts) + data + end + + # Get a personal access token. + # + # Get a specific personal access token by its UUID. + # + # @param pat_uuid [String] The UUID of the personal access token. + # @param opts [Hash] the optional parameters + # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers + def get_personal_access_token_with_http_info(pat_uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: KeyManagementAPI.get_personal_access_token ...' + end + # verify the required parameter 'pat_uuid' is set + if @api_client.config.client_side_validation && pat_uuid.nil? + fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling KeyManagementAPI.get_personal_access_token" + end + # resource path + local_var_path = '/api/v2/personal_access_tokens/{pat_uuid}'.sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'PersonalAccessTokenResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_personal_access_token, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: KeyManagementAPI#get_personal_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get all API keys. # # @see #list_api_keys_with_http_info @@ -794,6 +926,146 @@ def list_current_user_application_keys_with_http_info(opts = {}) return data, status_code, headers end + # Get all personal access tokens. + # + # @see #list_personal_access_tokens_with_http_info + def list_personal_access_tokens(opts = {}) + data, _status_code, _headers = list_personal_access_tokens_with_http_info(opts) + data + end + + # Get all personal access tokens. + # + # List all personal access tokens for the organization. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [PersonalAccessTokensSort] :sort Personal 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. + # @option opts [String] :filter Filter personal access tokens by the specified string. + # @option opts [Array] :filter_owner_uuid Filter personal access tokens by the owner's UUID. Supports multiple values. + # @return [Array<(ListPersonalAccessTokensResponse, Integer, Hash)>] ListPersonalAccessTokensResponse data, response status code and response headers + def list_personal_access_tokens_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: KeyManagementAPI.list_personal_access_tokens ...' + end + allowable_values = ['name', '-name', 'created_at', '-created_at', 'expires_at', '-expires_at'] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/personal_access_tokens' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + query_params[:'filter[owner_uuid]'] = @api_client.build_collection_param(opts[:'filter_owner_uuid'], :multi) if !opts[:'filter_owner_uuid'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListPersonalAccessTokensResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_personal_access_tokens, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: KeyManagementAPI#list_personal_access_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Revoke a personal access token. + # + # @see #revoke_personal_access_token_with_http_info + def revoke_personal_access_token(pat_uuid, opts = {}) + revoke_personal_access_token_with_http_info(pat_uuid, opts) + nil + end + + # Revoke a personal access token. + # + # Revoke a specific personal access token. + # + # @param pat_uuid [String] The UUID of the personal access token. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def revoke_personal_access_token_with_http_info(pat_uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: KeyManagementAPI.revoke_personal_access_token ...' + end + # verify the required parameter 'pat_uuid' is set + if @api_client.config.client_side_validation && pat_uuid.nil? + fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling KeyManagementAPI.revoke_personal_access_token" + end + # resource path + local_var_path = '/api/v2/personal_access_tokens/{pat_uuid}'.sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :revoke_personal_access_token, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: KeyManagementAPI#revoke_personal_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Edit an API key. # # @see #update_api_key_with_http_info @@ -1010,5 +1282,77 @@ def update_current_user_application_key_with_http_info(app_key_id, body, opts = end return data, status_code, headers end + + # Update a personal access token. + # + # @see #update_personal_access_token_with_http_info + def update_personal_access_token(pat_uuid, body, opts = {}) + data, _status_code, _headers = update_personal_access_token_with_http_info(pat_uuid, body, opts) + data + end + + # Update a personal access token. + # + # Update a specific personal access token. + # + # @param pat_uuid [String] The UUID of the personal access token. + # @param body [PersonalAccessTokenUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers + def update_personal_access_token_with_http_info(pat_uuid, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: KeyManagementAPI.update_personal_access_token ...' + end + # verify the required parameter 'pat_uuid' is set + if @api_client.config.client_side_validation && pat_uuid.nil? + fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling KeyManagementAPI.update_personal_access_token" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling KeyManagementAPI.update_personal_access_token" + end + # resource path + local_var_path = '/api/v2/personal_access_tokens/{pat_uuid}'.sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'PersonalAccessTokenResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_personal_access_token, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: KeyManagementAPI#update_personal_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/api/service_accounts_api.rb b/lib/datadog_api_client/v2/api/service_accounts_api.rb index 273696ecd47a..b4f6aa2afaea 100644 --- a/lib/datadog_api_client/v2/api/service_accounts_api.rb +++ b/lib/datadog_api_client/v2/api/service_accounts_api.rb @@ -90,6 +90,78 @@ def create_service_account_with_http_info(body, opts = {}) return data, status_code, headers end + # Create an access token for a service account. + # + # @see #create_service_account_access_token_with_http_info + def create_service_account_access_token(service_account_id, body, opts = {}) + data, _status_code, _headers = create_service_account_access_token_with_http_info(service_account_id, body, opts) + data + end + + # Create an access token for a service account. + # + # Create an access token for a service account. + # + # @param service_account_id [String] The ID of the service account. + # @param body [ServiceAccountAccessTokenCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(PersonalAccessTokenCreateResponse, Integer, Hash)>] PersonalAccessTokenCreateResponse data, response status code and response headers + def create_service_account_access_token_with_http_info(service_account_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.create_service_account_access_token ...' + end + # verify the required parameter 'service_account_id' is set + if @api_client.config.client_side_validation && service_account_id.nil? + fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.create_service_account_access_token" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceAccountsAPI.create_service_account_access_token" + end + # resource path + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'PersonalAccessTokenCreateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_service_account_access_token, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceAccountsAPI#create_service_account_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an application key for this service account. # # @see #create_service_account_application_key_with_http_info @@ -232,6 +304,76 @@ def delete_service_account_application_key_with_http_info(service_account_id, ap return data, status_code, headers end + # Get an access token for a service account. + # + # @see #get_service_account_access_token_with_http_info + def get_service_account_access_token(service_account_id, pat_uuid, opts = {}) + data, _status_code, _headers = get_service_account_access_token_with_http_info(service_account_id, pat_uuid, opts) + data + end + + # Get an access token for a service account. + # + # Get a specific access token for a service account by its UUID. + # + # @param service_account_id [String] The ID of the service account. + # @param pat_uuid [String] The UUID of the personal access token. + # @param opts [Hash] the optional parameters + # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers + def get_service_account_access_token_with_http_info(service_account_id, pat_uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.get_service_account_access_token ...' + end + # verify the required parameter 'service_account_id' is set + if @api_client.config.client_side_validation && service_account_id.nil? + fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.get_service_account_access_token" + end + # verify the required parameter 'pat_uuid' is set + if @api_client.config.client_side_validation && pat_uuid.nil? + fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling ServiceAccountsAPI.get_service_account_access_token" + end + # resource path + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'PersonalAccessTokenResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_service_account_access_token, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceAccountsAPI#get_service_account_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get one application key for this service account. # # @see #get_service_account_application_key_with_http_info @@ -302,6 +444,83 @@ def get_service_account_application_key_with_http_info(service_account_id, app_k return data, status_code, headers end + # List access tokens for a service account. + # + # @see #list_service_account_access_tokens_with_http_info + def list_service_account_access_tokens(service_account_id, opts = {}) + data, _status_code, _headers = list_service_account_access_tokens_with_http_info(service_account_id, opts) + data + end + + # List access tokens for a service account. + # + # List all access tokens for a specific service account. + # + # @param service_account_id [String] The ID of the service account. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [PersonalAccessTokensSort] :sort Personal 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. + # @option opts [String] :filter Filter personal access tokens by the specified string. + # @return [Array<(ListPersonalAccessTokensResponse, Integer, Hash)>] ListPersonalAccessTokensResponse data, response status code and response headers + def list_service_account_access_tokens_with_http_info(service_account_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.list_service_account_access_tokens ...' + end + # verify the required parameter 'service_account_id' is set + if @api_client.config.client_side_validation && service_account_id.nil? + fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.list_service_account_access_tokens" + end + allowable_values = ['name', '-name', 'created_at', '-created_at', 'expires_at', '-expires_at'] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ListPersonalAccessTokensResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_service_account_access_tokens, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceAccountsAPI#list_service_account_access_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List application keys for this service account. # # @see #list_service_account_application_keys_with_http_info @@ -383,6 +602,153 @@ def list_service_account_application_keys_with_http_info(service_account_id, opt return data, status_code, headers end + # Revoke an access token for a service account. + # + # @see #revoke_service_account_access_token_with_http_info + def revoke_service_account_access_token(service_account_id, pat_uuid, opts = {}) + revoke_service_account_access_token_with_http_info(service_account_id, pat_uuid, opts) + nil + end + + # Revoke an access token for a service account. + # + # Revoke a specific access token for a service account. + # + # @param service_account_id [String] The ID of the service account. + # @param pat_uuid [String] The UUID of the personal access token. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def revoke_service_account_access_token_with_http_info(service_account_id, pat_uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.revoke_service_account_access_token ...' + end + # verify the required parameter 'service_account_id' is set + if @api_client.config.client_side_validation && service_account_id.nil? + fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.revoke_service_account_access_token" + end + # verify the required parameter 'pat_uuid' is set + if @api_client.config.client_side_validation && pat_uuid.nil? + fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling ServiceAccountsAPI.revoke_service_account_access_token" + end + # resource path + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :revoke_service_account_access_token, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceAccountsAPI#revoke_service_account_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an access token for a service account. + # + # @see #update_service_account_access_token_with_http_info + def update_service_account_access_token(service_account_id, pat_uuid, body, opts = {}) + data, _status_code, _headers = update_service_account_access_token_with_http_info(service_account_id, pat_uuid, body, opts) + data + end + + # Update an access token for a service account. + # + # Update a specific access token for a service account. + # + # @param service_account_id [String] The ID of the service account. + # @param pat_uuid [String] The UUID of the personal access token. + # @param body [PersonalAccessTokenUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(PersonalAccessTokenResponse, Integer, Hash)>] PersonalAccessTokenResponse data, response status code and response headers + def update_service_account_access_token_with_http_info(service_account_id, pat_uuid, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ServiceAccountsAPI.update_service_account_access_token ...' + end + # verify the required parameter 'service_account_id' is set + if @api_client.config.client_side_validation && service_account_id.nil? + fail ArgumentError, "Missing the required parameter 'service_account_id' when calling ServiceAccountsAPI.update_service_account_access_token" + end + # verify the required parameter 'pat_uuid' is set + if @api_client.config.client_side_validation && pat_uuid.nil? + fail ArgumentError, "Missing the required parameter 'pat_uuid' when calling ServiceAccountsAPI.update_service_account_access_token" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ServiceAccountsAPI.update_service_account_access_token" + end + # resource path + local_var_path = '/api/v2/service_accounts/{service_account_id}/access_tokens/{pat_uuid}'.sub('{service_account_id}', CGI.escape(service_account_id.to_s).gsub('%2F', '/')).sub('{pat_uuid}', CGI.escape(pat_uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'PersonalAccessTokenResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_service_account_access_token, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ServiceAccountsAPI#update_service_account_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Edit an application key for this service account. # # @see #update_service_account_application_key_with_http_info diff --git a/lib/datadog_api_client/v2/models/full_personal_access_token.rb b/lib/datadog_api_client/v2/models/full_personal_access_token.rb new file mode 100644 index 000000000000..0e188dae74a6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/full_personal_access_token.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Datadog personal access token, including the token key. + class FullPersonalAccessToken + include BaseGenericModel + + # Attributes of a full personal access token, including the token key. + attr_accessor :attributes + + # ID of the personal access token. + attr_accessor :id + + # Resources related to the personal access token. + attr_accessor :relationships + + # Personal access tokens resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FullPersonalAccessTokenAttributes', + :'id' => :'String', + :'relationships' => :'PersonalAccessTokenRelationships', + :'type' => :'PersonalAccessTokensType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FullPersonalAccessToken` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb b/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb new file mode 100644 index 000000000000..3679e1c610d9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/full_personal_access_token_attributes.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a full personal access token, including the token key. + class FullPersonalAccessTokenAttributes + include BaseGenericModel + + # The alias (short identifier) of the personal access token. + attr_accessor :_alias + + # Creation date of the personal access token. + attr_accessor :created_at + + # Expiration date of the personal access token. + attr_accessor :expires_at + + # The personal access token key. Only returned upon creation. + attr_accessor :key + + # Name of the personal access token. + attr_accessor :name + + # The public portion of the personal access token. + attr_accessor :public_portion + + # Array of scopes granted to the personal access token. + attr_accessor :scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'created_at' => :'created_at', + :'expires_at' => :'expires_at', + :'key' => :'key', + :'name' => :'name', + :'public_portion' => :'public_portion', + :'scopes' => :'scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'created_at' => :'Time', + :'expires_at' => :'Time', + :'key' => :'String', + :'name' => :'String', + :'public_portion' => :'String', + :'scopes' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FullPersonalAccessTokenAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'public_portion') + self.public_portion = attributes[:'public_portion'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + created_at == o.created_at && + expires_at == o.expires_at && + key == o.key && + name == o.name && + public_portion == o.public_portion && + scopes == o.scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, created_at, expires_at, key, name, public_portion, scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/list_personal_access_tokens_response.rb b/lib/datadog_api_client/v2/models/list_personal_access_tokens_response.rb new file mode 100644 index 000000000000..218f900b00d2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_personal_access_tokens_response.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for a list of personal access tokens. + class ListPersonalAccessTokensResponse + include BaseGenericModel + + # Array of personal access tokens. + attr_accessor :data + + # Additional information related to the personal access token response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'PersonalAccessTokenResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ListPersonalAccessTokensResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token.rb b/lib/datadog_api_client/v2/models/personal_access_token.rb new file mode 100644 index 000000000000..151ec2c1cc04 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Datadog personal access token. + class PersonalAccessToken + include BaseGenericModel + + # Attributes of a personal access token. + attr_accessor :attributes + + # ID of the personal access token. + attr_accessor :id + + # Resources related to the personal access token. + attr_accessor :relationships + + # Personal access tokens resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PersonalAccessTokenAttributes', + :'id' => :'String', + :'relationships' => :'PersonalAccessTokenRelationships', + :'type' => :'PersonalAccessTokensType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessToken` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb b/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb new file mode 100644 index 000000000000..9c37240ff32e --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_attributes.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a personal access token. + class PersonalAccessTokenAttributes + include BaseGenericModel + + # The alias (short identifier) of the personal access token. + attr_accessor :_alias + + # Creation date of the personal access token. + attr_accessor :created_at + + # Expiration date of the personal access token. + attr_accessor :expires_at + + # Date the personal access token was last used. + attr_accessor :last_used_at + + # Date of last modification of the personal access token. + attr_accessor :modified_at + + # Name of the personal access token. + attr_accessor :name + + # The public portion of the personal access token. + attr_accessor :public_portion + + # Array of scopes granted to the personal access token. + attr_accessor :scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'created_at' => :'Time', + :'expires_at' => :'Time', + :'last_used_at' => :'Time', + :'modified_at' => :'Time', + :'name' => :'String', + :'public_portion' => :'String', + :'scopes' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'last_used_at', + :'modified_at', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'last_used_at') + self.last_used_at = attributes[:'last_used_at'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'public_portion') + self.public_portion = attributes[:'public_portion'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + created_at == o.created_at && + expires_at == o.expires_at && + last_used_at == o.last_used_at && + modified_at == o.modified_at && + name == o.name && + public_portion == o.public_portion && + scopes == o.scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, created_at, expires_at, last_used_at, modified_at, name, public_portion, scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_create_attributes.rb b/lib/datadog_api_client/v2/models/personal_access_token_create_attributes.rb new file mode 100644 index 000000000000..958007508550 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_create_attributes.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes used to create a personal access token. + class PersonalAccessTokenCreateAttributes + include BaseGenericModel + + # Expiration date of the personal access token. Must be at least 24 hours in the future. + attr_reader :expires_at + + # Name of the personal access token. + attr_reader :name + + # Array of scopes to grant the personal access token. + attr_reader :scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'expires_at' => :'expires_at', + :'name' => :'name', + :'scopes' => :'scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'expires_at' => :'Time', + :'name' => :'String', + :'scopes' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @expires_at.nil? + return false if @name.nil? + return false if @scopes.nil? + true + end + + # Custom attribute writer method with validation + # @param expires_at [Object] Object to be assigned + # @!visibility private + def expires_at=(expires_at) + if expires_at.nil? + fail ArgumentError, 'invalid value for "expires_at", expires_at cannot be nil.' + end + @expires_at = expires_at + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param scopes [Object] Object to be assigned + # @!visibility private + def scopes=(scopes) + if scopes.nil? + fail ArgumentError, 'invalid value for "scopes", scopes cannot be nil.' + end + @scopes = scopes + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expires_at == o.expires_at && + name == o.name && + scopes == o.scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [expires_at, name, scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_create_data.rb b/lib/datadog_api_client/v2/models/personal_access_token_create_data.rb new file mode 100644 index 000000000000..6e7d592556f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object used to create a personal access token. + class PersonalAccessTokenCreateData + include BaseGenericModel + + # Attributes used to create a personal access token. + attr_reader :attributes + + # Personal access tokens resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PersonalAccessTokenCreateAttributes', + :'type' => :'PersonalAccessTokensType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_create_request.rb b/lib/datadog_api_client/v2/models/personal_access_token_create_request.rb new file mode 100644 index 000000000000..10b79afa22b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request used to create a personal access token. + class PersonalAccessTokenCreateRequest + include BaseGenericModel + + # Object used to create a personal access token. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PersonalAccessTokenCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_create_response.rb b/lib/datadog_api_client/v2/models/personal_access_token_create_response.rb new file mode 100644 index 000000000000..5b9c0c212995 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_create_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for creating a personal access token. Includes the token key. + class PersonalAccessTokenCreateResponse + include BaseGenericModel + + # Datadog personal access token, including the token key. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FullPersonalAccessToken' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenCreateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_relationships.rb b/lib/datadog_api_client/v2/models/personal_access_token_relationships.rb new file mode 100644 index 000000000000..ec8646ae7c67 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_relationships.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resources related to the personal access token. + class PersonalAccessTokenRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :owned_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'owned_by' => :'owned_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'owned_by' => :'RelationshipToUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'owned_by') + self.owned_by = attributes[:'owned_by'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + owned_by == o.owned_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [owned_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_response.rb b/lib/datadog_api_client/v2/models/personal_access_token_response.rb new file mode 100644 index 000000000000..f69c91c6f4fe --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response for retrieving a personal access token. + class PersonalAccessTokenResponse + include BaseGenericModel + + # Datadog personal access token. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PersonalAccessToken' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_response_meta.rb b/lib/datadog_api_client/v2/models/personal_access_token_response_meta.rb new file mode 100644 index 000000000000..aca323882cb1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_response_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Additional information related to the personal access token response. + class PersonalAccessTokenResponseMeta + include BaseGenericModel + + # Pagination information. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'PersonalAccessTokenResponseMetaPage' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_response_meta_page.rb b/lib/datadog_api_client/v2/models/personal_access_token_response_meta_page.rb new file mode 100644 index 000000000000..2a32411dcefc --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_response_meta_page.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination information. + class PersonalAccessTokenResponseMetaPage + include BaseGenericModel + + # Total filtered personal access token count. + attr_accessor :total_filtered_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_filtered_count' => :'total_filtered_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_filtered_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenResponseMetaPage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_filtered_count') + self.total_filtered_count = attributes[:'total_filtered_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_filtered_count == o.total_filtered_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_filtered_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_update_attributes.rb b/lib/datadog_api_client/v2/models/personal_access_token_update_attributes.rb new file mode 100644 index 000000000000..ea1b1d559175 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_update_attributes.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes used to update a personal access token. + class PersonalAccessTokenUpdateAttributes + include BaseGenericModel + + # Name of the personal access token. + attr_accessor :name + + # Array of scopes to grant the personal access token. + attr_accessor :scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'scopes' => :'scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'scopes' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + scopes == o.scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_update_data.rb b/lib/datadog_api_client/v2/models/personal_access_token_update_data.rb new file mode 100644 index 000000000000..9d6cfcf4b18d --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_update_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object used to update a personal access token. + class PersonalAccessTokenUpdateData + include BaseGenericModel + + # Attributes used to update a personal access token. + attr_reader :attributes + + # ID of the personal access token. + attr_reader :id + + # Personal access tokens resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PersonalAccessTokenUpdateAttributes', + :'id' => :'String', + :'type' => :'PersonalAccessTokensType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_token_update_request.rb b/lib/datadog_api_client/v2/models/personal_access_token_update_request.rb new file mode 100644 index 000000000000..fce3a5f9b6e0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_token_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request used to update a personal access token. + class PersonalAccessTokenUpdateRequest + include BaseGenericModel + + # Object used to update a personal access token. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PersonalAccessTokenUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::PersonalAccessTokenUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_tokens_sort.rb b/lib/datadog_api_client/v2/models/personal_access_tokens_sort.rb new file mode 100644 index 000000000000..f5fc8de5f111 --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_tokens_sort.rb @@ -0,0 +1,31 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Sorting options + class PersonalAccessTokensSort + include BaseEnumModel + + NAME_ASCENDING = "name".freeze + NAME_DESCENDING = "-name".freeze + CREATED_AT_ASCENDING = "created_at".freeze + CREATED_AT_DESCENDING = "-created_at".freeze + EXPIRES_AT_ASCENDING = "expires_at".freeze + EXPIRES_AT_DESCENDING = "-expires_at".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/personal_access_tokens_type.rb b/lib/datadog_api_client/v2/models/personal_access_tokens_type.rb new file mode 100644 index 000000000000..d045e1dd492b --- /dev/null +++ b/lib/datadog_api_client/v2/models/personal_access_tokens_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Personal access tokens resource type. + class PersonalAccessTokensType + include BaseEnumModel + + PERSONAL_ACCESS_TOKENS = "personal_access_tokens".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/service_account_access_token_create_attributes.rb b/lib/datadog_api_client/v2/models/service_account_access_token_create_attributes.rb new file mode 100644 index 000000000000..e2730fa67e17 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_account_access_token_create_attributes.rb @@ -0,0 +1,156 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes used to create a service account access token. + class ServiceAccountAccessTokenCreateAttributes + include BaseGenericModel + + # Expiration date of the access token. Optional for service account tokens. + attr_accessor :expires_at + + # Name of the access token. + attr_reader :name + + # Array of scopes to grant the access token. + attr_reader :scopes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'expires_at' => :'expires_at', + :'name' => :'name', + :'scopes' => :'scopes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'expires_at' => :'Time', + :'name' => :'String', + :'scopes' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccountAccessTokenCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'expires_at') + self.expires_at = attributes[:'expires_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'scopes') + if (value = attributes[:'scopes']).is_a?(Array) + self.scopes = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @scopes.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param scopes [Object] Object to be assigned + # @!visibility private + def scopes=(scopes) + if scopes.nil? + fail ArgumentError, 'invalid value for "scopes", scopes cannot be nil.' + end + @scopes = scopes + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expires_at == o.expires_at && + name == o.name && + scopes == o.scopes && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [expires_at, name, scopes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_account_access_token_create_data.rb b/lib/datadog_api_client/v2/models/service_account_access_token_create_data.rb new file mode 100644 index 000000000000..c0c45b75bae7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_account_access_token_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object used to create a service account access token. + class ServiceAccountAccessTokenCreateData + include BaseGenericModel + + # Attributes used to create a service account access token. + attr_reader :attributes + + # Personal access tokens resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ServiceAccountAccessTokenCreateAttributes', + :'type' => :'PersonalAccessTokensType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccountAccessTokenCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/service_account_access_token_create_request.rb b/lib/datadog_api_client/v2/models/service_account_access_token_create_request.rb new file mode 100644 index 000000000000..b155eb7c7ec6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/service_account_access_token_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request used to create a service account access token. + class ServiceAccountAccessTokenCreateRequest + include BaseGenericModel + + # Object used to create a service account access token. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ServiceAccountAccessTokenCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ServiceAccountAccessTokenCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end