Skip to content

Commit 336971c

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 1768968 of spec repo
1 parent fa7ee06 commit 336971c

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
@@ -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:
@@ -74529,6 +74595,47 @@ paths:
7452974595
tags:
7453074596
- Reference Tables
7453174597
/api/v2/reference-tables/tables/{id}/rows:
74598+
delete:
74599+
description: Delete multiple rows from a Reference Table by their primary key
74600+
values.
74601+
operationId: DeleteRows
74602+
parameters:
74603+
- description: Unique identifier of the reference table to delete rows from
74604+
in: path
74605+
name: id
74606+
required: true
74607+
schema:
74608+
type: string
74609+
requestBody:
74610+
content:
74611+
application/json:
74612+
schema:
74613+
$ref: '#/components/schemas/BatchDeleteRowsRequestArray'
74614+
required: true
74615+
responses:
74616+
'200':
74617+
description: Rows deleted successfully
74618+
'400':
74619+
$ref: '#/components/responses/BadRequestResponse'
74620+
'403':
74621+
$ref: '#/components/responses/ForbiddenResponse'
74622+
'404':
74623+
$ref: '#/components/responses/NotFoundResponse'
74624+
'429':
74625+
$ref: '#/components/responses/TooManyRequestsResponse'
74626+
'500':
74627+
content:
74628+
application/json:
74629+
schema:
74630+
$ref: '#/components/schemas/APIErrorResponse'
74631+
description: Internal Server Error
74632+
security:
74633+
- apiKeyAuth: []
74634+
appKeyAuth: []
74635+
- AuthZ: []
74636+
summary: Delete rows
74637+
tags:
74638+
- Reference Tables
7453274639
get:
7453374640
description: Get reference table rows by their primary key values.
7453474641
operationId: GetRowsByID
@@ -74573,6 +74680,48 @@ paths:
7457374680
summary: Get rows by id
7457474681
tags:
7457574682
- Reference Tables
74683+
post:
74684+
description: Create or update rows in a Reference Table by their primary key
74685+
values. If a row with the specified primary key exists, it is updated; otherwise,
74686+
a new row is created.
74687+
operationId: UpsertRows
74688+
parameters:
74689+
- description: Unique identifier of the reference table to upsert rows into
74690+
in: path
74691+
name: id
74692+
required: true
74693+
schema:
74694+
type: string
74695+
requestBody:
74696+
content:
74697+
application/json:
74698+
schema:
74699+
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
74700+
required: true
74701+
responses:
74702+
'200':
74703+
description: Rows created or updated successfully
74704+
'400':
74705+
$ref: '#/components/responses/BadRequestResponse'
74706+
'403':
74707+
$ref: '#/components/responses/ForbiddenResponse'
74708+
'404':
74709+
$ref: '#/components/responses/NotFoundResponse'
74710+
'429':
74711+
$ref: '#/components/responses/TooManyRequestsResponse'
74712+
'500':
74713+
content:
74714+
application/json:
74715+
schema:
74716+
$ref: '#/components/schemas/APIErrorResponse'
74717+
description: Internal Server Error
74718+
security:
74719+
- apiKeyAuth: []
74720+
appKeyAuth: []
74721+
- AuthZ: []
74722+
summary: Upsert rows
74723+
tags:
74724+
- Reference Tables
7457674725
/api/v2/reference-tables/uploads:
7457774726
post:
7457874727
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)