Skip to content

Commit 13ab127

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5615e9c of spec repo
1 parent b66a3ce commit 13ab127

File tree

13 files changed

+1080
-0
lines changed

13 files changed

+1080
-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
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
@@ -2752,10 +2752,18 @@
27522752
"id" => "String",
27532753
"body" => "PatchTableRequest",
27542754
},
2755+
"v2.DeleteRows" => {
2756+
"id" => "String",
2757+
"body" => "BatchDeleteRowsRequestArray",
2758+
},
27552759
"v2.GetRowsByID" => {
27562760
"id" => "String",
27572761
"row_id" => "Array<String>",
27582762
},
2763+
"v2.UpsertRows" => {
2764+
"id" => "String",
2765+
"body" => "BatchUpsertRowsRequestArray",
2766+
},
27592767
"v2.CreateReferenceTableUpload" => {
27602768
"body" => "CreateUploadRequest",
27612769
},

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
@@ -3089,12 +3089,26 @@
30893089
"type": "idempotent"
30903090
}
30913091
},
3092+
"DeleteRows": {
3093+
"tag": "Reference Tables",
3094+
"undo": {
3095+
"type": "idempotent"
3096+
}
3097+
},
30923098
"GetRowsByID": {
30933099
"tag": "Reference Tables",
30943100
"undo": {
30953101
"type": "safe"
30963102
}
30973103
},
3104+
"UpsertRows": {
3105+
"tag": "Reference Tables",
3106+
"undo": {
3107+
"operationId": "DeleteRows",
3108+
"parameters": [],
3109+
"type": "unsafe"
3110+
}
3111+
},
30983112
"CreateReferenceTableUpload": {
30993113
"tag": "Reference Tables",
31003114
"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)