com.huaweicloud.sdk.geip.v3.model.ShowUserDisclaimerRequest Maven / Gradle / Ivy
package com.huaweicloud.sdk.geip.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 ShowUserDisclaimerRequest {
/**
* Gets or Sets fields
*/
public static final class FieldsEnum {
/**
* Enum DOMAIN_ID for value: "domain_id"
*/
public static final FieldsEnum DOMAIN_ID = new FieldsEnum("domain_id");
/**
* Enum CREATED_AT for value: "created_at"
*/
public static final FieldsEnum CREATED_AT = new FieldsEnum("created_at");
/**
* Enum UPDATED_AT for value: "updated_at"
*/
public static final FieldsEnum UPDATED_AT = new FieldsEnum("updated_at");
private static final Map STATIC_FIELDS = createStaticFields();
private static Map createStaticFields() {
Map map = new HashMap<>();
map.put("domain_id", DOMAIN_ID);
map.put("created_at", CREATED_AT);
map.put("updated_at", UPDATED_AT);
return Collections.unmodifiableMap(map);
}
private String value;
FieldsEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static FieldsEnum fromValue(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value)).orElse(new FieldsEnum(value));
}
public static FieldsEnum 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 FieldsEnum) {
return this.value.equals(((FieldsEnum) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "fields")
private List fields = null;
public ShowUserDisclaimerRequest withFields(List fields) {
this.fields = fields;
return this;
}
public ShowUserDisclaimerRequest addFieldsItem(FieldsEnum fieldsItem) {
if (this.fields == null) {
this.fields = new ArrayList<>();
}
this.fields.add(fieldsItem);
return this;
}
public ShowUserDisclaimerRequest withFields(Consumer> fieldsSetter) {
if (this.fields == null) {
this.fields = new ArrayList<>();
}
fieldsSetter.accept(this.fields);
return this;
}
/**
* Get fields
* @return fields
*/
public List getFields() {
return fields;
}
public void setFields(List fields) {
this.fields = fields;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
ShowUserDisclaimerRequest that = (ShowUserDisclaimerRequest) obj;
return Objects.equals(this.fields, that.fields);
}
@Override
public int hashCode() {
return Objects.hash(fields);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ShowUserDisclaimerRequest {\n");
sb.append(" fields: ").append(toIndentedString(fields)).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 ");
}
}