From 33870a5e38f764b835d1fb9484baa119c7a4110e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 20 Nov 2025 22:12:07 +0000 Subject: [PATCH] Regenerate client from commit 5615e9c of spec repo --- .generator/schemas/v2/openapi.yaml | 149 ++++++++++++++++++ docs/datadog_api_client.v2.model.rst | 35 ++++ examples/v2/reference-tables/DeleteRows.py | 23 +++ examples/v2/reference-tables/UpsertRows.py | 30 ++++ .../v2/api/reference_tables_api.py | 96 +++++++++++ .../model/batch_delete_rows_request_array.py | 46 ++++++ .../model/batch_delete_rows_request_data.py | 46 ++++++ .../model/batch_upsert_rows_request_array.py | 46 ++++++ .../model/batch_upsert_rows_request_data.py | 67 ++++++++ ...tch_upsert_rows_request_data_attributes.py | 53 +++++++ src/datadog_api_client/v2/models/__init__.py | 10 ++ tests/v2/features/reference_tables.feature | 48 ++++++ tests/v2/features/undo.json | 14 ++ 13 files changed, 663 insertions(+) create mode 100644 examples/v2/reference-tables/DeleteRows.py create mode 100644 examples/v2/reference-tables/UpsertRows.py create mode 100644 src/datadog_api_client/v2/model/batch_delete_rows_request_array.py create mode 100644 src/datadog_api_client/v2/model/batch_delete_rows_request_data.py create mode 100644 src/datadog_api_client/v2/model/batch_upsert_rows_request_array.py create mode 100644 src/datadog_api_client/v2/model/batch_upsert_rows_request_data.py create mode 100644 src/datadog_api_client/v2/model/batch_upsert_rows_request_data_attributes.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6e4cbaacff..aba68e52a5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -6806,6 +6806,72 @@ components: required: - data type: object + BatchDeleteRowsRequestArray: + description: The request body for deleting multiple rows from a reference table. + properties: + data: + items: + $ref: '#/components/schemas/BatchDeleteRowsRequestData' + maxItems: 200 + type: array + required: + - data + type: object + BatchDeleteRowsRequestData: + description: Row resource containing a single row identifier for deletion. + properties: + id: + example: primary_key_value + type: string + type: + $ref: '#/components/schemas/TableRowResourceDataType' + required: + - type + - id + type: object + BatchUpsertRowsRequestArray: + description: The request body for creating or updating multiple rows into a + reference table. + properties: + data: + items: + $ref: '#/components/schemas/BatchUpsertRowsRequestData' + maxItems: 200 + type: array + required: + - data + type: object + BatchUpsertRowsRequestData: + description: Row resource containing a single row identifier and its column + values. + properties: + attributes: + $ref: '#/components/schemas/BatchUpsertRowsRequestDataAttributes' + id: + example: primary_key_value + type: string + type: + $ref: '#/components/schemas/TableRowResourceDataType' + required: + - type + - id + type: object + BatchUpsertRowsRequestDataAttributes: + description: Attributes containing row data values for row creation or update + operations. + properties: + values: + additionalProperties: + x-required-field: true + description: Key-value pairs representing row data, where keys are field + names from the schema. + example: + example_key_value: primary_key_value + name: row_name + type: object + required: + - values + type: object BillConfig: description: Bill config. properties: @@ -74549,6 +74615,47 @@ paths: tags: - Reference Tables /api/v2/reference-tables/tables/{id}/rows: + delete: + description: Delete multiple rows from a Reference Table by their primary key + values. + operationId: DeleteRows + parameters: + - description: Unique identifier of the reference table to delete rows from + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BatchDeleteRowsRequestArray' + required: true + responses: + '200': + description: Rows deleted successfully + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Delete rows + tags: + - Reference Tables get: description: Get reference table rows by their primary key values. operationId: GetRowsByID @@ -74593,6 +74700,48 @@ paths: summary: Get rows by id tags: - Reference Tables + post: + description: Create or update rows in a Reference Table by their primary key + values. If a row with the specified primary key exists, it is updated; otherwise, + a new row is created. + operationId: UpsertRows + parameters: + - description: Unique identifier of the reference table to upsert rows into + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BatchUpsertRowsRequestArray' + required: true + responses: + '200': + description: Rows created or updated successfully + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Upsert rows + tags: + - Reference Tables /api/v2/reference-tables/uploads: post: description: Create a reference table upload for bulk data ingestion diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 60fdfd49e2..aa537da559 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -2461,6 +2461,41 @@ datadog\_api\_client.v2.model.azure\_uc\_configs\_response module :members: :show-inheritance: +datadog\_api\_client.v2.model.batch\_delete\_rows\_request\_array module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.batch_delete_rows_request_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_delete\_rows\_request\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_delete_rows_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_upsert\_rows\_request\_array module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.batch_upsert_rows_request_array + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_upsert\_rows\_request\_data module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_upsert_rows_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_upsert\_rows\_request\_data\_attributes module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_upsert_rows_request_data_attributes + :members: + :show-inheritance: + datadog\_api\_client.v2.model.bill\_config module ------------------------------------------------- diff --git a/examples/v2/reference-tables/DeleteRows.py b/examples/v2/reference-tables/DeleteRows.py new file mode 100644 index 0000000000..27f60273ea --- /dev/null +++ b/examples/v2/reference-tables/DeleteRows.py @@ -0,0 +1,23 @@ +""" +Delete rows returns "Rows deleted successfully" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi +from datadog_api_client.v2.model.batch_delete_rows_request_array import BatchDeleteRowsRequestArray +from datadog_api_client.v2.model.batch_delete_rows_request_data import BatchDeleteRowsRequestData +from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType + +body = BatchDeleteRowsRequestArray( + data=[ + BatchDeleteRowsRequestData( + id="primary_key_value", + type=TableRowResourceDataType.ROW, + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ReferenceTablesApi(api_client) + api_instance.delete_rows(id="id", body=body) diff --git a/examples/v2/reference-tables/UpsertRows.py b/examples/v2/reference-tables/UpsertRows.py new file mode 100644 index 0000000000..b6f1fa9616 --- /dev/null +++ b/examples/v2/reference-tables/UpsertRows.py @@ -0,0 +1,30 @@ +""" +Upsert rows returns "Rows created or updated successfully" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi +from datadog_api_client.v2.model.batch_upsert_rows_request_array import BatchUpsertRowsRequestArray +from datadog_api_client.v2.model.batch_upsert_rows_request_data import BatchUpsertRowsRequestData +from datadog_api_client.v2.model.batch_upsert_rows_request_data_attributes import BatchUpsertRowsRequestDataAttributes +from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType + +body = BatchUpsertRowsRequestArray( + data=[ + BatchUpsertRowsRequestData( + attributes=BatchUpsertRowsRequestDataAttributes( + values=dict( + example_key_value="primary_key_value", + name="row_name", + ), + ), + id="primary_key_value", + type=TableRowResourceDataType.ROW, + ), + ], +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ReferenceTablesApi(api_client) + api_instance.upsert_rows(id="id", body=body) diff --git a/src/datadog_api_client/v2/api/reference_tables_api.py b/src/datadog_api_client/v2/api/reference_tables_api.py index bd318ebaf2..771c174fa3 100644 --- a/src/datadog_api_client/v2/api/reference_tables_api.py +++ b/src/datadog_api_client/v2/api/reference_tables_api.py @@ -16,7 +16,9 @@ from datadog_api_client.v2.model.table_result_v2 import TableResultV2 from datadog_api_client.v2.model.create_table_request import CreateTableRequest from datadog_api_client.v2.model.patch_table_request import PatchTableRequest +from datadog_api_client.v2.model.batch_delete_rows_request_array import BatchDeleteRowsRequestArray from datadog_api_client.v2.model.table_row_resource_array import TableRowResourceArray +from datadog_api_client.v2.model.batch_upsert_rows_request_array import BatchUpsertRowsRequestArray from datadog_api_client.v2.model.create_upload_response import CreateUploadResponse from datadog_api_client.v2.model.create_upload_request import CreateUploadRequest @@ -71,6 +73,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._delete_rows_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/reference-tables/tables/{id}/rows", + "operation_id": "delete_rows", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (BatchDeleteRowsRequestArray,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._delete_table_endpoint = _Endpoint( settings={ "response_type": None, @@ -227,6 +255,32 @@ def __init__(self, api_client=None): api_client=api_client, ) + self._upsert_rows_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/reference-tables/tables/{id}/rows", + "operation_id": "upsert_rows", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "id": { + "required": True, + "openapi_types": (str,), + "attribute": "id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (BatchUpsertRowsRequestArray,), + "location": "body", + }, + }, + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, + api_client=api_client, + ) + def create_reference_table( self, body: CreateTableRequest, @@ -264,6 +318,27 @@ def create_reference_table_upload( return self._create_reference_table_upload_endpoint.call_with_http_info(**kwargs) + def delete_rows( + self, + id: str, + body: BatchDeleteRowsRequestArray, + ) -> None: + """Delete rows. + + Delete multiple rows from a Reference Table by their primary key values. + + :param id: Unique identifier of the reference table to delete rows from + :type id: str + :type body: BatchDeleteRowsRequestArray + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + kwargs["body"] = body + + return self._delete_rows_endpoint.call_with_http_info(**kwargs) + def delete_table( self, id: str, @@ -389,3 +464,24 @@ def update_reference_table( kwargs["body"] = body return self._update_reference_table_endpoint.call_with_http_info(**kwargs) + + def upsert_rows( + self, + id: str, + body: BatchUpsertRowsRequestArray, + ) -> None: + """Upsert rows. + + Create or update rows in a Reference Table by their primary key values. If a row with the specified primary key exists, it is updated; otherwise, a new row is created. + + :param id: Unique identifier of the reference table to upsert rows into + :type id: str + :type body: BatchUpsertRowsRequestArray + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["id"] = id + + kwargs["body"] = body + + return self._upsert_rows_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/model/batch_delete_rows_request_array.py b/src/datadog_api_client/v2/model/batch_delete_rows_request_array.py new file mode 100644 index 0000000000..ce31506ce4 --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_delete_rows_request_array.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.batch_delete_rows_request_data import BatchDeleteRowsRequestData + + +class BatchDeleteRowsRequestArray(ModelNormal): + validations = { + "data": { + "max_items": 200, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.batch_delete_rows_request_data import BatchDeleteRowsRequestData + + return { + "data": ([BatchDeleteRowsRequestData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[BatchDeleteRowsRequestData], **kwargs): + """ + The request body for deleting multiple rows from a reference table. + + :param data: + :type data: [BatchDeleteRowsRequestData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/batch_delete_rows_request_data.py b/src/datadog_api_client/v2/model/batch_delete_rows_request_data.py new file mode 100644 index 0000000000..ecdb976771 --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_delete_rows_request_data.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType + + +class BatchDeleteRowsRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType + + return { + "id": (str,), + "type": (TableRowResourceDataType,), + } + + attribute_map = { + "id": "id", + "type": "type", + } + + def __init__(self_, id: str, type: TableRowResourceDataType, **kwargs): + """ + Row resource containing a single row identifier for deletion. + + :param id: + :type id: str + + :param type: Row resource type. + :type type: TableRowResourceDataType + """ + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/batch_upsert_rows_request_array.py b/src/datadog_api_client/v2/model/batch_upsert_rows_request_array.py new file mode 100644 index 0000000000..1aed40a938 --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_upsert_rows_request_array.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.batch_upsert_rows_request_data import BatchUpsertRowsRequestData + + +class BatchUpsertRowsRequestArray(ModelNormal): + validations = { + "data": { + "max_items": 200, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.batch_upsert_rows_request_data import BatchUpsertRowsRequestData + + return { + "data": ([BatchUpsertRowsRequestData],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: List[BatchUpsertRowsRequestData], **kwargs): + """ + The request body for creating or updating multiple rows into a reference table. + + :param data: + :type data: [BatchUpsertRowsRequestData] + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/batch_upsert_rows_request_data.py b/src/datadog_api_client/v2/model/batch_upsert_rows_request_data.py new file mode 100644 index 0000000000..ae14d53fae --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_upsert_rows_request_data.py @@ -0,0 +1,67 @@ +# 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.batch_upsert_rows_request_data_attributes import ( + BatchUpsertRowsRequestDataAttributes, + ) + from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType + + +class BatchUpsertRowsRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.batch_upsert_rows_request_data_attributes import ( + BatchUpsertRowsRequestDataAttributes, + ) + from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType + + return { + "attributes": (BatchUpsertRowsRequestDataAttributes,), + "id": (str,), + "type": (TableRowResourceDataType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__( + self_, + id: str, + type: TableRowResourceDataType, + attributes: Union[BatchUpsertRowsRequestDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + Row resource containing a single row identifier and its column values. + + :param attributes: Attributes containing row data values for row creation or update operations. + :type attributes: BatchUpsertRowsRequestDataAttributes, optional + + :param id: + :type id: str + + :param type: Row resource type. + :type type: TableRowResourceDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/batch_upsert_rows_request_data_attributes.py b/src/datadog_api_client/v2/model/batch_upsert_rows_request_data_attributes.py new file mode 100644 index 0000000000..c1ea9d9a6a --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_upsert_rows_request_data_attributes.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 Any, Dict + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + date, + datetime, + none_type, + UUID, +) + + +class BatchUpsertRowsRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "values": ( + { + str: ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + UUID, + none_type, + ) + }, + ), + } + + attribute_map = { + "values": "values", + } + + def __init__(self_, values: Dict[str, Any], **kwargs): + """ + Attributes containing row data values for row creation or update operations. + + :param values: Key-value pairs representing row data, where keys are field names from the schema. + :type values: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)} + """ + super().__init__(kwargs) + + self_.values = values diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 9cece11cff..e9d7cc9de0 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -470,6 +470,11 @@ from datadog_api_client.v2.model.azure_uc_config_post_request_attributes import AzureUCConfigPostRequestAttributes from datadog_api_client.v2.model.azure_uc_config_post_request_type import AzureUCConfigPostRequestType from datadog_api_client.v2.model.azure_uc_configs_response import AzureUCConfigsResponse +from datadog_api_client.v2.model.batch_delete_rows_request_array import BatchDeleteRowsRequestArray +from datadog_api_client.v2.model.batch_delete_rows_request_data import BatchDeleteRowsRequestData +from datadog_api_client.v2.model.batch_upsert_rows_request_array import BatchUpsertRowsRequestArray +from datadog_api_client.v2.model.batch_upsert_rows_request_data import BatchUpsertRowsRequestData +from datadog_api_client.v2.model.batch_upsert_rows_request_data_attributes import BatchUpsertRowsRequestDataAttributes from datadog_api_client.v2.model.bill_config import BillConfig from datadog_api_client.v2.model.billing_dimensions_mapping_body_item import BillingDimensionsMappingBodyItem from datadog_api_client.v2.model.billing_dimensions_mapping_body_item_attributes import ( @@ -5298,6 +5303,11 @@ "AzureUCConfigPostRequestAttributes", "AzureUCConfigPostRequestType", "AzureUCConfigsResponse", + "BatchDeleteRowsRequestArray", + "BatchDeleteRowsRequestData", + "BatchUpsertRowsRequestArray", + "BatchUpsertRowsRequestData", + "BatchUpsertRowsRequestDataAttributes", "BillConfig", "BillingDimensionsMappingBodyItem", "BillingDimensionsMappingBodyItemAttributes", diff --git a/tests/v2/features/reference_tables.feature b/tests/v2/features/reference_tables.feature index fa3ea42360..45a2861c15 100644 --- a/tests/v2/features/reference_tables.feature +++ b/tests/v2/features/reference_tables.feature @@ -53,6 +53,30 @@ Feature: Reference Tables When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:DataDog/redapl-experiences + Scenario: Delete rows returns "Bad Request" response + Given new "DeleteRows" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": [{"id": "primary_key_value", "type": "row"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Delete rows returns "Not Found" response + Given new "DeleteRows" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": [{"id": "primary_key_value", "type": "row"}]} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Delete rows returns "Rows deleted successfully" response + Given new "DeleteRows" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": [{"id": "primary_key_value", "type": "row"}]} + When the request is sent + Then the response status is 200 Rows deleted successfully + @generated @skip @team:DataDog/redapl-experiences Scenario: Delete table returns "Not Found" response Given new "DeleteTable" request @@ -119,3 +143,27 @@ Feature: Reference Tables And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "type": "reference_table"}} When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Upsert rows returns "Bad Request" response + Given new "UpsertRows" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": [{"attributes": {"values": {"example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Upsert rows returns "Not Found" response + Given new "UpsertRows" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": [{"attributes": {"values": {"example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Upsert rows returns "Rows created or updated successfully" response + Given new "UpsertRows" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": [{"attributes": {"values": {"example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]} + When the request is sent + Then the response status is 200 Rows created or updated successfully diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index 3799e64e63..35580ed3fc 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3089,12 +3089,26 @@ "type": "idempotent" } }, + "DeleteRows": { + "tag": "Reference Tables", + "undo": { + "type": "idempotent" + } + }, "GetRowsByID": { "tag": "Reference Tables", "undo": { "type": "safe" } }, + "UpsertRows": { + "tag": "Reference Tables", + "undo": { + "operationId": "DeleteRows", + "parameters": [], + "type": "unsafe" + } + }, "CreateReferenceTableUpload": { "tag": "Reference Tables", "undo": {