|
16 | 16 | from datadog_api_client.v2.model.table_result_v2 import TableResultV2 |
17 | 17 | from datadog_api_client.v2.model.create_table_request import CreateTableRequest |
18 | 18 | from datadog_api_client.v2.model.patch_table_request import PatchTableRequest |
| 19 | +from datadog_api_client.v2.model.batch_delete_rows_request_array import BatchDeleteRowsRequestArray |
19 | 20 | from datadog_api_client.v2.model.table_row_resource_array import TableRowResourceArray |
| 21 | +from datadog_api_client.v2.model.batch_upsert_rows_request_array import BatchUpsertRowsRequestArray |
20 | 22 | from datadog_api_client.v2.model.create_upload_response import CreateUploadResponse |
21 | 23 | from datadog_api_client.v2.model.create_upload_request import CreateUploadRequest |
22 | 24 |
|
@@ -71,6 +73,32 @@ def __init__(self, api_client=None): |
71 | 73 | api_client=api_client, |
72 | 74 | ) |
73 | 75 |
|
| 76 | + self._delete_rows_endpoint = _Endpoint( |
| 77 | + settings={ |
| 78 | + "response_type": None, |
| 79 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 80 | + "endpoint_path": "/api/v2/reference-tables/tables/{id}/rows", |
| 81 | + "operation_id": "delete_rows", |
| 82 | + "http_method": "DELETE", |
| 83 | + "version": "v2", |
| 84 | + }, |
| 85 | + params_map={ |
| 86 | + "id": { |
| 87 | + "required": True, |
| 88 | + "openapi_types": (str,), |
| 89 | + "attribute": "id", |
| 90 | + "location": "path", |
| 91 | + }, |
| 92 | + "body": { |
| 93 | + "required": True, |
| 94 | + "openapi_types": (BatchDeleteRowsRequestArray,), |
| 95 | + "location": "body", |
| 96 | + }, |
| 97 | + }, |
| 98 | + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, |
| 99 | + api_client=api_client, |
| 100 | + ) |
| 101 | + |
74 | 102 | self._delete_table_endpoint = _Endpoint( |
75 | 103 | settings={ |
76 | 104 | "response_type": None, |
@@ -227,6 +255,32 @@ def __init__(self, api_client=None): |
227 | 255 | api_client=api_client, |
228 | 256 | ) |
229 | 257 |
|
| 258 | + self._upsert_rows_endpoint = _Endpoint( |
| 259 | + settings={ |
| 260 | + "response_type": None, |
| 261 | + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], |
| 262 | + "endpoint_path": "/api/v2/reference-tables/tables/{id}/rows", |
| 263 | + "operation_id": "upsert_rows", |
| 264 | + "http_method": "POST", |
| 265 | + "version": "v2", |
| 266 | + }, |
| 267 | + params_map={ |
| 268 | + "id": { |
| 269 | + "required": True, |
| 270 | + "openapi_types": (str,), |
| 271 | + "attribute": "id", |
| 272 | + "location": "path", |
| 273 | + }, |
| 274 | + "body": { |
| 275 | + "required": True, |
| 276 | + "openapi_types": (BatchUpsertRowsRequestArray,), |
| 277 | + "location": "body", |
| 278 | + }, |
| 279 | + }, |
| 280 | + headers_map={"accept": ["*/*"], "content_type": ["application/json"]}, |
| 281 | + api_client=api_client, |
| 282 | + ) |
| 283 | + |
230 | 284 | def create_reference_table( |
231 | 285 | self, |
232 | 286 | body: CreateTableRequest, |
@@ -264,6 +318,27 @@ def create_reference_table_upload( |
264 | 318 |
|
265 | 319 | return self._create_reference_table_upload_endpoint.call_with_http_info(**kwargs) |
266 | 320 |
|
| 321 | + def delete_rows( |
| 322 | + self, |
| 323 | + id: str, |
| 324 | + body: BatchDeleteRowsRequestArray, |
| 325 | + ) -> None: |
| 326 | + """Delete rows. |
| 327 | +
|
| 328 | + Delete multiple rows from a Reference Table by their primary key values. |
| 329 | +
|
| 330 | + :param id: Unique identifier of the reference table to delete rows from |
| 331 | + :type id: str |
| 332 | + :type body: BatchDeleteRowsRequestArray |
| 333 | + :rtype: None |
| 334 | + """ |
| 335 | + kwargs: Dict[str, Any] = {} |
| 336 | + kwargs["id"] = id |
| 337 | + |
| 338 | + kwargs["body"] = body |
| 339 | + |
| 340 | + return self._delete_rows_endpoint.call_with_http_info(**kwargs) |
| 341 | + |
267 | 342 | def delete_table( |
268 | 343 | self, |
269 | 344 | id: str, |
@@ -389,3 +464,24 @@ def update_reference_table( |
389 | 464 | kwargs["body"] = body |
390 | 465 |
|
391 | 466 | return self._update_reference_table_endpoint.call_with_http_info(**kwargs) |
| 467 | + |
| 468 | + def upsert_rows( |
| 469 | + self, |
| 470 | + id: str, |
| 471 | + body: BatchUpsertRowsRequestArray, |
| 472 | + ) -> None: |
| 473 | + """Upsert rows. |
| 474 | +
|
| 475 | + 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. |
| 476 | +
|
| 477 | + :param id: Unique identifier of the reference table to upsert rows into |
| 478 | + :type id: str |
| 479 | + :type body: BatchUpsertRowsRequestArray |
| 480 | + :rtype: None |
| 481 | + """ |
| 482 | + kwargs: Dict[str, Any] = {} |
| 483 | + kwargs["id"] = id |
| 484 | + |
| 485 | + kwargs["body"] = body |
| 486 | + |
| 487 | + return self._upsert_rows_endpoint.call_with_http_info(**kwargs) |
0 commit comments