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 @@ -3018,6 +3018,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 @@ -3055,6 +3057,8 @@ components:
- name
- service
- stat
- operation_name
- group_by
type: object
FormulaAndFunctionCloudCostDataSource:
description: Data source for Cloud Cost queries.
Expand Down
4 changes: 4 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4447,6 +4447,8 @@ components:
type: string
group_by:
description: Tag keys to group results by.
example:
- resource_name
items:
description: A tag key to group by.
example: resource_name
Expand Down Expand Up @@ -4484,6 +4486,8 @@ components:
- env
- service
- stat
- operation_name
- group_by
type: object
ApmRetentionFilterType:
default: apm_retention_filter
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
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class ApmResourceStatsQuery {
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 @@ -76,13 +76,17 @@ public ApmResourceStatsQuery(
@JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE)
ApmResourceStatsDataSource 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) ApmResourceStatName 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 @@ -138,9 +142,6 @@ public ApmResourceStatsQuery groupBy(List<String> groupBy) {
}

public ApmResourceStatsQuery addGroupByItem(String groupByItem) {
if (this.groupBy == null) {
this.groupBy = new ArrayList<>();
}
this.groupBy.add(groupByItem);
return this;
}
Expand All @@ -150,9 +151,8 @@ public ApmResourceStatsQuery addGroupByItem(String groupByItem) {
*
* @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 @@ -191,9 +191,8 @@ public ApmResourceStatsQuery operationName(String operationName) {
*
* @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