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
4 changes: 4 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2875,6 +2875,8 @@ components:
type: string
group_by:
description: Array of fields to group results by.
example:
- "resource_name"
items:
description: Field to group results by.
example: "resource_name"
Expand Down Expand Up @@ -2912,6 +2914,8 @@ components:
- name
- service
- stat
- operation_name
- group_by
type: object
FormulaAndFunctionCloudCostDataSource:
description: Data source for Cloud Cost queries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class FormulaAndFunctionApmResourceStatsQueryDefinition {
private String env;

public static final String JSON_PROPERTY_GROUP_BY = "group_by";
private List<String> groupBy = null;
private List<String> groupBy = new ArrayList<>();

public static final String JSON_PROPERTY_NAME = "name";
private String name;
Expand Down Expand Up @@ -77,14 +77,18 @@ public FormulaAndFunctionApmResourceStatsQueryDefinition(
@JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE)
FormulaAndFunctionApmResourceStatsDataSource dataSource,
@JsonProperty(required = true, value = JSON_PROPERTY_ENV) String env,
@JsonProperty(required = true, value = JSON_PROPERTY_GROUP_BY) List<String> groupBy,
@JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name,
@JsonProperty(required = true, value = JSON_PROPERTY_OPERATION_NAME) String operationName,
@JsonProperty(required = true, value = JSON_PROPERTY_SERVICE) String service,
@JsonProperty(required = true, value = JSON_PROPERTY_STAT)
FormulaAndFunctionApmResourceStatName stat) {
this.dataSource = dataSource;
this.unparsed |= !dataSource.isValid();
this.env = env;
this.groupBy = groupBy;
this.name = name;
this.operationName = operationName;
this.service = service;
this.stat = stat;
this.unparsed |= !stat.isValid();
Expand Down Expand Up @@ -172,9 +176,6 @@ public FormulaAndFunctionApmResourceStatsQueryDefinition groupBy(List<String> gr
}

public FormulaAndFunctionApmResourceStatsQueryDefinition addGroupByItem(String groupByItem) {
if (this.groupBy == null) {
this.groupBy = new ArrayList<>();
}
this.groupBy.add(groupByItem);
return this;
}
Expand All @@ -184,9 +185,8 @@ public FormulaAndFunctionApmResourceStatsQueryDefinition addGroupByItem(String g
*
* @return groupBy
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_GROUP_BY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public List<String> getGroupBy() {
return groupBy;
}
Expand Down Expand Up @@ -225,9 +225,8 @@ public FormulaAndFunctionApmResourceStatsQueryDefinition operationName(String op
*
* @return operationName
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_OPERATION_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getOperationName() {
return operationName;
}
Expand Down
Loading