com.huaweicloud.sdk.aom.v2.model.EventModel Maven / Gradle / Ivy
package com.huaweicloud.sdk.aom.v2.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;
/**
* 事件或者告警元数据。
*/
public class EventModel {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "starts_at")
private Long startsAt;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "ends_at")
private Long endsAt;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "timeout")
private Long timeout;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "metadata")
private Map metadata = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "annotations")
private Map annotations = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "attach_rule")
private Map attachRule = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "id")
private String id;
public EventModel withStartsAt(Long startsAt) {
this.startsAt = startsAt;
return this;
}
/**
* 事件或者告警产生的时间,CST毫秒级时间戳。
* @return startsAt
*/
public Long getStartsAt() {
return startsAt;
}
public void setStartsAt(Long startsAt) {
this.startsAt = startsAt;
}
public EventModel withEndsAt(Long endsAt) {
this.endsAt = endsAt;
return this;
}
/**
* 事件或者告警清除的时间,CST毫秒级时间戳,为0时表示未删除。
* @return endsAt
*/
public Long getEndsAt() {
return endsAt;
}
public void setEndsAt(Long endsAt) {
this.endsAt = endsAt;
}
public EventModel withTimeout(Long timeout) {
this.timeout = timeout;
return this;
}
/**
* 告警自动清除时间。毫秒数,例如一分钟则填写为60000。默认清除时间为3天,对应数字为 4320 * 1000(即:3天 * 24小时 * 60分钟 * 1000毫秒)。
* @return timeout
*/
public Long getTimeout() {
return timeout;
}
public void setTimeout(Long timeout) {
this.timeout = timeout;
}
public EventModel withMetadata(Map metadata) {
this.metadata = metadata;
return this;
}
public EventModel putMetadataItem(String key, String metadataItem) {
if (this.metadata == null) {
this.metadata = new HashMap<>();
}
this.metadata.put(key, metadataItem);
return this;
}
public EventModel withMetadata(Consumer