Skip to content

Commit 33870a5

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5615e9c of spec repo
1 parent f59ccb4 commit 33870a5

File tree

13 files changed

+663
-0
lines changed

13 files changed

+663
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6806,6 +6806,72 @@ components:
68066806
required:
68076807
- data
68086808
type: object
6809+
BatchDeleteRowsRequestArray:
6810+
description: The request body for deleting multiple rows from a reference table.
6811+
properties:
6812+
data:
6813+
items:
6814+
$ref: '#/components/schemas/BatchDeleteRowsRequestData'
6815+
maxItems: 200
6816+
type: array
6817+
required:
6818+
- data
6819+
type: object
6820+
BatchDeleteRowsRequestData:
6821+
description: Row resource containing a single row identifier for deletion.
6822+
properties:
6823+
id:
6824+
example: primary_key_value
6825+
type: string
6826+
type:
6827+
$ref: '#/components/schemas/TableRowResourceDataType'
6828+
required:
6829+
- type
6830+
- id
6831+
type: object
6832+
BatchUpsertRowsRequestArray:
6833+
description: The request body for creating or updating multiple rows into a
6834+
reference table.
6835+
properties:
6836+
data:
6837+
items:
6838+
$ref: '#/components/schemas/BatchUpsertRowsRequestData'
6839+
maxItems: 200
6840+
type: array
6841+
required:
6842+
- data
6843+
type: object
6844+
BatchUpsertRowsRequestData:
6845+
description: Row resource containing a single row identifier and its column
6846+
values.
6847+
properties:
6848+
attributes:
6849+
$ref: '#/components/schemas/BatchUpsertRowsRequestDataAttributes'
6850+
id:
6851+
example: primary_key_value
6852+
type: string
6853+
type:
6854+
$ref: '#/components/schemas/TableRowResourceDataType'
6855+
required:
6856+
- type
6857+
- id
6858+
type: object
6859+
BatchUpsertRowsRequestDataAttributes:
6860+
description: Attributes containing row data values for row creation or update
6861+
operations.
6862+
properties:
6863+
values:
6864+
additionalProperties:
6865+
x-required-field: true
6866+
description: Key-value pairs representing row data, where keys are field
6867+
names from the schema.
6868+
example:
6869+
example_key_value: primary_key_value
6870+
name: row_name
6871+
type: object
6872+
required:
6873+
- values
6874+
type: object
68096875
BillConfig:
68106876
description: Bill config.
68116877
properties:
@@ -74549,6 +74615,47 @@ paths:
7454974615
tags:
7455074616
- Reference Tables
7455174617
/api/v2/reference-tables/tables/{id}/rows:
74618+
delete:
74619+
description: Delete multiple rows from a Reference Table by their primary key
74620+
values.
74621+
operationId: DeleteRows
74622+
parameters:
74623+
- description: Unique identifier of the reference table to delete rows from
74624+
in: path
74625+
name: id
74626+
required: true
74627+
schema:
74628+
type: string
74629+
requestBody:
74630+
content:
74631+
application/json:
74632+
schema:
74633+
$ref: '#/components/schemas/BatchDeleteRowsRequestArray'
74634+
required: true
74635+
responses:
74636+
'200':
74637+
description: Rows deleted successfully
74638+
'400':
74639+
$ref: '#/components/responses/BadRequestResponse'
74640+
'403':
74641+
$ref: '#/components/responses/ForbiddenResponse'
74642+
'404':
74643+
$ref: '#/components/responses/NotFoundResponse'
74644+
'429':
74645+
$ref: '#/components/responses/TooManyRequestsResponse'
74646+
'500':
74647+
content:
74648+
application/json:
74649+
schema:
74650+
$ref: '#/components/schemas/APIErrorResponse'
74651+
description: Internal Server Error
74652+
security:
74653+
- apiKeyAuth: []
74654+
appKeyAuth: []
74655+
- AuthZ: []
74656+
summary: Delete rows
74657+
tags:
74658+
- Reference Tables
7455274659
get:
7455374660
description: Get reference table rows by their primary key values.
7455474661
operationId: GetRowsByID
@@ -74593,6 +74700,48 @@ paths:
7459374700
summary: Get rows by id
7459474701
tags:
7459574702
- Reference Tables
74703+
post:
74704+
description: Create or update rows in a Reference Table by their primary key
74705+
values. If a row with the specified primary key exists, it is updated; otherwise,
74706+
a new row is created.
74707+
operationId: UpsertRows
74708+
parameters:
74709+
- description: Unique identifier of the reference table to upsert rows into
74710+
in: path
74711+
name: id
74712+
required: true
74713+
schema:
74714+
type: string
74715+
requestBody:
74716+
content:
74717+
application/json:
74718+
schema:
74719+
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
74720+
required: true
74721+
responses:
74722+
'200':
74723+
description: Rows created or updated successfully
74724+
'400':
74725+
$ref: '#/components/responses/BadRequestResponse'
74726+
'403':
74727+
$ref: '#/components/responses/ForbiddenResponse'
74728+
'404':
74729+
$ref: '#/components/responses/NotFoundResponse'
74730+
'429':
74731+
$ref: '#/components/responses/TooManyRequestsResponse'
74732+
'500':
74733+
content:
74734+
application/json:
74735+
schema:
74736+
$ref: '#/components/schemas/APIErrorResponse'
74737+
description: Internal Server Error
74738+
security:
74739+
- apiKeyAuth: []
74740+
appKeyAuth: []
74741+
- AuthZ: []
74742+
summary: Upsert rows
74743+
tags:
74744+
- Reference Tables
7459674745
/api/v2/reference-tables/uploads:
7459774746
post:
7459874747
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 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

Comments
 (0)