com.huaweicloud.sdk.ccm.v1.model.CreateCertificateByCsrRequestBody Maven / Gradle / Ivy
package com.huaweicloud.sdk.ccm.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;
/**
* CreateCertificateByCsrRequestBody
*/
public class CreateCertificateByCsrRequestBody {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "issuer_id")
private String issuerId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "csr")
private String csr;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "validity")
private Validity validity;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "type")
private String type;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "path_length")
private Integer pathLength;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "subject_alternative_names")
private List subjectAlternativeNames = null;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "enterprise_project_id")
private String enterpriseProjectId;
public CreateCertificateByCsrRequestBody withIssuerId(String issuerId) {
this.issuerId = issuerId;
return this;
}
/**
* 父CA证书ID。
* @return issuerId
*/
public String getIssuerId() {
return issuerId;
}
public void setIssuerId(String issuerId) {
this.issuerId = issuerId;
}
public CreateCertificateByCsrRequestBody withCsr(String csr) {
this.csr = csr;
return this;
}
/**
* 证书签名请求。请使用“\\r\\n”或“\\n”替代证书签名请求中的换行符,若通过console端请求此接口,则无需做符号转换。
* @return csr
*/
public String getCsr() {
return csr;
}
public void setCsr(String csr) {
this.csr = csr;
}
public CreateCertificateByCsrRequestBody withValidity(Validity validity) {
this.validity = validity;
return this;
}
public CreateCertificateByCsrRequestBody withValidity(Consumer validitySetter) {
if (this.validity == null) {
this.validity = new Validity();
validitySetter.accept(this.validity);
}
return this;
}
/**
* Get validity
* @return validity
*/
public Validity getValidity() {
return validity;
}
public void setValidity(Validity validity) {
this.validity = validity;
}
public CreateCertificateByCsrRequestBody withType(String type) {
this.type = type;
return this;
}
/**
* 证书类型,用于区分从属CA与私有证书。 - **ENTITY_CERT** : 签发私有证书,为缺省值; - **INTERMEDIATE_CA** : 签发从属CA。
* @return type
*/
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public CreateCertificateByCsrRequestBody withPathLength(Integer pathLength) {
this.pathLength = pathLength;
return this;
}
/**
* 路径长度,仅当签发从属CA时有效。
* minimum: 0
* maximum: 6
* @return pathLength
*/
public Integer getPathLength() {
return pathLength;
}
public void setPathLength(Integer pathLength) {
this.pathLength = pathLength;
}
public CreateCertificateByCsrRequestBody withSubjectAlternativeNames(
List subjectAlternativeNames) {
this.subjectAlternativeNames = subjectAlternativeNames;
return this;
}
public CreateCertificateByCsrRequestBody addSubjectAlternativeNamesItem(
SubjectAlternativeName subjectAlternativeNamesItem) {
if (this.subjectAlternativeNames == null) {
this.subjectAlternativeNames = new ArrayList<>();
}
this.subjectAlternativeNames.add(subjectAlternativeNamesItem);
return this;
}
public CreateCertificateByCsrRequestBody withSubjectAlternativeNames(
Consumer> subjectAlternativeNamesSetter) {
if (this.subjectAlternativeNames == null) {
this.subjectAlternativeNames = new ArrayList<>();
}
subjectAlternativeNamesSetter.accept(this.subjectAlternativeNames);
return this;
}
/**
* 主体备用名称(本接口预留参数,当前在后端被忽略),详情请参见**SubjectAlternativeName**字段数据结构说明。
* @return subjectAlternativeNames
*/
public List getSubjectAlternativeNames() {
return subjectAlternativeNames;
}
public void setSubjectAlternativeNames(List subjectAlternativeNames) {
this.subjectAlternativeNames = subjectAlternativeNames;
}
public CreateCertificateByCsrRequestBody 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;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
CreateCertificateByCsrRequestBody that = (CreateCertificateByCsrRequestBody) obj;
return Objects.equals(this.issuerId, that.issuerId) && Objects.equals(this.csr, that.csr)
&& Objects.equals(this.validity, that.validity) && Objects.equals(this.type, that.type)
&& Objects.equals(this.pathLength, that.pathLength)
&& Objects.equals(this.subjectAlternativeNames, that.subjectAlternativeNames)
&& Objects.equals(this.enterpriseProjectId, that.enterpriseProjectId);
}
@Override
public int hashCode() {
return Objects.hash(issuerId, csr, validity, type, pathLength, subjectAlternativeNames, enterpriseProjectId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateCertificateByCsrRequestBody {\n");
sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n");
sb.append(" csr: ").append(toIndentedString(csr)).append("\n");
sb.append(" validity: ").append(toIndentedString(validity)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" pathLength: ").append(toIndentedString(pathLength)).append("\n");
sb.append(" subjectAlternativeNames: ").append(toIndentedString(subjectAlternativeNames)).append("\n");
sb.append(" enterpriseProjectId: ").append(toIndentedString(enterpriseProjectId)).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 ");
}
}