Skip to content

Commit 474822e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 17e922a of spec repo
1 parent 1b2d5ed commit 474822e

13 files changed

Lines changed: 649 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6788,6 +6788,70 @@ components:
67886788
required:
67896789
- data
67906790
type: object
6791+
BatchDeleteRowsRequestArray:
6792+
description: The request body for deleting multiple rows from a reference table.
6793+
properties:
6794+
data:
6795+
items:
6796+
$ref: '#/components/schemas/BatchDeleteRowsRequestData'
6797+
type: array
6798+
required:
6799+
- data
6800+
type: object
6801+
BatchDeleteRowsRequestData:
6802+
description: Row resource containing a single row identifier for deletion.
6803+
properties:
6804+
id:
6805+
example: primary_key_value
6806+
type: string
6807+
type:
6808+
$ref: '#/components/schemas/TableRowResourceDataType'
6809+
required:
6810+
- type
6811+
- id
6812+
type: object
6813+
BatchUpsertRowsRequestArray:
6814+
description: The request body for creating or updating multiple rows into a
6815+
reference table.
6816+
properties:
6817+
data:
6818+
items:
6819+
$ref: '#/components/schemas/BatchUpsertRowsRequestData'
6820+
type: array
6821+
required:
6822+
- data
6823+
type: object
6824+
BatchUpsertRowsRequestData:
6825+
description: Row resource containing a single row identifier and its column
6826+
values.
6827+
properties:
6828+
attributes:
6829+
$ref: '#/components/schemas/BatchUpsertRowsRequestDataAttributes'
6830+
id:
6831+
example: primary_key_value
6832+
type: string
6833+
type:
6834+
$ref: '#/components/schemas/TableRowResourceDataType'
6835+
required:
6836+
- type
6837+
- id
6838+
type: object
6839+
BatchUpsertRowsRequestDataAttributes:
6840+
description: Attributes containing row data values for row creation or update
6841+
operations.
6842+
properties:
6843+
values:
6844+
additionalProperties:
6845+
x-required-field: true
6846+
description: Key-value pairs representing row data, where keys are field
6847+
names from the schema.
6848+
example:
6849+
example_key_value: primary_key_value
6850+
name: row_name
6851+
type: object
6852+
required:
6853+
- values
6854+
type: object
67916855
BillConfig:
67926856
description: Bill config.
67936857
properties:
@@ -73631,6 +73695,47 @@ paths:
7363173695
tags:
7363273696
- Reference Tables
7363373697
/api/v2/reference-tables/tables/{id}/rows:
73698+
delete:
73699+
description: Delete multiple rows from a reference table by their primary key
73700+
values.
73701+
operationId: DeleteRows
73702+
parameters:
73703+
- description: Unique identifier of the reference table to delete rows from
73704+
in: path
73705+
name: id
73706+
required: true
73707+
schema:
73708+
type: string
73709+
requestBody:
73710+
content:
73711+
application/json:
73712+
schema:
73713+
$ref: '#/components/schemas/BatchDeleteRowsRequestArray'
73714+
required: true
73715+
responses:
73716+
'200':
73717+
description: Rows deleted successfully
73718+
'400':
73719+
$ref: '#/components/responses/BadRequestResponse'
73720+
'403':
73721+
$ref: '#/components/responses/ForbiddenResponse'
73722+
'404':
73723+
$ref: '#/components/responses/NotFoundResponse'
73724+
'429':
73725+
$ref: '#/components/responses/TooManyRequestsResponse'
73726+
'500':
73727+
content:
73728+
application/json:
73729+
schema:
73730+
$ref: '#/components/schemas/APIErrorResponse'
73731+
description: Internal Server Error
73732+
security:
73733+
- apiKeyAuth: []
73734+
appKeyAuth: []
73735+
- AuthZ: []
73736+
summary: Delete rows
73737+
tags:
73738+
- Reference Tables
7363473739
get:
7363573740
description: Get reference table rows by their primary key values.
7363673741
operationId: GetRowsByID
@@ -73675,6 +73780,48 @@ paths:
7367573780
summary: Get rows by id
7367673781
tags:
7367773782
- Reference Tables
73783+
post:
73784+
description: Create or update rows in a Reference Table by their primary key
73785+
values. If a row with the specified primary key exists, it will be updated;
73786+
otherwise, a new row will be created.
73787+
operationId: UpsertRows
73788+
parameters:
73789+
- description: Unique identifier of the reference table to upsert rows into
73790+
in: path
73791+
name: id
73792+
required: true
73793+
schema:
73794+
type: string
73795+
requestBody:
73796+
content:
73797+
application/json:
73798+
schema:
73799+
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
73800+
required: true
73801+
responses:
73802+
'200':
73803+
description: Rows created or updated successfully
73804+
'400':
73805+
$ref: '#/components/responses/BadRequestResponse'
73806+
'403':
73807+
$ref: '#/components/responses/ForbiddenResponse'
73808+
'404':
73809+
$ref: '#/components/responses/NotFoundResponse'
73810+
'429':
73811+
$ref: '#/components/responses/TooManyRequestsResponse'
73812+
'500':
73813+
content:
73814+
application/json:
73815+
schema:
73816+
$ref: '#/components/schemas/APIErrorResponse'
73817+
description: Internal Server Error
73818+
security:
73819+
- apiKeyAuth: []
73820+
appKeyAuth: []
73821+
- AuthZ: []
73822+
summary: Upsert rows
73823+
tags:
73824+
- Reference Tables
7367873825
/api/v2/reference-tables/uploads:
7367973826
post:
7368073827
description: Create a reference table upload for bulk data ingestion

