Skip to content

Commit 3c4f604

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit b9a5b7a of spec repo
1 parent 535c221 commit 3c4f604

4 files changed

Lines changed: 30 additions & 30 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7075,15 +7075,18 @@ components:
70757075
BatchUpsertRowsRequestDataAttributes:
70767076
description: Attributes containing row data values for row creation or update
70777077
operations.
7078+
example:
7079+
values: {}
70787080
properties:
70797081
values:
70807082
additionalProperties:
7081-
x-required-field: true
7082-
description: Key-value pairs representing row data, where keys are field
7083-
names from the schema.
7084-
example:
7085-
example_key_value: primary_key_value
7086-
name: row_name
7083+
oneOf:
7084+
- type: string
7085+
- format: int32
7086+
maximum: 2147483647
7087+
type: integer
7088+
description: Key-value pairs representing row data, where keys are schema
7089+
field names and values match the corresponding column types.
70877090
type: object
70887091
required:
70897092
- values
@@ -79331,6 +79334,18 @@ paths:
7933179334
requestBody:
7933279335
content:
7933379336
application/json:
79337+
examples:
79338+
happy_path:
79339+
summary: Upsert a row with mixed string and int values
79340+
value:
79341+
data:
79342+
- attributes:
79343+
values:
79344+
age: 25
79345+
example_key_value: primary_key_value
79346+
name: row_name
79347+
id: primary_key_value
79348+
type: row
7933479349
schema:
7933579350
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
7933679351
required: true

examples/v2/reference-tables/UpsertRows.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
data=[
1414
BatchUpsertRowsRequestData(
1515
attributes=BatchUpsertRowsRequestDataAttributes(
16-
values=dict(
17-
example_key_value="primary_key_value",
18-
name="row_name",
19-
),
16+
values=dict(),
2017
),
2118
id="primary_key_value",
2219
type=TableRowResourceDataType.ROW,

src/datadog_api_client/v2/model/batch_upsert_rows_request_data_attributes.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Any, Dict
6+
from typing import Dict, Union
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
1010
cached_property,
11-
date,
12-
datetime,
13-
none_type,
14-
UUID,
1511
)
1612

1713

@@ -22,16 +18,8 @@ def openapi_types(_):
2218
"values": (
2319
{
2420
str: (
25-
bool,
26-
date,
27-
datetime,
28-
dict,
29-
float,
30-
int,
31-
list,
3221
str,
33-
UUID,
34-
none_type,
22+
int,
3523
)
3624
},
3725
),
@@ -41,12 +29,12 @@ def openapi_types(_):
4129
"values": "values",
4230
}
4331

44-
def __init__(self_, values: Dict[str, Any], **kwargs):
32+
def __init__(self_, values: Dict[str, Union[str, int]], **kwargs):
4533
"""
4634
Attributes containing row data values for row creation or update operations.
4735
48-
:param values: Key-value pairs representing row data, where keys are field names from the schema.
49-
:type values: {str: (bool, date, datetime, dict, float, int, list, str, UUID, none_type,)}
36+
:param values: Key-value pairs representing row data, where keys are schema field names and values match the corresponding column types.
37+
:type values: {str: (str, int,)}
5038
"""
5139
super().__init__(kwargs)
5240

tests/v2/features/reference_tables.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,22 +148,22 @@ Feature: Reference Tables
148148
Scenario: Upsert rows returns "Bad Request" response
149149
Given new "UpsertRows" request
150150
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"}]}
151+
And body with value {"data": [{"attributes": {"values": {}}, "id": "primary_key_value", "type": "row"}]}
152152
When the request is sent
153153
Then the response status is 400 Bad Request
154154

155155
@generated @skip @team:DataDog/redapl-experiences
156156
Scenario: Upsert rows returns "Not Found" response
157157
Given new "UpsertRows" request
158158
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"}]}
159+
And body with value {"data": [{"attributes": {"values": {}}, "id": "primary_key_value", "type": "row"}]}
160160
When the request is sent
161161
Then the response status is 404 Not Found
162162

163163
@generated @skip @team:DataDog/redapl-experiences
164164
Scenario: Upsert rows returns "Rows created or updated successfully" response
165165
Given new "UpsertRows" request
166166
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"}]}
167+
And body with value {"data": [{"attributes": {"values": {}}, "id": "primary_key_value", "type": "row"}]}
168168
When the request is sent
169169
Then the response status is 200 Rows created or updated successfully

0 commit comments

Comments
 (0)