Skip to content

Commit 1c27d7a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0690b9e of spec repo
1 parent 9c31ab9 commit 1c27d7a

File tree

13 files changed

+1075
-0
lines changed

13 files changed

+1075
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6788,6 +6788,71 @@ 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+
maxItems: 100
6821+
type: array
6822+
required:
6823+
- data
6824+
type: object
6825+
BatchUpsertRowsRequestData:
6826+
description: Row resource containing a single row identifier and its column
6827+
values.
6828+
properties:
6829+
attributes:
6830+
$ref: '#/components/schemas/BatchUpsertRowsRequestDataAttributes'
6831+
id:
6832+
example: primary_key_value
6833+
type: string
6834+
type:
6835+
$ref: '#/components/schemas/TableRowResourceDataType'
6836+
required:
6837+
- type
6838+
- id
6839+
type: object
6840+
BatchUpsertRowsRequestDataAttributes:
6841+
description: Attributes containing row data values for row creation or update
6842+
operations.
6843+
properties:
6844+
values:
6845+
additionalProperties:
6846+
x-required-field: true
6847+
description: Key-value pairs representing row data, where keys are field
6848+
names from the schema.
6849+
example:
6850+
example_key_value: primary_key_value
6851+
name: row_name
6852+
type: object
6853+
required:
6854+
- values
6855+
type: object
67916856
BillConfig:
67926857
description: Bill config.
67936858
properties:
@@ -73631,6 +73696,47 @@ paths:
7363173696
tags:
7363273697
- Reference Tables
7363373698
/api/v2/reference-tables/tables/{id}/rows:
73699+
delete:
73700+
description: Delete multiple rows from a reference table by their primary key
73701+
values.
73702+
operationId: DeleteRows
73703+
parameters:
73704+
- description: Unique identifier of the reference table to delete rows from
73705+
in: path
73706+
name: id
73707+
required: true
73708+
schema:
73709+
type: string
73710+
requestBody:
73711+
content:
73712+
application/json:
73713+
schema:
73714+
$ref: '#/components/schemas/BatchDeleteRowsRequestArray'
73715+
required: true
73716+
responses:
73717+
'200':
73718+
description: Rows deleted successfully
73719+
'400':
73720+
$ref: '#/components/responses/BadRequestResponse'
73721+
'403':
73722+
$ref: '#/components/responses/ForbiddenResponse'
73723+
'404':
73724+
$ref: '#/components/responses/NotFoundResponse'
73725+
'429':
73726+
$ref: '#/components/responses/TooManyRequestsResponse'
73727+
'500':
73728+
content:
73729+
application/json:
73730+
schema:
73731+
$ref: '#/components/schemas/APIErrorResponse'
73732+
description: Internal Server Error
73733+
security:
73734+
- apiKeyAuth: []
73735+
appKeyAuth: []
73736+
- AuthZ: []
73737+
summary: Delete rows
73738+
tags:
73739+
- Reference Tables
7363473740
get:
7363573741
description: Get reference table rows by their primary key values.
7363673742
operationId: GetRowsByID
@@ -73675,6 +73781,48 @@ paths:
7367573781
summary: Get rows by id
7367673782
tags:
7367773783
- Reference Tables
73784+
post:
73785+
description: Create or update rows in a Reference Table by their primary key
73786+
values. If a row with the specified primary key exists, it will be updated;
73787+
otherwise, a new row will be created. Maximum 100 rows per request.
73788+
operationId: UpsertRows
73789+
parameters:
73790+
- description: Unique identifier of the reference table to upsert rows into
73791+
in: path
73792+
name: id
73793+
required: true
73794+
schema:
73795+
type: string
73796+
requestBody:
73797+
content:
73798+
application/json:
73799+
schema:
73800+
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
73801+
required: true
73802+
responses:
73803+
'200':
73804+
description: Rows created or updated successfully
73805+
'400':
73806+
$ref: '#/components/responses/BadRequestResponse'
73807+
'403':
73808+
$ref: '#/components/responses/ForbiddenResponse'
73809+
'404':
73810+
$ref: '#/components/responses/NotFoundResponse'
73811+
'429':
73812+
$ref: '#/components/responses/TooManyRequestsResponse'
73813+
'500':
73814+
content:
73815+
application/json:
73816+
schema:
73817+
$ref: '#/components/schemas/APIErrorResponse'
73818+
description: Internal Server Error
73819+
security:
73820+
- apiKeyAuth: []
73821+
appKeyAuth: []
73822+
- AuthZ: []
73823+
summary: Upsert rows
73824+
tags:
73825+
- Reference Tables
7367873826
/api/v2/reference-tables/uploads:
7367973827
post:
7368073828
description: Create a reference table upload for bulk data ingestion
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Delete rows returns "Rows deleted successfully" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new
5+
6+
body = DatadogAPIClient::V2::BatchDeleteRowsRequestArray.new({
7+
data: [
8+
DatadogAPIClient::V2::BatchDeleteRowsRequestData.new({
9+
id: "primary_key_value",
10+
type: DatadogAPIClient::V2::TableRowResourceDataType::ROW,
11+
}),
12+
],
13+
})
14+
p api_instance.delete_rows("id", body)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Upsert rows returns "Rows created or updated successfully" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new
5+
6+
body = DatadogAPIClient::V2::BatchUpsertRowsRequestArray.new({
7+
data: [
8+
DatadogAPIClient::V2::BatchUpsertRowsRequestData.new({
9+
attributes: DatadogAPIClient::V2::BatchUpsertRowsRequestDataAttributes.new({
10+
values: {
11+
example_key_value: "primary_key_value", name: "row_name",
12+
},
13+
}),
14+
id: "primary_key_value",
15+
type: DatadogAPIClient::V2::TableRowResourceDataType::ROW,
16+
}),
17+
],
18+
})
19+
p api_instance.upsert_rows("id", body)