docs/datadog_api_client.v2.model.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,6 +2461,41 @@ datadog\_api\_client.v2.model.azure\_uc\_configs\_response module
24612461
:members:
24622462
:show-inheritance:
24632463

2464+
datadog\_api\_client.v2.model.batch\_delete\_rows\_request\_array module
2465+
------------------------------------------------------------------------
2466+
2467+
.. automodule:: datadog_api_client.v2.model.batch_delete_rows_request_array
2468+
:members:
2469+
:show-inheritance:
2470+
2471+
datadog\_api\_client.v2.model.batch\_delete\_rows\_request\_data module
2472+
-----------------------------------------------------------------------
2473+
2474+
.. automodule:: datadog_api_client.v2.model.batch_delete_rows_request_data
2475+
:members:
2476+
:show-inheritance:
2477+
2478+
datadog\_api\_client.v2.model.batch\_upsert\_rows\_request\_array module
2479+
------------------------------------------------------------------------
2480+
2481+
.. automodule:: datadog_api_client.v2.model.batch_upsert_rows_request_array
2482+
:members:
2483+
:show-inheritance:
2484+
2485+
datadog\_api\_client.v2.model.batch\_upsert\_rows\_request\_data module
2486+
-----------------------------------------------------------------------
2487+
2488+
.. automodule:: datadog_api_client.v2.model.batch_upsert_rows_request_data
2489+
:members:
2490+
:show-inheritance:
2491+
2492+
datadog\_api\_client.v2.model.batch\_upsert\_rows\_request\_data\_attributes module
2493+
-----------------------------------------------------------------------------------
2494+
2495+
.. automodule:: datadog_api_client.v2.model.batch_upsert_rows_request_data_attributes
2496+
:members:
2497+
:show-inheritance:
2498+
24642499
datadog\_api\_client.v2.model.bill\_config module
24652500
-------------------------------------------------
24662501

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
"""
2+
Delete rows returns "Rows deleted successfully" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi
7+
from datadog_api_client.v2.model.batch_delete_rows_request_array import BatchDeleteRowsRequestArray
8+
from datadog_api_client.v2.model.batch_delete_rows_request_data import BatchDeleteRowsRequestData
9+
from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType
10+
11+
body = BatchDeleteRowsRequestArray(
12+
data=[
13+
BatchDeleteRowsRequestData(
14+
id="primary_key_value",
15+
type=TableRowResourceDataType.ROW,
16+
),
17+
],
18+
)
19+
20+
configuration = Configuration()
21+
with ApiClient(configuration) as api_client:
22+
api_instance = ReferenceTablesApi(api_client)
23+
api_instance.delete_rows(id="id", body=body)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
Upsert rows returns "Rows created or updated successfully" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi
7+
from datadog_api_client.v2.model.batch_upsert_rows_request_array import BatchUpsertRowsRequestArray
8+
from datadog_api_client.v2.model.batch_upsert_rows_request_data import BatchUpsertRowsRequestData
9+
from datadog_api_client.v2.model.batch_upsert_rows_request_data_attributes import BatchUpsertRowsRequestDataAttributes
10+
from datadog_api_client.v2.model.table_row_resource_data_type import TableRowResourceDataType
11+
12+
body = BatchUpsertRowsRequestArray(
13+
data=[
14+
BatchUpsertRowsRequestData(
15+
attributes=BatchUpsertRowsRequestDataAttributes(
16+
values=dict(
17+
example_key_value="primary_key_value",
18+
name="row_name",
19+
),
20+
),
21+
id="primary_key_value",
22+
type=TableRowResourceDataType.ROW,
23+
),
24+
],
25+
)
26+
27+
configuration = Configuration()
28+
with ApiClient(configuration) as api_client:
29+
api_instance = ReferenceTablesApi(api_client)
30+
api_instance.upsert_rows(id="id", body=body)

src/datadog_api_client/v2/api/reference_tables_api.py

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
from datadog_api_client.v2.model.table_result_v2 import TableResultV2
1717
from datadog_api_client.v2.model.create_table_request import CreateTableRequest
1818
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
1920
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
2022
from datadog_api_client.v2.model.create_upload_response import CreateUploadResponse
2123
from datadog_api_client.v2.model.create_upload_request import CreateUploadRequest
2224

@@ -71,6 +73,32 @@ def __init__(self, api_client=None):
7173
api_client=api_client,
7274
)
7375

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+
74102
self._delete_table_endpoint = _Endpoint(
75103
settings={
76104
"response_type": None,
@@ -227,6 +255,32 @@ def __init__(self, api_client=None):
227255
api_client=api_client,
228256
)
229257

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+
230284
def create_reference_table(
231285
self,
232286
body: CreateTableRequest,
@@ -264,6 +318,27 @@ def create_reference_table_upload(
264318

265319
return self._create_reference_table_upload_endpoint.call_with_http_info(**kwargs)
266320

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+
267342
def delete_table(
268343
self,
269344
id: str,
@@ -389,3 +464,24 @@ def update_reference_table(
389464
kwargs["body"] = body
390465

391466
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 will be updated; otherwise, a new row will be 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

Comments
 (0)