com.huaweicloud.sdk.kms.v2.model.ListKeysRequestBody Maven / Gradle / Ivy
The newest version!
package com.huaweicloud.sdk.kms.v2.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.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* ListKeysRequestBody
*/
public class ListKeysRequestBody {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "limit")
private String limit;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "marker")
private String marker;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "key_state")
private String keyState;
/**
* 密钥生成算法,默认为“AES_256”。查询所有(包含非对称)密钥需要指定参数“ALL”。 - AES_256 - SM4 - RSA_2048 - RSA_3072 - RSA_4096 - EC_P256 - EC_P384 - SM2 - ALL
*/
public static final class KeySpecEnum {
/**
* Enum AES_256 for value: "AES_256"
*/
public static final KeySpecEnum AES_256 = new KeySpecEnum("AES_256");
/**
* Enum SM4 for value: "SM4"
*/
public static final KeySpecEnum SM4 = new KeySpecEnum("SM4");
/**
* Enum RSA_2048 for value: "RSA_2048"
*/
public static final KeySpecEnum RSA_2048 = new KeySpecEnum("RSA_2048");
/**
* Enum RSA_3072 for value: "RSA_3072"
*/
public static final KeySpecEnum RSA_3072 = new KeySpecEnum("RSA_3072");
/**
* Enum RSA_4096 for value: "RSA_4096"
*/
public static final KeySpecEnum RSA_4096 = new KeySpecEnum("RSA_4096");
/**
* Enum EC_P256 for value: "EC_P256"
*/
public static final KeySpecEnum EC_P256 = new KeySpecEnum("EC_P256");
/**
* Enum EC_P384 for value: "EC_P384"
*/
public static final KeySpecEnum EC_P384 = new KeySpecEnum("EC_P384");
/**
* Enum SM2 for value: "SM2"
*/
public static final KeySpecEnum SM2 = new KeySpecEnum("SM2");
/**
* Enum ALL for value: "ALL"
*/
public static final KeySpecEnum ALL = new KeySpecEnum("ALL");
private static final Map STATIC_FIELDS = createStaticFields();
private static Map createStaticFields() {
Map map = new HashMap<>();
map.put("AES_256", AES_256);
map.put("SM4", SM4);
map.put("RSA_2048", RSA_2048);
map.put("RSA_3072", RSA_3072);
map.put("RSA_4096", RSA_4096);
map.put("EC_P256", EC_P256);
map.put("EC_P384", EC_P384);
map.put("SM2", SM2);
map.put("ALL", ALL);
return Collections.unmodifiableMap(map);
}
private String value;
KeySpecEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static KeySpecEnum fromValue(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value)).orElse(new KeySpecEnum(value));
}
public static KeySpecEnum 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 KeySpecEnum) {
return this.value.equals(((KeySpecEnum) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "key_spec")
private KeySpecEnum keySpec;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "enterprise_project_id")
private String enterpriseProjectId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "sequence")
private String sequence;
public ListKeysRequestBody withLimit(String limit) {
this.limit = limit;
return this;
}
/**
* 指定查询返回记录条数,如果指定查询记录条数小于存在的条数,响应参数“truncated”将返回“true”,表示存在分页。取值在密钥最大个数范围以内。例如:100
* @return limit
*/
public String getLimit() {
return limit;
}
public void setLimit(String limit) {
this.limit = limit;
}
public ListKeysRequestBody withMarker(String marker) {
this.marker = marker;
return this;
}
/**
* 分页查询起始位置标识。分页查询收到的响应参数“truncated”为“true”时,可以发送连续的请求获取更多的记录条数,“marker”设置为响应的next_marker的值。例如:10
* @return marker
*/
public String getMarker() {
return marker;
}
public void setMarker(String marker) {
this.marker = marker;
}
public ListKeysRequestBody withKeyState(String keyState) {
this.keyState = keyState;
return this;
}
/**
* 密钥状态,满足正则匹配“^[1-5]{1}$”,枚举如下: - “1”表示待激活状态 - “2”表示启用状态 - “3”表示禁用状态 - “4”表示计划删除状态 - “5”表示等待导入状态
* @return keyState
*/
public String getKeyState() {
return keyState;
}
public void setKeyState(String keyState) {
this.keyState = keyState;
}
public ListKeysRequestBody withKeySpec(KeySpecEnum keySpec) {
this.keySpec = keySpec;
return this;
}
/**
* 密钥生成算法,默认为“AES_256”。查询所有(包含非对称)密钥需要指定参数“ALL”。 - AES_256 - SM4 - RSA_2048 - RSA_3072 - RSA_4096 - EC_P256 - EC_P384 - SM2 - ALL
* @return keySpec
*/
public KeySpecEnum getKeySpec() {
return keySpec;
}
public void setKeySpec(KeySpecEnum keySpec) {
this.keySpec = keySpec;
}
public ListKeysRequestBody withEnterpriseProjectId(String enterpriseProjectId) {
this.enterpriseProjectId = enterpriseProjectId;
return this;
}
/**
* 企业多项目ID。用户未开通企业多项目时,不需要输入该字段。 用户开通企业多项目时,查询资源可以输入该字段。 若用户不输入该字段,默认查询租户所有有权限的企业多项目下的资源。 此时“enterprise_project_id”取值为“all”。 若用户输入该字段,取值满足以下任一条件. - 取值为“all” - 取值为“0” - 满足正则匹配:“^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$”
* @return enterpriseProjectId
*/
public String getEnterpriseProjectId() {
return enterpriseProjectId;
}
public void setEnterpriseProjectId(String enterpriseProjectId) {
this.enterpriseProjectId = enterpriseProjectId;
}
public ListKeysRequestBody withSequence(String sequence) {
this.sequence = sequence;
return this;
}
/**
* 请求消息序列号,36字节序列号。 例如:919c82d4-8046-4722-9094-35c3c6524cff
* @return sequence
*/
public String getSequence() {
return sequence;
}
public void setSequence(String sequence) {
this.sequence = sequence;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ListKeysRequestBody that = (ListKeysRequestBody) obj;
return Objects.equals(this.limit, that.limit) && Objects.equals(this.marker, that.marker)
&& Objects.equals(this.keyState, that.keyState) && Objects.equals(this.keySpec, that.keySpec)
&& Objects.equals(this.enterpriseProjectId, that.enterpriseProjectId)
&& Objects.equals(this.sequence, that.sequence);
}
@Override
public int hashCode() {
return Objects.hash(limit, marker, keyState, keySpec, enterpriseProjectId, sequence);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ListKeysRequestBody {\n");
sb.append(" limit: ").append(toIndentedString(limit)).append("\n");
sb.append(" marker: ").append(toIndentedString(marker)).append("\n");
sb.append(" keyState: ").append(toIndentedString(keyState)).append("\n");
sb.append(" keySpec: ").append(toIndentedString(keySpec)).append("\n");
sb.append(" enterpriseProjectId: ").append(toIndentedString(enterpriseProjectId)).append("\n");
sb.append(" sequence: ").append(toIndentedString(sequence)).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 ");
}
}