From 9d85fbb409b5a928c994f0f1a4e148169bee216d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 13 Mar 2026 20:08:45 +0000 Subject: [PATCH] Regenerate client from commit 227d668 of spec repo --- .generator/schemas/v2/openapi.yaml | 141 +++++++++++++++++- docs/datadog_api_client.v2.model.rst | 60 +++++++- .../v2/reference-tables/BatchRowsQuery.py | 31 ++++ examples/v2/reference-tables/DeleteRows.py | 4 +- .../v2/api/reference_tables_api.py | 38 +++++ .../model/batch_delete_rows_request_array.py | 10 +- .../v2/model/batch_rows_query_data_type.py | 35 +++++ .../v2/model/batch_rows_query_request.py | 42 ++++++ .../v2/model/batch_rows_query_request_data.py | 58 +++++++ ...atch_rows_query_request_data_attributes.py | 40 +++++ .../v2/model/batch_rows_query_response.py | 42 ++++++ .../model/batch_rows_query_response_data.py | 68 +++++++++ ..._rows_query_response_data_relationships.py | 46 ++++++ ..._query_response_data_relationships_rows.py | 42 ++++++ ...ta.py => table_row_resource_identifier.py} | 4 +- src/datadog_api_client/v2/models/__init__.py | 24 ++- tests/v2/features/reference_tables.feature | 21 +++ tests/v2/features/undo.json | 6 + 18 files changed, 693 insertions(+), 19 deletions(-) create mode 100644 examples/v2/reference-tables/BatchRowsQuery.py create mode 100644 src/datadog_api_client/v2/model/batch_rows_query_data_type.py create mode 100644 src/datadog_api_client/v2/model/batch_rows_query_request.py create mode 100644 src/datadog_api_client/v2/model/batch_rows_query_request_data.py create mode 100644 src/datadog_api_client/v2/model/batch_rows_query_request_data_attributes.py create mode 100644 src/datadog_api_client/v2/model/batch_rows_query_response.py create mode 100644 src/datadog_api_client/v2/model/batch_rows_query_response_data.py create mode 100644 src/datadog_api_client/v2/model/batch_rows_query_response_data_relationships.py create mode 100644 src/datadog_api_client/v2/model/batch_rows_query_response_data_relationships_rows.py rename src/datadog_api_client/v2/model/{batch_delete_rows_request_data.py => table_row_resource_identifier.py} (90%) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index bd5307a92d..a27042d9b8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7475,23 +7475,89 @@ components: properties: data: items: - $ref: '#/components/schemas/BatchDeleteRowsRequestData' + $ref: '#/components/schemas/TableRowResourceIdentifier' maxItems: 200 type: array required: - data type: object - BatchDeleteRowsRequestData: - description: Row resource containing a single row identifier for deletion. + BatchRowsQueryDataType: + default: reference-tables-batch-rows-query + description: Resource type identifier for batch queries of reference table rows. + enum: + - reference-tables-batch-rows-query + example: reference-tables-batch-rows-query + type: string + x-enum-varnames: + - REFERENCE_TABLES_BATCH_ROWS_QUERY + BatchRowsQueryRequest: + properties: + data: + $ref: '#/components/schemas/BatchRowsQueryRequestData' + type: object + BatchRowsQueryRequestData: + properties: + attributes: + $ref: '#/components/schemas/BatchRowsQueryRequestDataAttributes' + type: + $ref: '#/components/schemas/BatchRowsQueryDataType' + required: + - type + type: object + BatchRowsQueryRequestDataAttributes: + properties: + row_ids: + example: + - row_id_1 + - row_id_2 + items: + type: string + type: array + table_id: + example: 00000000-0000-0000-0000-000000000000 + type: string + required: + - row_ids + - table_id + type: object + BatchRowsQueryResponse: + example: + data: + id: 00000000-0000-0000-0000-000000000000 + relationships: + rows: + data: + - id: row_id_1 + type: row + - id: row_id_2 + type: row + type: reference-tables-batch-rows-query + properties: + data: + $ref: '#/components/schemas/BatchRowsQueryResponseData' + type: object + BatchRowsQueryResponseData: properties: id: - example: primary_key_value type: string + relationships: + $ref: '#/components/schemas/BatchRowsQueryResponseDataRelationships' type: - $ref: '#/components/schemas/TableRowResourceDataType' + $ref: '#/components/schemas/BatchRowsQueryDataType' required: - type - - id + type: object + BatchRowsQueryResponseDataRelationships: + properties: + rows: + $ref: '#/components/schemas/BatchRowsQueryResponseDataRelationshipsRows' + type: object + BatchRowsQueryResponseDataRelationshipsRows: + properties: + data: + items: + $ref: '#/components/schemas/TableRowResourceIdentifier' + type: array type: object BatchUpsertRowsRequestArray: description: The request body for creating or updating multiple rows into a @@ -66953,6 +67019,18 @@ components: type: string x-enum-varnames: - ROW + TableRowResourceIdentifier: + description: Row resource containing a single row identifier. + properties: + id: + example: primary_key_value + type: string + type: + $ref: '#/components/schemas/TableRowResourceDataType' + required: + - type + - id + type: object TagsEventAttribute: description: Array of tags associated with your event. example: @@ -96388,6 +96466,57 @@ paths: operator: OR permissions: - timeseries_query + /api/v2/reference-tables/queries/batch-rows: + post: + description: Batch query reference table rows by their primary key values. Returns + only found rows in the included array. + operationId: BatchRowsQuery + requestBody: + content: + application/json: + examples: + happy_path: + summary: Batch query reference table rows by their primary key values. + value: + data: + attributes: + row_ids: + - row_id_1 + - row_id_2 + table_id: 00000000-0000-0000-0000-000000000000 + type: reference-tables-batch-rows-query + schema: + $ref: '#/components/schemas/BatchRowsQueryRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BatchRowsQueryResponse' + description: Successfully retrieved rows. Some or all requested rows were + found. Response includes found rows in the included section. + '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: Batch rows query + tags: + - Reference Tables /api/v2/reference-tables/tables: get: description: List all reference tables in this organization. diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index c6d029f83c..f5afeb297a 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -2769,10 +2769,59 @@ datadog\_api\_client.v2.model.batch\_delete\_rows\_request\_array module :members: :show-inheritance: -datadog\_api\_client.v2.model.batch\_delete\_rows\_request\_data module +datadog\_api\_client.v2.model.batch\_rows\_query\_data\_type module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_rows_query_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_rows\_query\_request module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_rows_query_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_rows\_query\_request\_data module +---------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_rows_query_request_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_rows\_query\_request\_data\_attributes module +---------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_rows_query_request_data_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_rows\_query\_response module +----------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_rows_query_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_rows\_query\_response\_data module ----------------------------------------------------------------------- -.. automodule:: datadog_api_client.v2.model.batch_delete_rows_request_data +.. automodule:: datadog_api_client.v2.model.batch_rows_query_response_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_rows\_query\_response\_data\_relationships module +-------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_rows_query_response_data_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.batch\_rows\_query\_response\_data\_relationships\_rows module +-------------------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.batch_rows_query_response_data_relationships_rows :members: :show-inheritance: @@ -29306,6 +29355,13 @@ datadog\_api\_client.v2.model.table\_row\_resource\_data\_type module :members: :show-inheritance: +datadog\_api\_client.v2.model.table\_row\_resource\_identifier module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.table_row_resource_identifier + :members: + :show-inheritance: + datadog\_api\_client.v2.model.tags\_event\_attribute module ----------------------------------------------------------- diff --git a/examples/v2/reference-tables/BatchRowsQuery.py b/examples/v2/reference-tables/BatchRowsQuery.py new file mode 100644 index 0000000000..fbc48be53f --- /dev/null +++ b/examples/v2/reference-tables/BatchRowsQuery.py @@ -0,0 +1,31 @@ +""" +Batch rows query returns "Successfully retrieved rows. Some or all requested rows were found. Response includes found +rows in the included section." 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_rows_query_data_type import BatchRowsQueryDataType +from datadog_api_client.v2.model.batch_rows_query_request import BatchRowsQueryRequest +from datadog_api_client.v2.model.batch_rows_query_request_data import BatchRowsQueryRequestData +from datadog_api_client.v2.model.batch_rows_query_request_data_attributes import BatchRowsQueryRequestDataAttributes + +body = BatchRowsQueryRequest( + data=BatchRowsQueryRequestData( + attributes=BatchRowsQueryRequestDataAttributes( + row_ids=[ + "row_id_1", + "row_id_2", + ], + table_id="00000000-0000-0000-0000-000000000000", + ), + type=BatchRowsQueryDataType.REFERENCE_TABLES_BATCH_ROWS_QUERY, + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = ReferenceTablesApi(api_client) + response = api_instance.batch_rows_query(body=body) + + print(response) diff --git a/examples/v2/reference-tables/DeleteRows.py b/examples/v2/reference-tables/DeleteRows.py index 27f60273ea..0b2f41cca7 100644 --- a/examples/v2/reference-tables/DeleteRows.py +++ b/examples/v2/reference-tables/DeleteRows.py @@ -5,12 +5,12 @@ 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 +from datadog_api_client.v2.model.table_row_resource_identifier import TableRowResourceIdentifier body = BatchDeleteRowsRequestArray( data=[ - BatchDeleteRowsRequestData( + TableRowResourceIdentifier( id="primary_key_value", type=TableRowResourceDataType.ROW, ), 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 771c174fa3..ff381a18e6 100644 --- a/src/datadog_api_client/v2/api/reference_tables_api.py +++ b/src/datadog_api_client/v2/api/reference_tables_api.py @@ -11,6 +11,8 @@ UnsetType, unset, ) +from datadog_api_client.v2.model.batch_rows_query_response import BatchRowsQueryResponse +from datadog_api_client.v2.model.batch_rows_query_request import BatchRowsQueryRequest from datadog_api_client.v2.model.table_result_v2_array import TableResultV2Array from datadog_api_client.v2.model.reference_table_sort_type import ReferenceTableSortType from datadog_api_client.v2.model.table_result_v2 import TableResultV2 @@ -33,6 +35,26 @@ def __init__(self, api_client=None): api_client = ApiClient(Configuration()) self.api_client = api_client + self._batch_rows_query_endpoint = _Endpoint( + settings={ + "response_type": (BatchRowsQueryResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/reference-tables/queries/batch-rows", + "operation_id": "batch_rows_query", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (BatchRowsQueryRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + self._create_reference_table_endpoint = _Endpoint( settings={ "response_type": (TableResultV2,), @@ -281,6 +303,22 @@ def __init__(self, api_client=None): api_client=api_client, ) + def batch_rows_query( + self, + body: BatchRowsQueryRequest, + ) -> BatchRowsQueryResponse: + """Batch rows query. + + Batch query reference table rows by their primary key values. Returns only found rows in the included array. + + :type body: BatchRowsQueryRequest + :rtype: BatchRowsQueryResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._batch_rows_query_endpoint.call_with_http_info(**kwargs) + def create_reference_table( self, body: CreateTableRequest, 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 index ce31506ce4..13462d542e 100644 --- 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 @@ -12,7 +12,7 @@ if TYPE_CHECKING: - from datadog_api_client.v2.model.batch_delete_rows_request_data import BatchDeleteRowsRequestData + from datadog_api_client.v2.model.table_row_resource_identifier import TableRowResourceIdentifier class BatchDeleteRowsRequestArray(ModelNormal): @@ -24,22 +24,22 @@ class BatchDeleteRowsRequestArray(ModelNormal): @cached_property def openapi_types(_): - from datadog_api_client.v2.model.batch_delete_rows_request_data import BatchDeleteRowsRequestData + from datadog_api_client.v2.model.table_row_resource_identifier import TableRowResourceIdentifier return { - "data": ([BatchDeleteRowsRequestData],), + "data": ([TableRowResourceIdentifier],), } attribute_map = { "data": "data", } - def __init__(self_, data: List[BatchDeleteRowsRequestData], **kwargs): + def __init__(self_, data: List[TableRowResourceIdentifier], **kwargs): """ The request body for deleting multiple rows from a reference table. :param data: - :type data: [BatchDeleteRowsRequestData] + :type data: [TableRowResourceIdentifier] """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/batch_rows_query_data_type.py b/src/datadog_api_client/v2/model/batch_rows_query_data_type.py new file mode 100644 index 0000000000..4f54ac4a24 --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_rows_query_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 BatchRowsQueryDataType(ModelSimple): + """ + Resource type identifier for batch queries of reference table rows. + + :param value: If omitted defaults to "reference-tables-batch-rows-query". Must be one of ["reference-tables-batch-rows-query"]. + :type value: str + """ + + allowed_values = { + "reference-tables-batch-rows-query", + } + REFERENCE_TABLES_BATCH_ROWS_QUERY: ClassVar["BatchRowsQueryDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +BatchRowsQueryDataType.REFERENCE_TABLES_BATCH_ROWS_QUERY = BatchRowsQueryDataType("reference-tables-batch-rows-query") diff --git a/src/datadog_api_client/v2/model/batch_rows_query_request.py b/src/datadog_api_client/v2/model/batch_rows_query_request.py new file mode 100644 index 0000000000..f1d2823956 --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_rows_query_request.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import 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_rows_query_request_data import BatchRowsQueryRequestData + + +class BatchRowsQueryRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.batch_rows_query_request_data import BatchRowsQueryRequestData + + return { + "data": (BatchRowsQueryRequestData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[BatchRowsQueryRequestData, UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: BatchRowsQueryRequestData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/batch_rows_query_request_data.py b/src/datadog_api_client/v2/model/batch_rows_query_request_data.py new file mode 100644 index 0000000000..879ce6f7c3 --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_rows_query_request_data.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 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_rows_query_request_data_attributes import BatchRowsQueryRequestDataAttributes + from datadog_api_client.v2.model.batch_rows_query_data_type import BatchRowsQueryDataType + + +class BatchRowsQueryRequestData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.batch_rows_query_request_data_attributes import ( + BatchRowsQueryRequestDataAttributes, + ) + from datadog_api_client.v2.model.batch_rows_query_data_type import BatchRowsQueryDataType + + return { + "attributes": (BatchRowsQueryRequestDataAttributes,), + "type": (BatchRowsQueryDataType,), + } + + attribute_map = { + "attributes": "attributes", + "type": "type", + } + + def __init__( + self_, + type: BatchRowsQueryDataType, + attributes: Union[BatchRowsQueryRequestDataAttributes, UnsetType] = unset, + **kwargs, + ): + """ + + + :param attributes: + :type attributes: BatchRowsQueryRequestDataAttributes, optional + + :param type: Resource type identifier for batch queries of reference table rows. + :type type: BatchRowsQueryDataType + """ + if attributes is not unset: + kwargs["attributes"] = attributes + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/batch_rows_query_request_data_attributes.py b/src/datadog_api_client/v2/model/batch_rows_query_request_data_attributes.py new file mode 100644 index 0000000000..3edf53ba81 --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_rows_query_request_data_attributes.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class BatchRowsQueryRequestDataAttributes(ModelNormal): + @cached_property + def openapi_types(_): + return { + "row_ids": ([str],), + "table_id": (str,), + } + + attribute_map = { + "row_ids": "row_ids", + "table_id": "table_id", + } + + def __init__(self_, row_ids: List[str], table_id: str, **kwargs): + """ + + + :param row_ids: + :type row_ids: [str] + + :param table_id: + :type table_id: str + """ + super().__init__(kwargs) + + self_.row_ids = row_ids + self_.table_id = table_id diff --git a/src/datadog_api_client/v2/model/batch_rows_query_response.py b/src/datadog_api_client/v2/model/batch_rows_query_response.py new file mode 100644 index 0000000000..5b1e5afc0c --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_rows_query_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.batch_rows_query_response_data import BatchRowsQueryResponseData + + +class BatchRowsQueryResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.batch_rows_query_response_data import BatchRowsQueryResponseData + + return { + "data": (BatchRowsQueryResponseData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[BatchRowsQueryResponseData, UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: BatchRowsQueryResponseData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/batch_rows_query_response_data.py b/src/datadog_api_client/v2/model/batch_rows_query_response_data.py new file mode 100644 index 0000000000..33b6d8fa69 --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_rows_query_response_data.py @@ -0,0 +1,68 @@ +# 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_rows_query_response_data_relationships import ( + BatchRowsQueryResponseDataRelationships, + ) + from datadog_api_client.v2.model.batch_rows_query_data_type import BatchRowsQueryDataType + + +class BatchRowsQueryResponseData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.batch_rows_query_response_data_relationships import ( + BatchRowsQueryResponseDataRelationships, + ) + from datadog_api_client.v2.model.batch_rows_query_data_type import BatchRowsQueryDataType + + return { + "id": (str,), + "relationships": (BatchRowsQueryResponseDataRelationships,), + "type": (BatchRowsQueryDataType,), + } + + attribute_map = { + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + type: BatchRowsQueryDataType, + id: Union[str, UnsetType] = unset, + relationships: Union[BatchRowsQueryResponseDataRelationships, UnsetType] = unset, + **kwargs, + ): + """ + + + :param id: + :type id: str, optional + + :param relationships: + :type relationships: BatchRowsQueryResponseDataRelationships, optional + + :param type: Resource type identifier for batch queries of reference table rows. + :type type: BatchRowsQueryDataType + """ + if id is not unset: + kwargs["id"] = id + if relationships is not unset: + kwargs["relationships"] = relationships + super().__init__(kwargs) + + self_.type = type diff --git a/src/datadog_api_client/v2/model/batch_rows_query_response_data_relationships.py b/src/datadog_api_client/v2/model/batch_rows_query_response_data_relationships.py new file mode 100644 index 0000000000..0da1e8ea1e --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_rows_query_response_data_relationships.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 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_rows_query_response_data_relationships_rows import ( + BatchRowsQueryResponseDataRelationshipsRows, + ) + + +class BatchRowsQueryResponseDataRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.batch_rows_query_response_data_relationships_rows import ( + BatchRowsQueryResponseDataRelationshipsRows, + ) + + return { + "rows": (BatchRowsQueryResponseDataRelationshipsRows,), + } + + attribute_map = { + "rows": "rows", + } + + def __init__(self_, rows: Union[BatchRowsQueryResponseDataRelationshipsRows, UnsetType] = unset, **kwargs): + """ + + + :param rows: + :type rows: BatchRowsQueryResponseDataRelationshipsRows, optional + """ + if rows is not unset: + kwargs["rows"] = rows + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/batch_rows_query_response_data_relationships_rows.py b/src/datadog_api_client/v2/model/batch_rows_query_response_data_relationships_rows.py new file mode 100644 index 0000000000..25c48117ca --- /dev/null +++ b/src/datadog_api_client/v2/model/batch_rows_query_response_data_relationships_rows.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 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.table_row_resource_identifier import TableRowResourceIdentifier + + +class BatchRowsQueryResponseDataRelationshipsRows(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.table_row_resource_identifier import TableRowResourceIdentifier + + return { + "data": ([TableRowResourceIdentifier],), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[List[TableRowResourceIdentifier], UnsetType] = unset, **kwargs): + """ + + + :param data: + :type data: [TableRowResourceIdentifier], optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/batch_delete_rows_request_data.py b/src/datadog_api_client/v2/model/table_row_resource_identifier.py similarity index 90% rename from src/datadog_api_client/v2/model/batch_delete_rows_request_data.py rename to src/datadog_api_client/v2/model/table_row_resource_identifier.py index ecdb976771..5ba481afab 100644 --- a/src/datadog_api_client/v2/model/batch_delete_rows_request_data.py +++ b/src/datadog_api_client/v2/model/table_row_resource_identifier.py @@ -15,7 +15,7 @@ from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType -class BatchDeleteRowsRequestData(ModelNormal): +class TableRowResourceIdentifier(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType @@ -32,7 +32,7 @@ def openapi_types(_): def __init__(self_, id: str, type: TableRowResourceDataType, **kwargs): """ - Row resource containing a single row identifier for deletion. + Row resource containing a single row identifier. :param id: :type id: str diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 8e618b29d7..ac4604fa22 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -526,7 +526,18 @@ 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_rows_query_data_type import BatchRowsQueryDataType +from datadog_api_client.v2.model.batch_rows_query_request import BatchRowsQueryRequest +from datadog_api_client.v2.model.batch_rows_query_request_data import BatchRowsQueryRequestData +from datadog_api_client.v2.model.batch_rows_query_request_data_attributes import BatchRowsQueryRequestDataAttributes +from datadog_api_client.v2.model.batch_rows_query_response import BatchRowsQueryResponse +from datadog_api_client.v2.model.batch_rows_query_response_data import BatchRowsQueryResponseData +from datadog_api_client.v2.model.batch_rows_query_response_data_relationships import ( + BatchRowsQueryResponseDataRelationships, +) +from datadog_api_client.v2.model.batch_rows_query_response_data_relationships_rows import ( + BatchRowsQueryResponseDataRelationshipsRows, +) 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 @@ -5969,6 +5980,7 @@ from datadog_api_client.v2.model.table_row_resource_data import TableRowResourceData from datadog_api_client.v2.model.table_row_resource_data_attributes import TableRowResourceDataAttributes from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType +from datadog_api_client.v2.model.table_row_resource_identifier import TableRowResourceIdentifier from datadog_api_client.v2.model.tags_event_attribute import TagsEventAttribute from datadog_api_client.v2.model.team import Team from datadog_api_client.v2.model.team_attributes import TeamAttributes @@ -6845,7 +6857,14 @@ "AzureUCConfigPostRequestType", "AzureUCConfigsResponse", "BatchDeleteRowsRequestArray", - "BatchDeleteRowsRequestData", + "BatchRowsQueryDataType", + "BatchRowsQueryRequest", + "BatchRowsQueryRequestData", + "BatchRowsQueryRequestDataAttributes", + "BatchRowsQueryResponse", + "BatchRowsQueryResponseData", + "BatchRowsQueryResponseDataRelationships", + "BatchRowsQueryResponseDataRelationshipsRows", "BatchUpsertRowsRequestArray", "BatchUpsertRowsRequestData", "BatchUpsertRowsRequestDataAttributes", @@ -10646,6 +10665,7 @@ "TableRowResourceData", "TableRowResourceDataAttributes", "TableRowResourceDataType", + "TableRowResourceIdentifier", "TagsEventAttribute", "Team", "TeamAttributes", diff --git a/tests/v2/features/reference_tables.feature b/tests/v2/features/reference_tables.feature index db0f84a6e5..0ba8738c6b 100644 --- a/tests/v2/features/reference_tables.feature +++ b/tests/v2/features/reference_tables.feature @@ -7,6 +7,27 @@ Feature: Reference Tables And a valid "appKeyAuth" key in the system And an instance of "ReferenceTables" API + @generated @skip @team:DataDog/redapl-experiences + Scenario: Batch rows query returns "Bad Request" response + Given new "BatchRowsQuery" request + And body with value {"data": {"attributes": {"row_ids": ["row_id_1", "row_id_2"], "table_id": "00000000-0000-0000-0000-000000000000"}, "type": "reference-tables-batch-rows-query"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Batch rows query returns "Not Found" response + Given new "BatchRowsQuery" request + And body with value {"data": {"attributes": {"row_ids": ["row_id_1", "row_id_2"], "table_id": "00000000-0000-0000-0000-000000000000"}, "type": "reference-tables-batch-rows-query"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Batch rows query returns "Successfully retrieved rows. Some or all requested rows were found. Response includes found rows in the included section." response + Given new "BatchRowsQuery" request + And body with value {"data": {"attributes": {"row_ids": ["row_id_1", "row_id_2"], "table_id": "00000000-0000-0000-0000-000000000000"}, "type": "reference-tables-batch-rows-query"}} + When the request is sent + Then the response status is 200 Successfully retrieved rows. Some or all requested rows were found. Response includes found rows in the included section. + @generated @skip @team:DataDog/redapl-experiences Scenario: Create reference table returns "Bad Request" response Given new "CreateReferenceTable" request diff --git a/tests/v2/features/undo.json b/tests/v2/features/undo.json index e33094f9f8..a04c9b283b 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -3963,6 +3963,12 @@ "type": "idempotent" } }, + "BatchRowsQuery": { + "tag": "Reference Tables", + "undo": { + "type": "safe" + } + }, "ListTables": { "tag": "Reference Tables", "undo": {