Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6806,6 +6806,72 @@ components:
required:
- data
type: object
BatchDeleteRowsRequestArray:
description: The request body for deleting multiple rows from a reference table.
properties:
data:
items:
$ref: '#/components/schemas/BatchDeleteRowsRequestData'
maxItems: 200
type: array
required:
- data
type: object
BatchDeleteRowsRequestData:
description: Row resource containing a single row identifier for deletion.
properties:
id:
example: primary_key_value
type: string
type:
$ref: '#/components/schemas/TableRowResourceDataType'
required:
- type
- id
type: object
BatchUpsertRowsRequestArray:
description: The request body for creating or updating multiple rows into a
reference table.
properties:
data:
items:
$ref: '#/components/schemas/BatchUpsertRowsRequestData'
maxItems: 200
type: array
required:
- data
type: object
BatchUpsertRowsRequestData:
description: Row resource containing a single row identifier and its column
values.
properties:
attributes:
$ref: '#/components/schemas/BatchUpsertRowsRequestDataAttributes'
id:
example: primary_key_value
type: string
type:
$ref: '#/components/schemas/TableRowResourceDataType'
required:
- type
- id
type: object
BatchUpsertRowsRequestDataAttributes:
description: Attributes containing row data values for row creation or update
operations.
properties:
values:
additionalProperties:
x-required-field: true
description: Key-value pairs representing row data, where keys are field
names from the schema.
example:
example_key_value: primary_key_value
name: row_name
type: object
required:
- values
type: object
BillConfig:
description: Bill config.
properties:
Expand Down Expand Up @@ -74549,6 +74615,47 @@ paths:
tags:
- Reference Tables
/api/v2/reference-tables/tables/{id}/rows:
delete:
description: Delete multiple rows from a Reference Table by their primary key
values.
operationId: DeleteRows
parameters:
- description: Unique identifier of the reference table to delete rows from
in: path
name: id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BatchDeleteRowsRequestArray'
required: true
responses:
'200':
description: Rows deleted successfully
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Internal Server Error
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Delete rows
tags:
- Reference Tables
get:
description: Get reference table rows by their primary key values.
operationId: GetRowsByID
Expand Down Expand Up @@ -74593,6 +74700,48 @@ paths:
summary: Get rows by id
tags:
- Reference Tables
post:
description: 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.
operationId: UpsertRows
parameters:
- description: Unique identifier of the reference table to upsert rows into
in: path
name: id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
required: true
responses:
'200':
description: Rows created or updated successfully
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Internal Server Error
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ: []
summary: Upsert rows
tags:
- Reference Tables
/api/v2/reference-tables/uploads:
post:
description: Create a reference table upload for bulk data ingestion
Expand Down
22 changes: 22 additions & 0 deletions examples/v2_reference-tables_DeleteRows.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Delete rows returns "Rows deleted successfully" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_reference_tables::ReferenceTablesAPI;
use datadog_api_client::datadogV2::model::BatchDeleteRowsRequestArray;
use datadog_api_client::datadogV2::model::BatchDeleteRowsRequestData;
use datadog_api_client::datadogV2::model::TableRowResourceDataType;

#[tokio::main]
async fn main() {
let body = BatchDeleteRowsRequestArray::new(vec![BatchDeleteRowsRequestData::new(
"primary_key_value".to_string(),
TableRowResourceDataType::ROW,
)]);
let configuration = datadog::Configuration::new();
let api = ReferenceTablesAPI::with_config(configuration);
let resp = api.delete_rows("id".to_string(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
32 changes: 32 additions & 0 deletions examples/v2_reference-tables_UpsertRows.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Upsert rows returns "Rows created or updated successfully" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_reference_tables::ReferenceTablesAPI;
use datadog_api_client::datadogV2::model::BatchUpsertRowsRequestArray;
use datadog_api_client::datadogV2::model::BatchUpsertRowsRequestData;
use datadog_api_client::datadogV2::model::BatchUpsertRowsRequestDataAttributes;
use datadog_api_client::datadogV2::model::TableRowResourceDataType;
use serde_json::Value;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
let body = BatchUpsertRowsRequestArray::new(vec![BatchUpsertRowsRequestData::new(
"primary_key_value".to_string(),
TableRowResourceDataType::ROW,
)
.attributes(BatchUpsertRowsRequestDataAttributes::new(BTreeMap::from([
(
"example_key_value".to_string(),
Value::from("primary_key_value"),
),
("name".to_string(), Value::from("row_name")),
])))]);
let configuration = datadog::Configuration::new();
let api = ReferenceTablesAPI::with_config(configuration);
let resp = api.upsert_rows("id".to_string(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Loading