com.huaweicloud.sdk.gaussdbforopengauss.v3.model.SwitchConfigurationRequest Maven / Gradle / Ivy
package com.huaweicloud.sdk.gaussdbforopengauss.v3.model;
import java.util.Collections;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.huaweicloud.sdk.gaussdbforopengauss.v3.model.ApplyConfigurationRequestBody;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
import java.util.Objects;
/**
* Request Object
*/
public class SwitchConfigurationRequest {
/**
* 语言。
*/
public static final class XLanguageEnum {
/**
* Enum ZH_CN for value: "zh-cn"
*/
public static final XLanguageEnum ZH_CN = new XLanguageEnum("zh-cn");
/**
* Enum EN_US for value: "en-us"
*/
public static final XLanguageEnum EN_US = new XLanguageEnum("en-us");
private static final Map STATIC_FIELDS = createStaticFields();
private static Map createStaticFields() {
Map map = new HashMap<>();
map.put("zh-cn", ZH_CN);
map.put("en-us", EN_US);
return Collections.unmodifiableMap(map);
}
private String value;
XLanguageEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static XLanguageEnum fromValue(String value) {
if( value == null ){
return null;
}
XLanguageEnum result = STATIC_FIELDS.get(value);
if (result == null) {
result = new XLanguageEnum(value);
}
return result;
}
public static XLanguageEnum valueOf(String value) {
if( value == null ){
return null;
}
XLanguageEnum result = STATIC_FIELDS.get(value);
if (result != null) {
return result;
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
@Override
public boolean equals(Object obj) {
if (obj instanceof XLanguageEnum) {
return this.value.equals(((XLanguageEnum) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="X-Language")
private XLanguageEnum xLanguage;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="config_id")
private String configId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="body")
private ApplyConfigurationRequestBody body;
public SwitchConfigurationRequest withXLanguage(XLanguageEnum xLanguage) {
this.xLanguage = xLanguage;
return this;
}
/**
* 语言。
* @return xLanguage
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value="X-Language")
public XLanguageEnum getXLanguage() {
return xLanguage;
}
public void setXLanguage(XLanguageEnum xLanguage) {
this.xLanguage = xLanguage;
}
public SwitchConfigurationRequest withConfigId(String configId) {
this.configId = configId;
return this;
}
/**
* 参数模板ID。
* @return configId
*/
public String getConfigId() {
return configId;
}
public void setConfigId(String configId) {
this.configId = configId;
}
public SwitchConfigurationRequest withBody(ApplyConfigurationRequestBody body) {
this.body = body;
return this;
}
public SwitchConfigurationRequest withBody(Consumer bodySetter) {
if(this.body == null ){
this.body = new ApplyConfigurationRequestBody();
bodySetter.accept(this.body);
}
return this;
}
/**
* Get body
* @return body
*/
public ApplyConfigurationRequestBody getBody() {
return body;
}
public void setBody(ApplyConfigurationRequestBody body) {
this.body = body;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SwitchConfigurationRequest switchConfigurationRequest = (SwitchConfigurationRequest) o;
return Objects.equals(this.xLanguage, switchConfigurationRequest.xLanguage) &&
Objects.equals(this.configId, switchConfigurationRequest.configId) &&
Objects.equals(this.body, switchConfigurationRequest.body);
}
@Override
public int hashCode() {
return Objects.hash(xLanguage, configId, body);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SwitchConfigurationRequest {\n");
sb.append(" xLanguage: ").append(toIndentedString(xLanguage)).append("\n");
sb.append(" configId: ").append(toIndentedString(configId)).append("\n");
sb.append(" body: ").append(toIndentedString(body)).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 ");
}
}