diff --git a/.apigentools-info b/.apigentools-info index 8e514ce342..8ff9354980 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-18 13:32:33.091008", - "spec_repo_commit": "5e49afe1" + "regenerated": "2025-06-18 20:18:16.733968", + "spec_repo_commit": "c4868535" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-18 13:32:33.105798", - "spec_repo_commit": "5e49afe1" + "regenerated": "2025-06-18 20:18:16.782233", + "spec_repo_commit": "c4868535" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c24700d9c6..a564c7133b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -127,6 +127,13 @@ components: required: true schema: type: string + ApplicationKeyId: + description: The ID of the app key + in: path + name: app_key_id + required: true + schema: + type: string ApplicationKeyIncludeParameter: description: Resource path for related resources to include in the response. Only `owned_by` is supported. @@ -2367,6 +2374,27 @@ components: type: string x-enum-varnames: - DEPLOYMENT + AppKeyRegistrationData: + description: Data related to the app key registration. + properties: + id: + description: The app key registration identifier + format: uuid + readOnly: true + type: string + type: + $ref: '#/components/schemas/AppKeyRegistrationDataType' + required: + - type + type: object + AppKeyRegistrationDataType: + description: The definition of `AppKeyRegistrationDataType` object. + enum: + - app_key_registration + example: app_key_registration + type: string + x-enum-varnames: + - APP_KEY_REGISTRATION AppMeta: description: Metadata of an app. properties: @@ -15900,6 +15928,12 @@ components: data: $ref: '#/components/schemas/ActionConnectionData' type: object + GetAppKeyRegistrationResponse: + description: The response object after getting an app key registration. + properties: + data: + $ref: '#/components/schemas/AppKeyRegistrationData' + type: object GetAppResponse: description: The full app definition response object. properties: @@ -19678,6 +19712,32 @@ components: format: int64 type: integer type: object + ListAppKeyRegistrationsResponse: + description: A paginated list of app key registrations. + properties: + data: + description: An array of app key registrations. + items: + $ref: '#/components/schemas/AppKeyRegistrationData' + type: array + meta: + $ref: '#/components/schemas/ListAppKeyRegistrationsResponseMeta' + type: object + ListAppKeyRegistrationsResponseMeta: + description: The definition of `ListAppKeyRegistrationsResponseMeta` object. + properties: + total: + description: The total number of app key registrations. + example: 1 + format: int64 + type: integer + total_filtered: + description: The total number of app key registrations that match the specified + filters. + example: 1 + format: int64 + type: integer + type: object ListApplicationKeysResponse: description: Response for a list of application keys. properties: @@ -29315,6 +29375,12 @@ components: x-enum-varnames: - ANY - ALL + RegisterAppKeyResponse: + description: The response object after creating an app key registration. + properties: + data: + $ref: '#/components/schemas/AppKeyRegistrationData' + type: object RelationAttributes: description: Relation attributes. properties: @@ -41344,9 +41410,185 @@ info: version: '1.0' openapi: 3.0.0 paths: + /api/v2/actions/app_key_registrations: + get: + description: List App Key Registrations + operationId: ListAppKeyRegistrations + parameters: + - description: The number of App Key Registrations to return per page. + in: query + name: page[size] + required: false + schema: + format: int64 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + format: int64 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListAppKeyRegistrationsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + summary: List App Key Registrations + tags: + - Action Connection + x-permission: + operator: OR + permissions: + - org_app_keys_read + /api/v2/actions/app_key_registrations/{app_key_id}: + delete: + description: Unregister an App Key + operationId: UnregisterAppKey + parameters: + - $ref: '#/components/parameters/ApplicationKeyId' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + summary: Unregister an App Key + tags: + - Action Connection + x-permission: + operator: OR + permissions: + - user_access_manage + - user_app_keys + - service_account_write + get: + description: Get an existing App Key Registration + operationId: GetAppKeyRegistration + parameters: + - $ref: '#/components/parameters/ApplicationKeyId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GetAppKeyRegistrationResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + summary: Get an existing App Key Registration + tags: + - Action Connection + x-permission: + operator: OR + permissions: + - org_app_keys_read + put: + description: Register a new App Key + operationId: RegisterAppKey + parameters: + - $ref: '#/components/parameters/ApplicationKeyId' + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/RegisterAppKeyResponse' + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + summary: Register a new App Key + tags: + - Action Connection + x-permission: + operator: OR + permissions: + - user_access_manage + - user_app_keys + - service_account_write /api/v2/actions/connections: post: - description: Create a new Action Connection + description: Create a new Action Connection. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CreateActionConnection requestBody: content: @@ -41384,7 +41626,8 @@ paths: - Action Connection /api/v2/actions/connections/{connection_id}: delete: - description: Delete an existing Action Connection + description: Delete an existing Action Connection. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: DeleteActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -41417,7 +41660,8 @@ paths: permissions: - connection_write get: - description: Get an existing Action Connection + description: Get an existing Action Connection. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: GetActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -41456,7 +41700,8 @@ paths: tags: - Action Connection patch: - description: Update an existing Action Connection + description: Update an existing Action Connection. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: UpdateActionConnection parameters: - $ref: '#/components/parameters/ConnectionId' @@ -42486,6 +42731,7 @@ paths: /api/v2/app-builder/apps: delete: description: Delete multiple apps in a single request from a list of app IDs. + This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: DeleteApps requestBody: content: @@ -42530,7 +42776,8 @@ paths: get: description: List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description - is returned by this endpoint. + is returned by this endpoint. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: ListApps parameters: - description: The number of apps to return per page. @@ -42636,7 +42883,8 @@ paths: permissions: - apps_run post: - description: Create a new app, returning the app ID. + description: Create a new app, returning the app ID. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CreateApp requestBody: content: @@ -42676,7 +42924,8 @@ paths: - workflows_run /api/v2/app-builder/apps/{app_id}: delete: - description: Delete a single app. + description: Delete a single app. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: DeleteApp parameters: - description: The ID of the app to delete. @@ -42728,7 +42977,8 @@ paths: permissions: - apps_write get: - description: Get the full definition of an app. + description: Get the full definition of an app. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: GetApp parameters: - description: The ID of the app to retrieve. @@ -42791,6 +43041,7 @@ paths: - connections_read patch: description: Update an existing app. This creates a new version of the app. + This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: UpdateApp parameters: - description: The ID of the app to update. @@ -42842,7 +43093,8 @@ paths: description: Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a `deployment` object on the app, with a nil `app_version_id` (`00000000-0000-0000-0000-000000000000`). The app can still be updated and - published again in the future. + published again in the future. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: UnpublishApp parameters: - description: The ID of the app to unpublish. @@ -42890,7 +43142,8 @@ paths: post: description: Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a [Restriction Policy](https://docs.datadoghq.com/api/latest/restriction-policies/) - on the app if a policy does not yet exist. + on the app if a policy does not yet exist. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: PublishApp parameters: - description: The ID of the app to publish. @@ -62776,7 +63029,7 @@ paths: /api/v2/workflows: post: description: Create a new workflow, returning the workflow ID. This API requires - an application key scoped with the `workflows_write` permission. + a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CreateWorkflow requestBody: content: @@ -62818,8 +63071,8 @@ paths: - workflows_write /api/v2/workflows/{workflow_id}: delete: - description: Delete a workflow by ID. This API requires an application key scoped - with the `workflows_write` permission. + description: Delete a workflow by ID. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: DeleteWorkflow parameters: - $ref: '#/components/parameters/WorkflowId' @@ -62852,8 +63105,8 @@ paths: permissions: - workflows_write get: - description: Get a workflow by ID. This API requires an application key scoped - with the `workflows_read` permission. + description: Get a workflow by ID. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: GetWorkflow parameters: - $ref: '#/components/parameters/WorkflowId' @@ -62896,8 +63149,8 @@ paths: permissions: - workflows_read patch: - description: Update a workflow by ID. This API requires an application key scoped - with the `workflows_write` permission. + description: Update a workflow by ID. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: UpdateWorkflow parameters: - $ref: '#/components/parameters/WorkflowId' @@ -62947,8 +63200,8 @@ paths: - workflows_write /api/v2/workflows/{workflow_id}/instances: get: - description: List all instances of a given workflow. This API requires an application - key scoped with the workflows_read permission. + description: List all instances of a given workflow. This API requires a [registered + application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: ListWorkflowInstances parameters: - $ref: '#/components/parameters/WorkflowId' @@ -62980,8 +63233,8 @@ paths: permissions: - workflows_read post: - description: Execute the given workflow. This API requires an application key - scoped with the workflows_run permission. + description: Execute the given workflow. This API requires a [registered application + key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CreateWorkflowInstance parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63020,7 +63273,7 @@ paths: /api/v2/workflows/{workflow_id}/instances/{instance_id}: get: description: Get a specific execution of a given workflow. This API requires - an application key scoped with the workflows_read permission. + a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: GetWorkflowInstance parameters: - $ref: '#/components/parameters/WorkflowId' @@ -63055,7 +63308,7 @@ paths: /api/v2/workflows/{workflow_id}/instances/{instance_id}/cancel: put: description: Cancels a specific execution of a given workflow. This API requires - an application key scoped with the workflows_run permission. + a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). operationId: CancelWorkflowInstance parameters: - $ref: '#/components/parameters/WorkflowId' diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index dc67406f4d..db6abb114a 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -410,6 +410,20 @@ datadog\_api\_client.v2.model.app\_deployment\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.app\_key\_registration\_data module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.app_key_registration_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.app\_key\_registration\_data\_type module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.app_key_registration_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.app\_meta module ---------------------------------------------- @@ -6521,6 +6535,13 @@ datadog\_api\_client.v2.model.get\_action\_connection\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.get\_app\_key\_registration\_response module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.get_app_key_registration_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.get\_app\_response module ------------------------------------------------------- @@ -8194,6 +8215,20 @@ datadog\_api\_client.v2.model.list\_apis\_response\_meta\_pagination module :members: :show-inheritance: +datadog\_api\_client.v2.model.list\_app\_key\_registrations\_response module +---------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_app_key_registrations_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.list\_app\_key\_registrations\_response\_meta module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.list_app_key_registrations_response_meta + :members: + :show-inheritance: + datadog\_api\_client.v2.model.list\_application\_keys\_response module ---------------------------------------------------------------------- @@ -12282,6 +12317,13 @@ datadog\_api\_client.v2.model.readiness\_gate\_threshold\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.register\_app\_key\_response module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.register_app_key_response + :members: + :show-inheritance: + datadog\_api\_client.v2.model.relation\_attributes module --------------------------------------------------------- diff --git a/examples/v2/action-connection/GetAppKeyRegistration.py b/examples/v2/action-connection/GetAppKeyRegistration.py new file mode 100644 index 0000000000..648ba62a3c --- /dev/null +++ b/examples/v2/action-connection/GetAppKeyRegistration.py @@ -0,0 +1,15 @@ +""" +Get an existing App Key Registration returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionConnectionApi(api_client) + response = api_instance.get_app_key_registration( + app_key_id="b7feea52-994e-4714-a100-1bd9eff5aee1", + ) + + print(response) diff --git a/examples/v2/action-connection/ListAppKeyRegistrations.py b/examples/v2/action-connection/ListAppKeyRegistrations.py new file mode 100644 index 0000000000..b667a67fbd --- /dev/null +++ b/examples/v2/action-connection/ListAppKeyRegistrations.py @@ -0,0 +1,13 @@ +""" +List App Key Registrations returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionConnectionApi(api_client) + response = api_instance.list_app_key_registrations() + + print(response) diff --git a/examples/v2/action-connection/RegisterAppKey.py b/examples/v2/action-connection/RegisterAppKey.py new file mode 100644 index 0000000000..831f10f58d --- /dev/null +++ b/examples/v2/action-connection/RegisterAppKey.py @@ -0,0 +1,15 @@ +""" +Register a new App Key returns "Created" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionConnectionApi(api_client) + response = api_instance.register_app_key( + app_key_id="b7feea52-994e-4714-a100-1bd9eff5aee1", + ) + + print(response) diff --git a/examples/v2/action-connection/UnregisterAppKey.py b/examples/v2/action-connection/UnregisterAppKey.py new file mode 100644 index 0000000000..48ee8f4ac5 --- /dev/null +++ b/examples/v2/action-connection/UnregisterAppKey.py @@ -0,0 +1,13 @@ +""" +Unregister an App Key returns "No Content" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.action_connection_api import ActionConnectionApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ActionConnectionApi(api_client) + api_instance.unregister_app_key( + app_key_id="57cc69ae-9214-4ecc-8df8-43ecc1d92d99", + ) diff --git a/src/datadog_api_client/v2/api/action_connection_api.py b/src/datadog_api_client/v2/api/action_connection_api.py index 5069f60efa..d25ec0a1c5 100644 --- a/src/datadog_api_client/v2/api/action_connection_api.py +++ b/src/datadog_api_client/v2/api/action_connection_api.py @@ -3,10 +3,17 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Any, Dict +from typing import Any, Dict, Union from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UnsetType, + unset, +) +from datadog_api_client.v2.model.list_app_key_registrations_response import ListAppKeyRegistrationsResponse +from datadog_api_client.v2.model.get_app_key_registration_response import GetAppKeyRegistrationResponse +from datadog_api_client.v2.model.register_app_key_response import RegisterAppKeyResponse from datadog_api_client.v2.model.create_action_connection_response import CreateActionConnectionResponse from datadog_api_client.v2.model.create_action_connection_request import CreateActionConnectionRequest from datadog_api_client.v2.model.get_action_connection_response import GetActionConnectionResponse @@ -97,6 +104,102 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._get_app_key_registration_endpoint = _Endpoint( + settings={ + "response_type": (GetAppKeyRegistrationResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions/app_key_registrations/{app_key_id}", + "operation_id": "get_app_key_registration", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "app_key_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_key_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._list_app_key_registrations_endpoint = _Endpoint( + settings={ + "response_type": (ListAppKeyRegistrationsResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions/app_key_registrations", + "operation_id": "list_app_key_registrations", + "http_method": "GET", + "version": "v2", + }, + params_map={ + "page_size": { + "openapi_types": (int,), + "attribute": "page[size]", + "location": "query", + }, + "page_number": { + "openapi_types": (int,), + "attribute": "page[number]", + "location": "query", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._register_app_key_endpoint = _Endpoint( + settings={ + "response_type": (RegisterAppKeyResponse,), + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions/app_key_registrations/{app_key_id}", + "operation_id": "register_app_key", + "http_method": "PUT", + "version": "v2", + }, + params_map={ + "app_key_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_key_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._unregister_app_key_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth"], + "endpoint_path": "/api/v2/actions/app_key_registrations/{app_key_id}", + "operation_id": "unregister_app_key", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "app_key_id": { + "required": True, + "openapi_types": (str,), + "attribute": "app_key_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + self._update_action_connection_endpoint = _Endpoint( settings={ "response_type": (UpdateActionConnectionResponse,), @@ -129,7 +232,7 @@ def create_action_connection( ) -> CreateActionConnectionResponse: """Create a new Action Connection. - Create a new Action Connection + Create a new Action Connection. This API requires a `registered application key `_. :type body: CreateActionConnectionRequest :rtype: CreateActionConnectionResponse @@ -145,7 +248,7 @@ def delete_action_connection( ) -> None: """Delete an existing Action Connection. - Delete an existing Action Connection + Delete an existing Action Connection. This API requires a `registered application key `_. :param connection_id: The ID of the action connection :type connection_id: str @@ -162,7 +265,7 @@ def get_action_connection( ) -> GetActionConnectionResponse: """Get an existing Action Connection. - Get an existing Action Connection + Get an existing Action Connection. This API requires a `registered application key `_. :param connection_id: The ID of the action connection :type connection_id: str @@ -173,6 +276,82 @@ def get_action_connection( return self._get_action_connection_endpoint.call_with_http_info(**kwargs) + def get_app_key_registration( + self, + app_key_id: str, + ) -> GetAppKeyRegistrationResponse: + """Get an existing App Key Registration. + + Get an existing App Key Registration + + :param app_key_id: The ID of the app key + :type app_key_id: str + :rtype: GetAppKeyRegistrationResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["app_key_id"] = app_key_id + + return self._get_app_key_registration_endpoint.call_with_http_info(**kwargs) + + def list_app_key_registrations( + self, + *, + page_size: Union[int, UnsetType] = unset, + page_number: Union[int, UnsetType] = unset, + ) -> ListAppKeyRegistrationsResponse: + """List App Key Registrations. + + List App Key Registrations + + :param page_size: The number of App Key Registrations to return per page. + :type page_size: int, optional + :param page_number: The page number to return. + :type page_number: int, optional + :rtype: ListAppKeyRegistrationsResponse + """ + kwargs: Dict[str, Any] = {} + if page_size is not unset: + kwargs["page_size"] = page_size + + if page_number is not unset: + kwargs["page_number"] = page_number + + return self._list_app_key_registrations_endpoint.call_with_http_info(**kwargs) + + def register_app_key( + self, + app_key_id: str, + ) -> RegisterAppKeyResponse: + """Register a new App Key. + + Register a new App Key + + :param app_key_id: The ID of the app key + :type app_key_id: str + :rtype: RegisterAppKeyResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["app_key_id"] = app_key_id + + return self._register_app_key_endpoint.call_with_http_info(**kwargs) + + def unregister_app_key( + self, + app_key_id: str, + ) -> None: + """Unregister an App Key. + + Unregister an App Key + + :param app_key_id: The ID of the app key + :type app_key_id: str + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["app_key_id"] = app_key_id + + return self._unregister_app_key_endpoint.call_with_http_info(**kwargs) + def update_action_connection( self, connection_id: str, @@ -180,7 +359,7 @@ def update_action_connection( ) -> UpdateActionConnectionResponse: """Update an existing Action Connection. - Update an existing Action Connection + Update an existing Action Connection. This API requires a `registered application key `_. :param connection_id: The ID of the action connection :type connection_id: str diff --git a/src/datadog_api_client/v2/api/app_builder_api.py b/src/datadog_api_client/v2/api/app_builder_api.py index 9fdeba8e5b..38ebb2d04e 100644 --- a/src/datadog_api_client/v2/api/app_builder_api.py +++ b/src/datadog_api_client/v2/api/app_builder_api.py @@ -278,7 +278,7 @@ def create_app( ) -> CreateAppResponse: """Create App. - Create a new app, returning the app ID. + Create a new app, returning the app ID. This API requires a `registered application key `_. :type body: CreateAppRequest :rtype: CreateAppResponse @@ -294,7 +294,7 @@ def delete_app( ) -> DeleteAppResponse: """Delete App. - Delete a single app. + Delete a single app. This API requires a `registered application key `_. :param app_id: The ID of the app to delete. :type app_id: UUID @@ -311,7 +311,7 @@ def delete_apps( ) -> DeleteAppsResponse: """Delete Multiple Apps. - Delete multiple apps in a single request from a list of app IDs. + Delete multiple apps in a single request from a list of app IDs. This API requires a `registered application key `_. :type body: DeleteAppsRequest :rtype: DeleteAppsResponse @@ -329,7 +329,7 @@ def get_app( ) -> GetAppResponse: """Get App. - Get the full definition of an app. + Get the full definition of an app. This API requires a `registered application key `_. :param app_id: The ID of the app to retrieve. :type app_id: UUID @@ -362,7 +362,7 @@ def list_apps( ) -> ListAppsResponse: """List Apps. - List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description is returned by this endpoint. + List all apps, with optional filters and sorting. This endpoint is paginated. Only basic app information such as the app ID, name, and description is returned by this endpoint. This API requires a `registered application key `_. :param limit: The number of apps to return per page. :type limit: int, optional @@ -430,7 +430,7 @@ def publish_app( ) -> PublishAppResponse: """Publish App. - Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a `Restriction Policy `_ on the app if a policy does not yet exist. + Publish an app for use by other users. To ensure the app is accessible to the correct users, you also need to set a `Restriction Policy `_ on the app if a policy does not yet exist. This API requires a `registered application key `_. :param app_id: The ID of the app to publish. :type app_id: UUID @@ -447,7 +447,7 @@ def unpublish_app( ) -> UnpublishAppResponse: """Unpublish App. - Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a ``deployment`` object on the app, with a nil ``app_version_id`` ( ``00000000-0000-0000-0000-000000000000`` ). The app can still be updated and published again in the future. + Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a ``deployment`` object on the app, with a nil ``app_version_id`` ( ``00000000-0000-0000-0000-000000000000`` ). The app can still be updated and published again in the future. This API requires a `registered application key `_. :param app_id: The ID of the app to unpublish. :type app_id: UUID @@ -465,7 +465,7 @@ def update_app( ) -> UpdateAppResponse: """Update App. - Update an existing app. This creates a new version of the app. + Update an existing app. This creates a new version of the app. This API requires a `registered application key `_. :param app_id: The ID of the app to update. :type app_id: UUID diff --git a/src/datadog_api_client/v2/api/workflow_automation_api.py b/src/datadog_api_client/v2/api/workflow_automation_api.py index 6174536c67..365ae8f823 100644 --- a/src/datadog_api_client/v2/api/workflow_automation_api.py +++ b/src/datadog_api_client/v2/api/workflow_automation_api.py @@ -249,7 +249,7 @@ def cancel_workflow_instance( ) -> WorklflowCancelInstanceResponse: """Cancel a workflow instance. - Cancels a specific execution of a given workflow. This API requires an application key scoped with the workflows_run permission. + Cancels a specific execution of a given workflow. This API requires a `registered application key `_. :param workflow_id: The ID of the workflow. :type workflow_id: str @@ -270,7 +270,7 @@ def create_workflow( ) -> CreateWorkflowResponse: """Create a Workflow. - Create a new workflow, returning the workflow ID. This API requires an application key scoped with the ``workflows_write`` permission. + Create a new workflow, returning the workflow ID. This API requires a `registered application key `_. :type body: CreateWorkflowRequest :rtype: CreateWorkflowResponse @@ -287,7 +287,7 @@ def create_workflow_instance( ) -> WorkflowInstanceCreateResponse: """Execute a workflow. - Execute the given workflow. This API requires an application key scoped with the workflows_run permission. + Execute the given workflow. This API requires a `registered application key `_. :param workflow_id: The ID of the workflow. :type workflow_id: str @@ -307,7 +307,7 @@ def delete_workflow( ) -> None: """Delete an existing Workflow. - Delete a workflow by ID. This API requires an application key scoped with the ``workflows_write`` permission. + Delete a workflow by ID. This API requires a `registered application key `_. :param workflow_id: The ID of the workflow. :type workflow_id: str @@ -324,7 +324,7 @@ def get_workflow( ) -> GetWorkflowResponse: """Get an existing Workflow. - Get a workflow by ID. This API requires an application key scoped with the ``workflows_read`` permission. + Get a workflow by ID. This API requires a `registered application key `_. :param workflow_id: The ID of the workflow. :type workflow_id: str @@ -342,7 +342,7 @@ def get_workflow_instance( ) -> WorklflowGetInstanceResponse: """Get a workflow instance. - Get a specific execution of a given workflow. This API requires an application key scoped with the workflows_read permission. + Get a specific execution of a given workflow. This API requires a `registered application key `_. :param workflow_id: The ID of the workflow. :type workflow_id: str @@ -366,7 +366,7 @@ def list_workflow_instances( ) -> WorkflowListInstancesResponse: """List workflow instances. - List all instances of a given workflow. This API requires an application key scoped with the workflows_read permission. + List all instances of a given workflow. This API requires a `registered application key `_. :param workflow_id: The ID of the workflow. :type workflow_id: str @@ -394,7 +394,7 @@ def update_workflow( ) -> UpdateWorkflowResponse: """Update an existing Workflow. - Update a workflow by ID. This API requires an application key scoped with the ``workflows_write`` permission. + Update a workflow by ID. This API requires a `registered application key `_. :param workflow_id: The ID of the workflow. :type workflow_id: str diff --git a/src/datadog_api_client/v2/model/app_key_registration_data.py b/src/datadog_api_client/v2/model/app_key_registration_data.py new file mode 100644 index 0000000000..e0bf89be38 --- /dev/null +++ b/src/datadog_api_client/v2/model/app_key_registration_data.py @@ -0,0 +1,53 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.app_key_registration_data_type import AppKeyRegistrationDataType + + +class AppKeyRegistrationData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.app_key_registration_data_type import AppKeyRegistrationDataType + + return { + "id": (UUID,), + "type": (AppKeyRegistrationDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + read_only_vars = { + "id", + } + + def __init__(self_, type: AppKeyRegistrationDataType, id: Union[UUID, UnsetType] = unset, **kwargs): + """ + Data related to the app key registration. + + :param id: The app key registration identifier + :type id: UUID, optional + + :param type: The definition of ``AppKeyRegistrationDataType`` object. + :type type: AppKeyRegistrationDataType + """ + if id is not unset: + kwargs["id"] = id + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/app_key_registration_data_type.py b/src/datadog_api_client/v2/model/app_key_registration_data_type.py new file mode 100644 index 0000000000..7804ef499a --- /dev/null +++ b/src/datadog_api_client/v2/model/app_key_registration_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class AppKeyRegistrationDataType(ModelSimple): + """ + The definition of `AppKeyRegistrationDataType` object. + + :param value: If omitted defaults to "app_key_registration". Must be one of ["app_key_registration"]. + :type value: str + """ + + allowed_values = { + "app_key_registration", + } + APP_KEY_REGISTRATION: ClassVar["AppKeyRegistrationDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +AppKeyRegistrationDataType.APP_KEY_REGISTRATION = AppKeyRegistrationDataType("app_key_registration") diff --git a/src/datadog_api_client/v2/model/get_app_key_registration_response.py b/src/datadog_api_client/v2/model/get_app_key_registration_response.py new file mode 100644 index 0000000000..d7d1e6d1cd --- /dev/null +++ b/src/datadog_api_client/v2/model/get_app_key_registration_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.app_key_registration_data import AppKeyRegistrationData + + +class GetAppKeyRegistrationResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.app_key_registration_data import AppKeyRegistrationData + + return { + "data": (AppKeyRegistrationData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[AppKeyRegistrationData, UnsetType] = unset, **kwargs): + """ + The response object after getting an app key registration. + + :param data: Data related to the app key registration. + :type data: AppKeyRegistrationData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/list_app_key_registrations_response.py b/src/datadog_api_client/v2/model/list_app_key_registrations_response.py new file mode 100644 index 0000000000..2aea8fc21f --- /dev/null +++ b/src/datadog_api_client/v2/model/list_app_key_registrations_response.py @@ -0,0 +1,58 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.app_key_registration_data import AppKeyRegistrationData + from datadog_api_client.v2.model.list_app_key_registrations_response_meta import ListAppKeyRegistrationsResponseMeta + + +class ListAppKeyRegistrationsResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.app_key_registration_data import AppKeyRegistrationData + from datadog_api_client.v2.model.list_app_key_registrations_response_meta import ( + ListAppKeyRegistrationsResponseMeta, + ) + + return { + "data": ([AppKeyRegistrationData],), + "meta": (ListAppKeyRegistrationsResponseMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__( + self_, + data: Union[List[AppKeyRegistrationData], UnsetType] = unset, + meta: Union[ListAppKeyRegistrationsResponseMeta, UnsetType] = unset, + **kwargs, + ): + """ + A paginated list of app key registrations. + + :param data: An array of app key registrations. + :type data: [AppKeyRegistrationData], optional + + :param meta: The definition of ``ListAppKeyRegistrationsResponseMeta`` object. + :type meta: ListAppKeyRegistrationsResponseMeta, optional + """ + if data is not unset: + kwargs["data"] = data + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/list_app_key_registrations_response_meta.py b/src/datadog_api_client/v2/model/list_app_key_registrations_response_meta.py new file mode 100644 index 0000000000..497c765827 --- /dev/null +++ b/src/datadog_api_client/v2/model/list_app_key_registrations_response_meta.py @@ -0,0 +1,43 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class ListAppKeyRegistrationsResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + return { + "total": (int,), + "total_filtered": (int,), + } + + attribute_map = { + "total": "total", + "total_filtered": "total_filtered", + } + + def __init__(self_, total: Union[int, UnsetType] = unset, total_filtered: Union[int, UnsetType] = unset, **kwargs): + """ + The definition of ``ListAppKeyRegistrationsResponseMeta`` object. + + :param total: The total number of app key registrations. + :type total: int, optional + + :param total_filtered: The total number of app key registrations that match the specified filters. + :type total_filtered: int, optional + """ + if total is not unset: + kwargs["total"] = total + if total_filtered is not unset: + kwargs["total_filtered"] = total_filtered + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/register_app_key_response.py b/src/datadog_api_client/v2/model/register_app_key_response.py new file mode 100644 index 0000000000..d1f39b4c4e --- /dev/null +++ b/src/datadog_api_client/v2/model/register_app_key_response.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.app_key_registration_data import AppKeyRegistrationData + + +class RegisterAppKeyResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.app_key_registration_data import AppKeyRegistrationData + + return { + "data": (AppKeyRegistrationData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[AppKeyRegistrationData, UnsetType] = unset, **kwargs): + """ + The response object after creating an app key registration. + + :param data: Data related to the app key registration. + :type data: AppKeyRegistrationData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index e30ae22117..3219158e69 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -103,6 +103,8 @@ from datadog_api_client.v2.model.app_builder_event_type import AppBuilderEventType from datadog_api_client.v2.model.app_definition_type import AppDefinitionType from datadog_api_client.v2.model.app_deployment_type import AppDeploymentType +from datadog_api_client.v2.model.app_key_registration_data import AppKeyRegistrationData +from datadog_api_client.v2.model.app_key_registration_data_type import AppKeyRegistrationDataType from datadog_api_client.v2.model.app_meta import AppMeta from datadog_api_client.v2.model.app_relationship import AppRelationship from datadog_api_client.v2.model.app_trigger_wrapper import AppTriggerWrapper @@ -1228,6 +1230,7 @@ from datadog_api_client.v2.model.gcp_service_account_meta import GCPServiceAccountMeta from datadog_api_client.v2.model.gcp_service_account_type import GCPServiceAccountType from datadog_api_client.v2.model.get_action_connection_response import GetActionConnectionResponse +from datadog_api_client.v2.model.get_app_key_registration_response import GetAppKeyRegistrationResponse from datadog_api_client.v2.model.get_app_response import GetAppResponse from datadog_api_client.v2.model.get_app_response_data import GetAppResponseData from datadog_api_client.v2.model.get_app_response_data_attributes import GetAppResponseDataAttributes @@ -1503,6 +1506,8 @@ from datadog_api_client.v2.model.list_apis_response_data_attributes import ListAPIsResponseDataAttributes from datadog_api_client.v2.model.list_apis_response_meta import ListAPIsResponseMeta from datadog_api_client.v2.model.list_apis_response_meta_pagination import ListAPIsResponseMetaPagination +from datadog_api_client.v2.model.list_app_key_registrations_response import ListAppKeyRegistrationsResponse +from datadog_api_client.v2.model.list_app_key_registrations_response_meta import ListAppKeyRegistrationsResponseMeta from datadog_api_client.v2.model.list_application_keys_response import ListApplicationKeysResponse from datadog_api_client.v2.model.list_apps_response import ListAppsResponse from datadog_api_client.v2.model.list_apps_response_data_items import ListAppsResponseDataItems @@ -2513,6 +2518,7 @@ from datadog_api_client.v2.model.rum_warning import RUMWarning from datadog_api_client.v2.model.readiness_gate import ReadinessGate from datadog_api_client.v2.model.readiness_gate_threshold_type import ReadinessGateThresholdType +from datadog_api_client.v2.model.register_app_key_response import RegisterAppKeyResponse from datadog_api_client.v2.model.relation_attributes import RelationAttributes from datadog_api_client.v2.model.relation_entity import RelationEntity from datadog_api_client.v2.model.relation_include_type import RelationIncludeType @@ -3600,6 +3606,8 @@ "AppBuilderEventType", "AppDefinitionType", "AppDeploymentType", + "AppKeyRegistrationData", + "AppKeyRegistrationDataType", "AppMeta", "AppRelationship", "AppTriggerWrapper", @@ -4429,6 +4437,7 @@ "GCPServiceAccountMeta", "GCPServiceAccountType", "GetActionConnectionResponse", + "GetAppKeyRegistrationResponse", "GetAppResponse", "GetAppResponseData", "GetAppResponseDataAttributes", @@ -4668,6 +4677,8 @@ "ListAPIsResponseDataAttributes", "ListAPIsResponseMeta", "ListAPIsResponseMetaPagination", + "ListAppKeyRegistrationsResponse", + "ListAppKeyRegistrationsResponseMeta", "ListApplicationKeysResponse", "ListAppsResponse", "ListAppsResponseDataItems", @@ -5300,6 +5311,7 @@ "RUMWarning", "ReadinessGate", "ReadinessGateThresholdType", + "RegisterAppKeyResponse", "RelationAttributes", "RelationEntity", "RelationIncludeType", diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_bad_request_response.frozen new file mode 100644 index 0000000000..bf4ba6bc77 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-06-13T17:54:59.658Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_bad_request_response.yaml new file mode 100644 index 0000000000..3946b4f9a2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions/app_key_registrations/not_valid_app_key_id + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"appKeyId\" in \"path\"; expected type \"uuid\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_not_found_response.frozen new file mode 100644 index 0000000000..f50611d250 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-06-13T18:04:07.176Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_not_found_response.yaml new file mode 100644 index 0000000000..4cda2d37ce --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions/app_key_registrations/aaa11111-aa11-aa11-aaaa-aaaaaa111111 + response: + body: + string: '{"errors":[{"detail":"app key not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_ok_response.frozen new file mode 100644 index 0000000000..6a5bad178a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-06-13T18:04:07.258Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_ok_response.yaml new file mode 100644 index 0000000000..565cabfe75 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_get_an_existing_app_key_registration_returns_ok_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions/app_key_registrations/b7feea52-994e-4714-a100-1bd9eff5aee1 + response: + body: + string: '{"data":{"id":"b7feea52-994e-4714-a100-1bd9eff5aee1","type":"app_key_registration"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_app_key_registrations_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_app_key_registrations_returns_ok_response.frozen new file mode 100644 index 0000000000..1ecc5c9b09 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_app_key_registrations_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-06-13T18:04:07.439Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_app_key_registrations_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_app_key_registrations_returns_ok_response.yaml new file mode 100644 index 0000000000..8922d76d6c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_app_key_registrations_returns_ok_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/actions/app_key_registrations + response: + body: + string: '{"data":[{"id":"b7feea52-994e-4714-a100-1bd9eff5aee1","type":"app_key_registration"}],"meta":{"total":1,"total_filtered":1}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_bad_request_response.frozen new file mode 100644 index 0000000000..aaa15730d7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-06-13T17:55:00.012Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_bad_request_response.yaml new file mode 100644 index 0000000000..336d451d89 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/actions/app_key_registrations/not_valid_app_key_id + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"appKeyId\" in \"path\"; expected type \"uuid\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_created_response.frozen b/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_created_response.frozen new file mode 100644 index 0000000000..4b01ba1fe0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_created_response.frozen @@ -0,0 +1 @@ +2025-06-13T18:04:07.513Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_created_response.yaml b/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_created_response.yaml new file mode 100644 index 0000000000..063be45a2b --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_register_a_new_app_key_returns_created_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/actions/app_key_registrations/b7feea52-994e-4714-a100-1bd9eff5aee1 + response: + body: + string: '{"data":{"id":"b7feea52-994e-4714-a100-1bd9eff5aee1","type":"app_key_registration"}}' + headers: + content-type: + - application/vnd.api+json + status: + code: 201 + message: Created +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_bad_request_response.frozen new file mode 100644 index 0000000000..4a543730c9 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-06-13T17:55:00.202Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_bad_request_response.yaml new file mode 100644 index 0000000000..55a543cf1a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_bad_request_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions/app_key_registrations/not_valid_app_key_id + response: + body: + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"appKeyId\" in \"path\"; expected type \"uuid\""}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_not_found_response.frozen new file mode 100644 index 0000000000..d53b2da2cc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-06-13T18:04:07.614Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_not_found_response.yaml new file mode 100644 index 0000000000..2e4c7aeb08 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_unregister_an_app_key_returns_not_found_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/actions/app_key_registrations/57cc69ae-9214-4ecc-8df8-43ecc1d92d99 + response: + body: + string: '{"errors":[{"detail":"app key not found"}]}' + headers: + content-type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/features/action_connection.feature b/tests/v2/features/action_connection.feature index 3189007fbc..759615a8fd 100644 --- a/tests/v2/features/action_connection.feature +++ b/tests/v2/features/action_connection.feature @@ -64,6 +64,74 @@ Feature: Action Connection When the request is sent Then the response status is 200 Successfully get Action Connection + @team:DataDog/workflow-automation-dev + Scenario: Get an existing App Key Registration returns "Bad request" response + Given new "GetAppKeyRegistration" request + And request contains "app_key_id" parameter with value "not_valid_app_key_id" + When the request is sent + Then the response status is 400 Bad request + + @team:DataDog/workflow-automation-dev + Scenario: Get an existing App Key Registration returns "Not found" response + Given new "GetAppKeyRegistration" request + And request contains "app_key_id" parameter with value "aaa11111-aa11-aa11-aaaa-aaaaaa111111" + When the request is sent + Then the response status is 404 Not found + + @team:DataDog/workflow-automation-dev + Scenario: Get an existing App Key Registration returns "OK" response + Given new "GetAppKeyRegistration" request + And request contains "app_key_id" parameter with value "b7feea52-994e-4714-a100-1bd9eff5aee1" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/workflow-automation-dev + Scenario: List App Key Registrations returns "Bad request" response + Given new "ListAppKeyRegistrations" request + When the request is sent + Then the response status is 400 Bad request + + @team:DataDog/workflow-automation-dev + Scenario: List App Key Registrations returns "OK" response + Given new "ListAppKeyRegistrations" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/workflow-automation-dev + Scenario: Register a new App Key returns "Bad request" response + Given new "RegisterAppKey" request + And request contains "app_key_id" parameter with value "not_valid_app_key_id" + When the request is sent + Then the response status is 400 Bad request + + @team:DataDog/workflow-automation-dev + Scenario: Register a new App Key returns "Created" response + Given new "RegisterAppKey" request + And request contains "app_key_id" parameter with value "b7feea52-994e-4714-a100-1bd9eff5aee1" + When the request is sent + Then the response status is 201 Created + + @team:DataDog/workflow-automation-dev + Scenario: Unregister an App Key returns "Bad request" response + Given new "UnregisterAppKey" request + And request contains "app_key_id" parameter with value "not_valid_app_key_id" + When the request is sent + Then the response status is 400 Bad request + + @skip @team:DataDog/workflow-automation-dev + Scenario: Unregister an App Key returns "No Content" response + Given new "UnregisterAppKey" request + And request contains "app_key_id" parameter with value "57cc69ae-9214-4ecc-8df8-43ecc1d92d99" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/workflow-automation-dev + Scenario: Unregister an App Key returns "Not found" response + Given new "UnregisterAppKey" request + And request contains "app_key_id" parameter with value "57cc69ae-9214-4ecc-8df8-43ecc1d92d99" + When the request is sent + Then the response status is 404 Not found + @team:DataDog/workflow-automation-dev Scenario: Update an existing Action Connection returns "Bad Request" response Given new "UpdateActionConnection" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index e81cb7b7ce..2bb5e1ab8c 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -1,4 +1,28 @@ { + "ListAppKeyRegistrations": { + "tag": "Action Connection", + "undo": { + "type": "safe" + } + }, + "UnregisterAppKey": { + "tag": "Action Connection", + "undo": { + "type": "idempotent" + } + }, + "GetAppKeyRegistration": { + "tag": "Action Connection", + "undo": { + "type": "safe" + } + }, + "RegisterAppKey": { + "tag": "Action Connection", + "undo": { + "type": "idempotent" + } + }, "CreateActionConnection": { "tag": "Action Connection", "undo": {