com.huaweicloud.sdk.aom.v2.model.CountEventsResponse Maven / Gradle / Ivy
package com.huaweicloud.sdk.aom.v2.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;
/**
* Response Object
*/
public class CountEventsResponse extends SdkResponse {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "step")
private Long step;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "timestamps")
private List timestamps = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "series")
private List series = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "summary")
private Map summary = null;
public CountEventsResponse withStep(Long step) {
this.step = step;
return this;
}
/**
* 统计步长。毫秒数,例如一分钟则填写为60000。
* @return step
*/
public Long getStep() {
return step;
}
public void setStep(Long step) {
this.step = step;
}
public CountEventsResponse withTimestamps(List timestamps) {
this.timestamps = timestamps;
return this;
}
public CountEventsResponse addTimestampsItem(Long timestampsItem) {
if (this.timestamps == null) {
this.timestamps = new ArrayList<>();
}
this.timestamps.add(timestampsItem);
return this;
}
public CountEventsResponse withTimestamps(Consumer> timestampsSetter) {
if (this.timestamps == null) {
this.timestamps = new ArrayList<>();
}
timestampsSetter.accept(this.timestamps);
return this;
}
/**
* 统计结果对应的时间序列。
* @return timestamps
*/
public List getTimestamps() {
return timestamps;
}
public void setTimestamps(List timestamps) {
this.timestamps = timestamps;
}
public CountEventsResponse withSeries(List series) {
this.series = series;
return this;
}
public CountEventsResponse addSeriesItem(EventSeries seriesItem) {
if (this.series == null) {
this.series = new ArrayList<>();
}
this.series.add(seriesItem);
return this;
}
public CountEventsResponse withSeries(Consumer> seriesSetter) {
if (this.series == null) {
this.series = new ArrayList<>();
}
seriesSetter.accept(this.series);
return this;
}
/**
* 事件或者告警不同级别相同时间序列对应的统计结果。
* @return series
*/
public List getSeries() {
return series;
}
public void setSeries(List series) {
this.series = series;
}
public CountEventsResponse withSummary(Map summary) {
this.summary = summary;
return this;
}
public CountEventsResponse putSummaryItem(String key, Long summaryItem) {
if (this.summary == null) {
this.summary = new HashMap<>();
}
this.summary.put(key, summaryItem);
return this;
}
public CountEventsResponse withSummary(Consumer