com.huaweicloud.sdk.csms.v1.model.CreateSecretVersionRequestBody Maven / Gradle / Ivy
package com.huaweicloud.sdk.csms.v1.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;
/**
* 创建凭据版本请求体。
*/
public class CreateSecretVersionRequestBody {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "secret_binary")
private String secretBinary;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "secret_string")
private String secretString;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "version_stages")
private List versionStages = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "expire_time")
private Long expireTime;
public CreateSecretVersionRequestBody withSecretBinary(String secretBinary) {
this.secretBinary = secretBinary;
return this;
}
/**
* 新创建凭据的凭据值,将其加密后,存入初始版本中。 类型:base64编码的二进制数据对象。 约束:secret_binary和secret_string必须且只能设置一个,最大32K。
* @return secretBinary
*/
public String getSecretBinary() {
return secretBinary;
}
public void setSecretBinary(String secretBinary) {
this.secretBinary = secretBinary;
}
public CreateSecretVersionRequestBody withSecretString(String secretString) {
this.secretString = secretString;
return this;
}
/**
* 新创建凭据的凭据值,将其加密后,存入初始版本中。 约束:secret_binary和 secret_string必须且只能设置一个,最大32K。
* @return secretString
*/
public String getSecretString() {
return secretString;
}
public void setSecretString(String secretString) {
this.secretString = secretString;
}
public CreateSecretVersionRequestBody withVersionStages(List versionStages) {
this.versionStages = versionStages;
return this;
}
public CreateSecretVersionRequestBody addVersionStagesItem(String versionStagesItem) {
if (this.versionStages == null) {
this.versionStages = new ArrayList<>();
}
this.versionStages.add(versionStagesItem);
return this;
}
public CreateSecretVersionRequestBody withVersionStages(Consumer> versionStagesSetter) {
if (this.versionStages == null) {
this.versionStages = new ArrayList<>();
}
versionStagesSetter.accept(this.versionStages);
return this;
}
/**
* 凭据版本在存入时需要被同时标记的版本状态。如果您不指定此参数,凭据管家默认为新版本标记SYSCURRENT 约束:数组大小:最小1,最大12。stage长度:最小1字节,最大64字节。
* @return versionStages
*/
public List getVersionStages() {
return versionStages;
}
public void setVersionStages(List versionStages) {
this.versionStages = versionStages;
}
public CreateSecretVersionRequestBody withExpireTime(Long expireTime) {
this.expireTime = expireTime;
return this;
}
/**
* 凭据版本过期时间,时间戳,即从1970年1月1日至该时间的总秒数。默认为空,凭据订阅“版本过期”事件类型时,有效期判断所依据的值。
* minimum: 0
* maximum: 9999999999999
* @return expireTime
*/
public Long getExpireTime() {
return expireTime;
}
public void setExpireTime(Long expireTime) {
this.expireTime = expireTime;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
CreateSecretVersionRequestBody that = (CreateSecretVersionRequestBody) obj;
return Objects.equals(this.secretBinary, that.secretBinary)
&& Objects.equals(this.secretString, that.secretString)
&& Objects.equals(this.versionStages, that.versionStages)
&& Objects.equals(this.expireTime, that.expireTime);
}
@Override
public int hashCode() {
return Objects.hash(secretBinary, secretString, versionStages, expireTime);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateSecretVersionRequestBody {\n");
sb.append(" secretBinary: ").append(toIndentedString(secretBinary)).append("\n");
sb.append(" secretString: ").append(toIndentedString(secretString)).append("\n");
sb.append(" versionStages: ").append(toIndentedString(versionStages)).append("\n");
sb.append(" expireTime: ").append(toIndentedString(expireTime)).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 ");
}
}