com.huaweicloud.sdk.er.v3.model.ListFlowLogsRequest Maven / Gradle / Ivy
package com.huaweicloud.sdk.er.v3.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;
/**
* Request Object
*/
public class ListFlowLogsRequest {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "er_id")
private String erId;
/**
* 采集的资源类型
*/
public static final class ResourceTypeEnum {
/**
* Enum ATTACHMENT for value: "attachment"
*/
public static final ResourceTypeEnum ATTACHMENT = new ResourceTypeEnum("attachment");
private static final Map STATIC_FIELDS = createStaticFields();
private static Map createStaticFields() {
Map map = new HashMap<>();
map.put("attachment", ATTACHMENT);
return Collections.unmodifiableMap(map);
}
private String value;
ResourceTypeEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static ResourceTypeEnum fromValue(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value)).orElse(new ResourceTypeEnum(value));
}
public static ResourceTypeEnum valueOf(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value))
.orElseThrow(() -> new IllegalArgumentException("Unexpected value '" + value + "'"));
}
@Override
public boolean equals(Object obj) {
if (obj instanceof ResourceTypeEnum) {
return this.value.equals(((ResourceTypeEnum) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "resource_type")
private ResourceTypeEnum resourceType;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "resource_id")
private List resourceId = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "limit")
private Integer limit;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "marker")
private String marker;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "sort_key")
private List sortKey = null;
/**
* Gets or Sets sortDir
*/
public static final class SortDirEnum {
/**
* Enum ASC for value: "asc"
*/
public static final SortDirEnum ASC = new SortDirEnum("asc");
/**
* Enum DESC for value: "desc"
*/
public static final SortDirEnum DESC = new SortDirEnum("desc");
private static final Map STATIC_FIELDS = createStaticFields();
private static Map createStaticFields() {
Map map = new HashMap<>();
map.put("asc", ASC);
map.put("desc", DESC);
return Collections.unmodifiableMap(map);
}
private String value;
SortDirEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static SortDirEnum fromValue(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value)).orElse(new SortDirEnum(value));
}
public static SortDirEnum valueOf(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value))
.orElseThrow(() -> new IllegalArgumentException("Unexpected value '" + value + "'"));
}
@Override
public boolean equals(Object obj) {
if (obj instanceof SortDirEnum) {
return this.value.equals(((SortDirEnum) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "sort_dir")
private List sortDir = null;
public ListFlowLogsRequest withErId(String erId) {
this.erId = erId;
return this;
}
/**
* 企业路由器实例ID
* @return erId
*/
public String getErId() {
return erId;
}
public void setErId(String erId) {
this.erId = erId;
}
public ListFlowLogsRequest withResourceType(ResourceTypeEnum resourceType) {
this.resourceType = resourceType;
return this;
}
/**
* 采集的资源类型
* @return resourceType
*/
public ResourceTypeEnum getResourceType() {
return resourceType;
}
public void setResourceType(ResourceTypeEnum resourceType) {
this.resourceType = resourceType;
}
public ListFlowLogsRequest withResourceId(List resourceId) {
this.resourceId = resourceId;
return this;
}
public ListFlowLogsRequest addResourceIdItem(String resourceIdItem) {
if (this.resourceId == null) {
this.resourceId = new ArrayList<>();
}
this.resourceId.add(resourceIdItem);
return this;
}
public ListFlowLogsRequest withResourceId(Consumer> resourceIdSetter) {
if (this.resourceId == null) {
this.resourceId = new ArrayList<>();
}
resourceIdSetter.accept(this.resourceId);
return this;
}
/**
* 连接对应的资源ID列表
* @return resourceId
*/
public List getResourceId() {
return resourceId;
}
public void setResourceId(List resourceId) {
this.resourceId = resourceId;
}
public ListFlowLogsRequest withLimit(Integer limit) {
this.limit = limit;
return this;
}
/**
* 每页返回的个数。 取值范围:0~2000。
* minimum: 0
* maximum: 2000
* @return limit
*/
public Integer getLimit() {
return limit;
}
public void setLimit(Integer limit) {
this.limit = limit;
}
public ListFlowLogsRequest withMarker(String marker) {
this.marker = marker;
return this;
}
/**
* 上一页最后一条记录的企业路由器实例的id,为空时为查询第一页。 使用说明:必须与limit一起使用。
* @return marker
*/
public String getMarker() {
return marker;
}
public void setMarker(String marker) {
this.marker = marker;
}
public ListFlowLogsRequest withSortKey(List sortKey) {
this.sortKey = sortKey;
return this;
}
public ListFlowLogsRequest addSortKeyItem(String sortKeyItem) {
if (this.sortKey == null) {
this.sortKey = new ArrayList<>();
}
this.sortKey.add(sortKeyItem);
return this;
}
public ListFlowLogsRequest withSortKey(Consumer> sortKeySetter) {
if (this.sortKey == null) {
this.sortKey = new ArrayList<>();
}
sortKeySetter.accept(this.sortKey);
return this;
}
/**
* 按关键字排序,默认按照id排序,可选值:id|name|state
* @return sortKey
*/
public List getSortKey() {
return sortKey;
}
public void setSortKey(List sortKey) {
this.sortKey = sortKey;
}
public ListFlowLogsRequest withSortDir(List sortDir) {
this.sortDir = sortDir;
return this;
}
public ListFlowLogsRequest addSortDirItem(SortDirEnum sortDirItem) {
if (this.sortDir == null) {
this.sortDir = new ArrayList<>();
}
this.sortDir.add(sortDirItem);
return this;
}
public ListFlowLogsRequest withSortDir(Consumer> sortDirSetter) {
if (this.sortDir == null) {
this.sortDir = new ArrayList<>();
}
sortDirSetter.accept(this.sortDir);
return this;
}
/**
* 返回结果按照升序或降序排列,默认为asc,降序为desc
* @return sortDir
*/
public List getSortDir() {
return sortDir;
}
public void setSortDir(List sortDir) {
this.sortDir = sortDir;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ListFlowLogsRequest that = (ListFlowLogsRequest) obj;
return Objects.equals(this.erId, that.erId) && Objects.equals(this.resourceType, that.resourceType)
&& Objects.equals(this.resourceId, that.resourceId) && Objects.equals(this.limit, that.limit)
&& Objects.equals(this.marker, that.marker) && Objects.equals(this.sortKey, that.sortKey)
&& Objects.equals(this.sortDir, that.sortDir);
}
@Override
public int hashCode() {
return Objects.hash(erId, resourceType, resourceId, limit, marker, sortKey, sortDir);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ListFlowLogsRequest {\n");
sb.append(" erId: ").append(toIndentedString(erId)).append("\n");
sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n");
sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n");
sb.append(" limit: ").append(toIndentedString(limit)).append("\n");
sb.append(" marker: ").append(toIndentedString(marker)).append("\n");
sb.append(" sortKey: ").append(toIndentedString(sortKey)).append("\n");
sb.append(" sortDir: ").append(toIndentedString(sortDir)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}