Skip to content
Merged
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
32 changes: 26 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7075,19 +7075,27 @@ components:
BatchUpsertRowsRequestDataAttributes:
description: Attributes containing row data values for row creation or update
operations.
example:
values: {}
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
$ref: '#/components/schemas/BatchUpsertRowsRequestDataAttributesValue'
description: Key-value pairs representing row data, where keys are schema
field names and values match the corresponding column types.
type: object
required:
- values
type: object
BatchUpsertRowsRequestDataAttributesValue:
description: Types allowed for Reference Table row values.
oneOf:
- example: row_name
type: string
- example: 25
format: int32
maximum: 2147483647
type: integer
BillConfig:
description: Bill config.
properties:
Expand Down Expand Up @@ -79331,6 +79339,18 @@ paths:
requestBody:
content:
application/json:
examples:
happy_path:
summary: Upsert a row with mixed string and int values
value:
data:
- attributes:
values:
age: 25
example_key_value: primary_key_value
name: row_name
id: primary_key_value
type: row
schema:
$ref: '#/components/schemas/BatchUpsertRowsRequestArray'
required: true
Expand Down
6 changes: 1 addition & 5 deletions examples/v2/reference-tables/UpsertRows.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ public static void main(String[] args) {
Collections.singletonList(
new BatchUpsertRowsRequestData()
.attributes(
new BatchUpsertRowsRequestDataAttributes()
.values(
Map.ofEntries(
Map.entry("example_key_value", "primary_key_value"),
Map.entry("name", "row_name"))))
new BatchUpsertRowsRequestDataAttributes().values(Map.ofEntries()))
.id("primary_key_value")
.type(TableRowResourceDataType.ROW)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,43 @@
public class BatchUpsertRowsRequestDataAttributes {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_VALUES = "values";
private Map<String, Object> values = new HashMap<String, Object>();
private Map<String, BatchUpsertRowsRequestDataAttributesValue> values =
new HashMap<String, BatchUpsertRowsRequestDataAttributesValue>();

public BatchUpsertRowsRequestDataAttributes() {}

@JsonCreator
public BatchUpsertRowsRequestDataAttributes(
@JsonProperty(required = true, value = JSON_PROPERTY_VALUES) Map<String, Object> values) {
@JsonProperty(required = true, value = JSON_PROPERTY_VALUES)
Map<String, BatchUpsertRowsRequestDataAttributesValue> values) {
this.values = values;
}

public BatchUpsertRowsRequestDataAttributes values(Map<String, Object> values) {
public BatchUpsertRowsRequestDataAttributes values(
Map<String, BatchUpsertRowsRequestDataAttributesValue> values) {
this.values = values;
return this;
}

public BatchUpsertRowsRequestDataAttributes putValuesItem(String key, Object valuesItem) {
public BatchUpsertRowsRequestDataAttributes putValuesItem(
String key, BatchUpsertRowsRequestDataAttributesValue valuesItem) {
this.values.put(key, valuesItem);
return this;
}

/**
* Key-value pairs representing row data, where keys are field names from the schema.
* Key-value pairs representing row data, where keys are schema field names and values match the
* corresponding column types.
*
* @return values
*/
@JsonProperty(JSON_PROPERTY_VALUES)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Map<String, Object> getValues() {
public Map<String, BatchUpsertRowsRequestDataAttributesValue> getValues() {
return values;
}

public void setValues(Map<String, Object> values) {
public void setValues(Map<String, BatchUpsertRowsRequestDataAttributesValue> values) {
this.values = values;
}

Expand Down
Loading
Loading