com.huaweicloud.sdk.aom.v1.model.StartPausingWorkflowExecutionsRequest Maven / Gradle / Ivy
package com.huaweicloud.sdk.aom.v1.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;
/**
* Request Object
*/
public class StartPausingWorkflowExecutionsRequest {
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "workflow_id")
private String workflowId;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "execution_id")
private String executionId;
/**
* 对当前节点的操作:失败重试,失败跳过,暂停继续。 restart可重新执行失败的节点,skip可跳过失败的节点进入下个节点的执行,continue可通过暂停节点进入下一个节点。
*/
public static final class ActionEnum {
/**
* Enum RESTART for value: "restart"
*/
public static final ActionEnum RESTART = new ActionEnum("restart");
/**
* Enum SKIP for value: "skip"
*/
public static final ActionEnum SKIP = new ActionEnum("skip");
/**
* Enum CONTINUE for value: "continue"
*/
public static final ActionEnum CONTINUE = new ActionEnum("continue");
private static final Map STATIC_FIELDS = createStaticFields();
private static Map createStaticFields() {
Map map = new HashMap<>();
map.put("restart", RESTART);
map.put("skip", SKIP);
map.put("continue", CONTINUE);
return Collections.unmodifiableMap(map);
}
private String value;
ActionEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static ActionEnum fromValue(String value) {
if (value == null) {
return null;
}
return java.util.Optional.ofNullable(STATIC_FIELDS.get(value)).orElse(new ActionEnum(value));
}
public static ActionEnum 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 ActionEnum) {
return this.value.equals(((ActionEnum) obj).value);
}
return false;
}
@Override
public int hashCode() {
return this.value.hashCode();
}
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "action")
private ActionEnum action;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty(value = "node_id")
private String nodeId;
public StartPausingWorkflowExecutionsRequest withWorkflowId(String workflowId) {
this.workflowId = workflowId;
return this;
}
/**
* 工作流ID,唯一标识,根据project_id和workflow_name生成。
* @return workflowId
*/
public String getWorkflowId() {
return workflowId;
}
public void setWorkflowId(String workflowId) {
this.workflowId = workflowId;
}
public StartPausingWorkflowExecutionsRequest withExecutionId(String executionId) {
this.executionId = executionId;
return this;
}
/**
* 工作流执行ID。
* @return executionId
*/
public String getExecutionId() {
return executionId;
}
public void setExecutionId(String executionId) {
this.executionId = executionId;
}
public StartPausingWorkflowExecutionsRequest withAction(ActionEnum action) {
this.action = action;
return this;
}
/**
* 对当前节点的操作:失败重试,失败跳过,暂停继续。 restart可重新执行失败的节点,skip可跳过失败的节点进入下个节点的执行,continue可通过暂停节点进入下一个节点。
* @return action
*/
public ActionEnum getAction() {
return action;
}
public void setAction(ActionEnum action) {
this.action = action;
}
public StartPausingWorkflowExecutionsRequest withNodeId(String nodeId) {
this.nodeId = nodeId;
return this;
}
/**
* 当前节点的id。
* @return nodeId
*/
public String getNodeId() {
return nodeId;
}
public void setNodeId(String nodeId) {
this.nodeId = nodeId;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
StartPausingWorkflowExecutionsRequest that = (StartPausingWorkflowExecutionsRequest) obj;
return Objects.equals(this.workflowId, that.workflowId) && Objects.equals(this.executionId, that.executionId)
&& Objects.equals(this.action, that.action) && Objects.equals(this.nodeId, that.nodeId);
}
@Override
public int hashCode() {
return Objects.hash(workflowId, executionId, action, nodeId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class StartPausingWorkflowExecutionsRequest {\n");
sb.append(" workflowId: ").append(toIndentedString(workflowId)).append("\n");
sb.append(" executionId: ").append(toIndentedString(executionId)).append("\n");
sb.append(" action: ").append(toIndentedString(action)).append("\n");
sb.append(" nodeId: ").append(toIndentedString(nodeId)).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 ");
}
}