com.huaweicloud.sdk.iotanalytics.v1.model.GetHistoryRequest Maven / Gradle / Ivy
package com.huaweicloud.sdk.iotanalytics.v1.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
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;
/**
* 查询历史值请求
*/
public class GetHistoryRequest {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "time_span")
private TimeSpan timeSpan;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "tags")
private Map tags = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "property_names")
private List propertyNames = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "limit")
private Integer limit;
public GetHistoryRequest withTimeSpan(TimeSpan timeSpan) {
this.timeSpan = timeSpan;
return this;
}
public GetHistoryRequest withTimeSpan(Consumer timeSpanSetter) {
if (this.timeSpan == null) {
this.timeSpan = new TimeSpan();
timeSpanSetter.accept(this.timeSpan);
}
return this;
}
/**
* Get timeSpan
* @return timeSpan
*/
public TimeSpan getTimeSpan() {
return timeSpan;
}
public void setTimeSpan(TimeSpan timeSpan) {
this.timeSpan = timeSpan;
}
public GetHistoryRequest withTags(Map tags) {
this.tags = tags;
return this;
}
public GetHistoryRequest putTagsItem(String key, String tagsItem) {
if (this.tags == null) {
this.tags = new HashMap<>();
}
this.tags.put(key, tagsItem);
return this;
}
public GetHistoryRequest withTags(Consumer