features/scenarios_model_mapping.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,10 +2722,18 @@
27222722
"id" => "String",
27232723
"body" => "PatchTableRequest",
27242724
},
2725+
"v2.DeleteRows" => {
2726+
"id" => "String",
2727+
"body" => "BatchDeleteRowsRequestArray",
2728+
},
27252729
"v2.GetRowsByID" => {
27262730
"id" => "String",
27272731
"row_id" => "Array<String>",
27282732
},
2733+
"v2.UpsertRows" => {
2734+
"id" => "String",
2735+
"body" => "BatchUpsertRowsRequestArray",
2736+
},
27292737
"v2.CreateReferenceTableUpload" => {
27302738
"body" => "CreateUploadRequest",
27312739
},

features/v2/reference_tables.feature

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@ Feature: Reference Tables
5353
When the request is sent
5454
Then the response status is 400 Bad Request
5555

56+
@generated @skip @team:DataDog/redapl-experiences
57+
Scenario: Delete rows returns "Bad Request" response
58+
Given new "DeleteRows" request
59+
And request contains "id" parameter from "REPLACE.ME"
60+
And body with value {"data": [{"id": "primary_key_value", "type": "row"}]}
61+
When the request is sent
62+
Then the response status is 400 Bad Request
63+
64+
@generated @skip @team:DataDog/redapl-experiences
65+
Scenario: Delete rows returns "Not Found" response
66+
Given new "DeleteRows" request
67+
And request contains "id" parameter from "REPLACE.ME"
68+
And body with value {"data": [{"id": "primary_key_value", "type": "row"}]}
69+
When the request is sent
70+
Then the response status is 404 Not Found
71+
72+
@generated @skip @team:DataDog/redapl-experiences
73+
Scenario: Delete rows returns "Rows deleted successfully" response
74+
Given new "DeleteRows" request
75+
And request contains "id" parameter from "REPLACE.ME"
76+
And body with value {"data": [{"id": "primary_key_value", "type": "row"}]}
77+
When the request is sent
78+
Then the response status is 200 Rows deleted successfully
79+
5680
@generated @skip @team:DataDog/redapl-experiences
5781
Scenario: Delete table returns "Not Found" response
5882
Given new "DeleteTable" request
@@ -119,3 +143,27 @@ Feature: Reference Tables
119143
And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "type": "reference_table"}}
120144
When the request is sent
121145
Then the response status is 200 OK
146+
147+
@generated @skip @team:DataDog/redapl-experiences
148+
Scenario: Upsert rows returns "Bad Request" response
149+
Given new "UpsertRows" request
150+
And request contains "id" parameter from "REPLACE.ME"
151+
And body with value {"data": [{"attributes": {"values": {"example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]}
152+
When the request is sent
153+
Then the response status is 400 Bad Request
154+
155+
@generated @skip @team:DataDog/redapl-experiences
156+
Scenario: Upsert rows returns "Not Found" response
157+
Given new "UpsertRows" request
158+
And request contains "id" parameter from "REPLACE.ME"
159+
And body with value {"data": [{"attributes": {"values": {"example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]}
160+
When the request is sent
161+
Then the response status is 404 Not Found
162+
163+
@generated @skip @team:DataDog/redapl-experiences
164+
Scenario: Upsert rows returns "Rows created or updated successfully" response
165+
Given new "UpsertRows" request
166+
And request contains "id" parameter from "REPLACE.ME"
167+
And body with value {"data": [{"attributes": {"values": {"example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]}
168+
When the request is sent
169+
Then the response status is 200 Rows created or updated successfully

features/v2/undo.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,12 +3012,26 @@
30123012
"type": "idempotent"
30133013
}
30143014
},
3015+
"DeleteRows": {
3016+
"tag": "Reference Tables",
3017+
"undo": {
3018+
"type": "idempotent"
3019+
}
3020+
},
30153021
"GetRowsByID": {
30163022
"tag": "Reference Tables",
30173023
"undo": {
30183024
"type": "safe"
30193025
}
30203026
},
3027+
"UpsertRows": {
3028+
"tag": "Reference Tables",
3029+
"undo": {
3030+
"operationId": "DeleteRows",
3031+
"parameters": [],
3032+
"type": "unsafe"
3033+
}
3034+
},
30213035
"CreateReferenceTableUpload": {
30223036
"tag": "Reference Tables",
30233037
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,11 @@ def overrides
13051305
"v2.azure_uc_config_post_request_attributes" => "AzureUCConfigPostRequestAttributes",
13061306
"v2.azure_uc_config_post_request_type" => "AzureUCConfigPostRequestType",
13071307
"v2.azure_uc_configs_response" => "AzureUCConfigsResponse",
1308+
"v2.batch_delete_rows_request_array" => "BatchDeleteRowsRequestArray",
1309+
"v2.batch_delete_rows_request_data" => "BatchDeleteRowsRequestData",
1310+
"v2.batch_upsert_rows_request_array" => "BatchUpsertRowsRequestArray",
1311+
"v2.batch_upsert_rows_request_data" => "BatchUpsertRowsRequestData",
1312+
"v2.batch_upsert_rows_request_data_attributes" => "BatchUpsertRowsRequestDataAttributes",
13081313
"v2.bill_config" => "BillConfig",
13091314
"v2.billing_dimensions_mapping_body_item" => "BillingDimensionsMappingBodyItem",
13101315
"v2.billing_dimensions_mapping_body_item_attributes" => "BillingDimensionsMappingBodyItemAttributes",

0 commit comments

Comments
 (0)