com.huaweicloud.sdk.cloudide.v2.model.InstanceStatusResponse Maven / Gradle / Ivy
package com.huaweicloud.sdk.cloudide.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;
/**
* InstanceStatusResponse
*/
public class InstanceStatusResponse {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "server_url")
private String serverUrl;
/**
* 实例状态。 - DELETED 已删除 - DELETE_FAILED 删除失败 - DELETING 删除中 - READY 热实例就绪状态 - RUNNING 正在运行 - STARTING 正在启动 - STOPPED 已停止 - STOPPING 停止中 - UPDATE 更新Schdule信息 - WAITING 热实例创建初始态
*/
public static final class StatusEnum {
/**
* Enum DELETED for value: "DELETED"
*/
public static final StatusEnum DELETED = new StatusEnum("DELETED");
/**
* Enum DELETE_FAILED for value: "DELETE_FAILED"
*/
public static final StatusEnum DELETE_FAILED = new StatusEnum("DELETE_FAILED");
/**
* Enum DELETING for value: "DELETING"
*/
public static final StatusEnum DELETING = new StatusEnum("DELETING");
/**
* Enum READY for value: "READY"
*/
public static final StatusEnum READY = new StatusEnum("READY");
/**
* Enum RUNNING for value: "RUNNING"
*/
public static final StatusEnum RUNNING = new StatusEnum("RUNNING");
/**
* Enum STARTING for value: "STARTING"
*/
public static final StatusEnum STARTING = new StatusEnum("STARTING");
/**
* Enum STOPPED for value: "STOPPED"
*/
public static final StatusEnum STOPPED = new StatusEnum("STOPPED");
/**
* Enum STOPPING for value: "STOPPING"
*/
public static final StatusEnum STOPPING = new StatusEnum("STOPPING");
/**
* Enum UPDATE for value: "UPDATE"
*/
public static final StatusEnum UPDATE = new StatusEnum("UPDATE");
/**
* Enum WAITING for value: "WAITING"
*/
public static final StatusEnum WAITING = new StatusEnum("WAITING");
private static final Map STATIC_FIELDS = createStaticFields();
private static Map createStaticFields() {
Map map = new HashMap<>();
map.put("DELETED", DELETED);
map.put("DELETE_FAILED", DELETE_FAILED);
map.put("DELETING", DELETING);
map.put("READY", READY);
map.put("RUNNING", RUNNING);
map.put("STARTING", STARTING);
map.put("STOPPED", STOPPED);
map.put("STOPPING", STOPPING);
map.put("UPDATE", UPDATE);
map.put("WAITING", WAITING);
return Collections.unmodifiableMap(map);
}
private String value;
StatusEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value)).orElse(new StatusEnum(value));
}
public static StatusEnum 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 StatusEnum) {
return this.value.equals(((StatusEnum) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "status")
private StatusEnum status;
public InstanceStatusResponse withServerUrl(String serverUrl) {
this.serverUrl = serverUrl;
return this;
}
/**
* 服务链接
* @return serverUrl
*/
public String getServerUrl() {
return serverUrl;
}
public void setServerUrl(String serverUrl) {
this.serverUrl = serverUrl;
}
public InstanceStatusResponse withStatus(StatusEnum status) {
this.status = status;
return this;
}
/**
* 实例状态。 - DELETED 已删除 - DELETE_FAILED 删除失败 - DELETING 删除中 - READY 热实例就绪状态 - RUNNING 正在运行 - STARTING 正在启动 - STOPPED 已停止 - STOPPING 停止中 - UPDATE 更新Schdule信息 - WAITING 热实例创建初始态
* @return status
*/
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
InstanceStatusResponse that = (InstanceStatusResponse) obj;
return Objects.equals(this.serverUrl, that.serverUrl) && Objects.equals(this.status, that.status);
}
@Override
public int hashCode() {
return Objects.hash(serverUrl, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InstanceStatusResponse {\n");
sb.append(" serverUrl: ").append(toIndentedString(serverUrl)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).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 ");
}
}