Skip to content

Commit 2cfbbfb

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d84699c of spec repo
1 parent 5f0c0ef commit 2cfbbfb

File tree

11 files changed

+1440
-0
lines changed

11 files changed

+1440
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6788,6 +6788,72 @@ 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+
maxItems: 200
6798+
type: array
6799+
required:
6800+
- data
6801+
type: object
6802+
BatchDeleteRowsRequestData:
6803+
description: Row resource containing a single row identifier for deletion.
6804+
properties:
6805+
id:
6806+
example: primary_key_value
6807+
type: string
6808+
type:
6809+
$ref: '#/components/schemas/TableRowResourceDataType'
6810+
required:
6811+
- type
6812+
- id
6813+
type: object
6814+
BatchUpsertRowsRequestArray:
6815+
description: The request body for creating or updating multiple rows into a
6816+
reference table.
6817+
properties:
6818+
data:
6819+
items:
6820+
$ref: '#/components/schemas/BatchUpsertRowsRequestData'
6821+
maxItems: 200
6822+
type: array
6823+
required:
6824+
- data
6825+
type: object
6826+
BatchUpsertRowsRequestData:
6827+
description: Row resource containing a single row identifier and its column
6828+
values.
6829+
properties:
6830+
attributes:
6831+
$ref: '#/components/schemas/BatchUpsertRowsRequestDataAttributes'
6832+
id:
6833+
example: primary_key_value
6834+
type: string
6835+
type:
6836+
$ref: '#/components/schemas/TableRowResourceDataType'
6837+
required:
6838+
- type
6839+
- id
6840+
type: object
6841+
BatchUpsertRowsRequestDataAttributes:
6842+
description: Attributes containing row data values for row creation or update
6843+
operations.
6844+
properties:
6845+
values:
6846+
additionalProperties:
6847+
x-required-field: true
6848+
description: Key-value pairs representing row data, where keys are field
6849+
names from the schema.
6850+
example:
6851+
example_key_value: primary_key_value
6852+
name: row_name
6853+
type: object
6854+
required:
6855+
- values
6856+
type: object
67916857
BillConfig:
67926858
description: Bill config.
67936859
properties:
@@ -73670,6 +73736,47 @@ paths:
7367073736
tags:
7367173737
- Reference Tables
7367273738
/api/v2/reference-tables/tables/{id}/rows:
73739+
delete:
73740+
description: Delete multiple rows from a Reference Table by their primary key
73741+
values.
73742+
operationId: DeleteRows
73743+
parameters:
73744+
- description: Unique identifier of the reference table to delete rows from
73745+
in: path
73746+
name: id
73747+
required: true
73748+
schema:
73749+
type: string
73750+
requestBody:
73751+
content:
73752+
application/json:
73753+
schema:
73754+
$ref: '#/components/schemas/BatchDeleteRowsRequestArray'
73755+
required: true
73756+
responses:
73757+
'200':
73758+
description: Rows deleted successfully
73759+
'400':
73760+
$ref: '#/components/responses/BadRequestResponse'
73761+
'403':
73762+
$ref: '#/components/responses/ForbiddenResponse'
73763+
'404':
73764+
$ref: '#/components/responses/NotFoundResponse'
73765+
'429':
73766+
$ref: '#/components/responses/TooManyRequestsResponse'
73767+
'500':
73768+
content:
73769+
application/json:
73770+
schema:
73771+
$ref: '#/components/schemas/APIErrorResponse'
73772+
description: Internal Server Error
73773+
security:
73774+
- apiKeyAuth: []
73775+
appKeyAuth: []
73776+
- AuthZ: []
73777+
summary: Delete rows
73778+
tags:
73779+
- Reference Tables
7367373780
get:
7367473781
description: Get reference table rows by their primary key values.
7367573782
operationId: GetRowsByID
@@ -73714,6 +73821,48 @@ paths:
7371473821
summary: Get rows by id
7371573822
tags:
7371673823
- Reference Tables
73824+
post:
73825+
description: Create or update rows in a Reference Table by their primary key
73826+
values. If a row with the specified primary key exists, it will be updated;
73827+
otherwise, a new row will be created.
73828+
operationId: UpsertRows
73829+
parameters:
73830+
- description: Unique identifier of the reference table to upsert rows into
73831+
in: path
73832+
name: id
73833+
required: true
73834+
schema:
73835+
type: string
73836+
requestBody:
73837+
content:
73838+
application/json:
73839+
schema:
73840+
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
73841+
required: true
73842+
responses:
73843+
'200':
73844+
description: Rows created or updated successfully
73845+
'400':
73846+
$ref: '#/components/responses/BadRequestResponse'
73847+
'403':
73848+
$ref: '#/components/responses/ForbiddenResponse'
73849+
'404':
73850+
$ref: '#/components/responses/NotFoundResponse'
73851+
'429':
73852+
$ref: '#/components/responses/TooManyRequestsResponse'
73853+
'500':
73854+
content:
73855+
application/json:
73856+
schema:
73857+
$ref: '#/components/schemas/APIErrorResponse'
73858+
description: Internal Server Error
73859+
security:
73860+
- apiKeyAuth: []
73861+
appKeyAuth: []
73862+
- AuthZ: []
73863+
summary: Upsert rows
73864+
tags:
73865+
- Reference Tables
7371773866
/api/v2/reference-tables/uploads:
7371873867
post:
7371973868
description: Create a reference table upload for bulk data ingestion
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Delete rows returns "Rows deleted successfully" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ReferenceTablesApi;
6+
import com.datadog.api.client.v2.model.BatchDeleteRowsRequestArray;
7+
import com.datadog.api.client.v2.model.BatchDeleteRowsRequestData;
8+
import com.datadog.api.client.v2.model.TableRowResourceDataType;
9+
import java.util.Collections;
10+
11+
public class Example {
12+
public static void main(String[] args) {
13+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
14+
ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient);
15+
16+
BatchDeleteRowsRequestArray body =
17+
new BatchDeleteRowsRequestArray()
18+
.data(
19+
Collections.singletonList(
20+
new BatchDeleteRowsRequestData()
21+
.id("primary_key_value")
22+
.type(TableRowResourceDataType.ROW)));
23+
24+
try {
25+
apiInstance.deleteRows("id", body);
26+
} catch (ApiException e) {
27+
System.err.println("Exception when calling ReferenceTablesApi#deleteRows");
28+
System.err.println("Status code: " + e.getCode());
29+
System.err.println("Reason: " + e.getResponseBody());
30+
System.err.println("Response headers: " + e.getResponseHeaders());
31+
e.printStackTrace();
32+
}
33+
}
34+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Upsert rows returns "Rows created or updated successfully" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.ReferenceTablesApi;
6+
import com.datadog.api.client.v2.model.BatchUpsertRowsRequestArray;
7+
import com.datadog.api.client.v2.model.BatchUpsertRowsRequestData;
8+
import com.datadog.api.client.v2.model.BatchUpsertRowsRequestDataAttributes;
9+
import com.datadog.api.client.v2.model.TableRowResourceDataType;
10+
import java.util.Collections;
11+
import java.util.Map;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient);
17+
18+
BatchUpsertRowsRequestArray body =
19+
new BatchUpsertRowsRequestArray()
20+
.data(
21+
Collections.singletonList(
22+
new BatchUpsertRowsRequestData()
23+
.attributes(
24+
new BatchUpsertRowsRequestDataAttributes()
25+
.values(
26+
Map.ofEntries(
27+
Map.entry("example_key_value", "primary_key_value"),
28+
Map.entry("name", "row_name"))))
29+
.id("primary_key_value")
30+
.type(TableRowResourceDataType.ROW)));
31+
32+
try {
33+
apiInstance.upsertRows("id", body);
34+
} catch (ApiException e) {
35+
System.err.println("Exception when calling ReferenceTablesApi#upsertRows");
36+
System.err.println("Status code: " + e.getCode());
37+
System.err.println("Reason: " + e.getResponseBody());
38+
System.err.println("Response headers: " + e.getResponseHeaders());
39+
e.printStackTrace();
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)