All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openmetadata.schema.api.governance.CreateWorkflowDefinition Maven / Gradle / Ivy

There is a newer version: 1.6.0-rc1
Show newest version

package org.openmetadata.schema.api.governance;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import org.openmetadata.schema.CreateEntity;
import org.openmetadata.schema.governance.workflows.elements.EdgeDefinition;
import org.openmetadata.schema.type.EntityReference;


/**
 * CreateWorkflowDefinitionRequest
 * 

* Create Workflow Definition entity request * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ "name", "displayName", "description", "owners", "type", "trigger", "nodes", "edges" }) @Generated("jsonschema2pojo") public class CreateWorkflowDefinition implements CreateEntity { /** * Name that identifies an entity. * (Required) * */ @JsonProperty("name") @JsonPropertyDescription("Name that identifies an entity.") @Pattern(regexp = "^((?!::).)*$") @Size(min = 1, max = 256) @NotNull private String name; /** * Display Name that identifies this Workflow Definition. * */ @JsonProperty("displayName") @JsonPropertyDescription("Display Name that identifies this Workflow Definition.") private String displayName; /** * Text in Markdown format.@om-field-type * (Required) * */ @JsonProperty("description") @JsonPropertyDescription("Text in Markdown format.") @NotNull private String description; /** * Entity Reference List *

* This schema defines the EntityReferenceList type used for referencing an entity. EntityReference is used for capturing relationships from one entity to another. For example, a table has an attribute called database of type EntityReference that captures the relationship of a table `belongs to a` database. * */ @JsonProperty("owners") @JsonPropertyDescription("This schema defines the EntityReferenceList type used for referencing an entity. EntityReference is used for capturing relationships from one entity to another. For example, a table has an attribute called database of type EntityReference that captures the relationship of a table `belongs to a` database.") @Valid private List owners = null; @JsonProperty("type") private CreateWorkflowDefinition.Type type; @JsonProperty("trigger") private Object trigger; /** * List of processes used on the workflow. * */ @JsonProperty("nodes") @JsonPropertyDescription("List of processes used on the workflow.") @Valid private List nodes = new ArrayList(); /** * List of edges that connect the workflow elements and guide its flow. * */ @JsonProperty("edges") @JsonPropertyDescription("List of edges that connect the workflow elements and guide its flow.") @Valid private List edges = new ArrayList(); /** * Name that identifies an entity. * (Required) * */ @JsonProperty("name") public String getName() { return name; } /** * Name that identifies an entity. * (Required) * */ @JsonProperty("name") public void setName(String name) { this.name = name; } public CreateWorkflowDefinition withName(String name) { this.name = name; return this; } /** * Display Name that identifies this Workflow Definition. * */ @JsonProperty("displayName") public String getDisplayName() { return displayName; } /** * Display Name that identifies this Workflow Definition. * */ @JsonProperty("displayName") public void setDisplayName(String displayName) { this.displayName = displayName; } public CreateWorkflowDefinition withDisplayName(String displayName) { this.displayName = displayName; return this; } /** * Text in Markdown format.@om-field-type * (Required) * */ @JsonProperty("description") public String getDescription() { return description; } /** * Text in Markdown format.@om-field-type * (Required) * */ @JsonProperty("description") public void setDescription(String description) { this.description = description; } public CreateWorkflowDefinition withDescription(String description) { this.description = description; return this; } /** * Entity Reference List *

* This schema defines the EntityReferenceList type used for referencing an entity. EntityReference is used for capturing relationships from one entity to another. For example, a table has an attribute called database of type EntityReference that captures the relationship of a table `belongs to a` database. * */ @JsonProperty("owners") public List getOwners() { return owners; } /** * Entity Reference List *

* This schema defines the EntityReferenceList type used for referencing an entity. EntityReference is used for capturing relationships from one entity to another. For example, a table has an attribute called database of type EntityReference that captures the relationship of a table `belongs to a` database. * */ @JsonProperty("owners") public void setOwners(List owners) { this.owners = owners; } public CreateWorkflowDefinition withOwners(List owners) { this.owners = owners; return this; } @JsonProperty("type") public CreateWorkflowDefinition.Type getType() { return type; } @JsonProperty("type") public void setType(CreateWorkflowDefinition.Type type) { this.type = type; } public CreateWorkflowDefinition withType(CreateWorkflowDefinition.Type type) { this.type = type; return this; } @JsonProperty("trigger") public Object getTrigger() { return trigger; } @JsonProperty("trigger") public void setTrigger(Object trigger) { this.trigger = trigger; } public CreateWorkflowDefinition withTrigger(Object trigger) { this.trigger = trigger; return this; } /** * List of processes used on the workflow. * */ @JsonProperty("nodes") public List getNodes() { return nodes; } /** * List of processes used on the workflow. * */ @JsonProperty("nodes") public void setNodes(List nodes) { this.nodes = nodes; } public CreateWorkflowDefinition withNodes(List nodes) { this.nodes = nodes; return this; } /** * List of edges that connect the workflow elements and guide its flow. * */ @JsonProperty("edges") public List getEdges() { return edges; } /** * List of edges that connect the workflow elements and guide its flow. * */ @JsonProperty("edges") public void setEdges(List edges) { this.edges = edges; } public CreateWorkflowDefinition withEdges(List edges) { this.edges = edges; return this; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(CreateWorkflowDefinition.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); sb.append("name"); sb.append('='); sb.append(((this.name == null)?"":this.name)); sb.append(','); sb.append("displayName"); sb.append('='); sb.append(((this.displayName == null)?"":this.displayName)); sb.append(','); sb.append("description"); sb.append('='); sb.append(((this.description == null)?"":this.description)); sb.append(','); sb.append("owners"); sb.append('='); sb.append(((this.owners == null)?"":this.owners)); sb.append(','); sb.append("type"); sb.append('='); sb.append(((this.type == null)?"":this.type)); sb.append(','); sb.append("trigger"); sb.append('='); sb.append(((this.trigger == null)?"":this.trigger)); sb.append(','); sb.append("nodes"); sb.append('='); sb.append(((this.nodes == null)?"":this.nodes)); sb.append(','); sb.append("edges"); sb.append('='); sb.append(((this.edges == null)?"":this.edges)); sb.append(','); if (sb.charAt((sb.length()- 1)) == ',') { sb.setCharAt((sb.length()- 1), ']'); } else { sb.append(']'); } return sb.toString(); } @Override public int hashCode() { int result = 1; result = ((result* 31)+((this.nodes == null)? 0 :this.nodes.hashCode())); result = ((result* 31)+((this.displayName == null)? 0 :this.displayName.hashCode())); result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); result = ((result* 31)+((this.edges == null)? 0 :this.edges.hashCode())); result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); result = ((result* 31)+((this.owners == null)? 0 :this.owners.hashCode())); result = ((result* 31)+((this.trigger == null)? 0 :this.trigger.hashCode())); result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode())); return result; } @Override public boolean equals(Object other) { if (other == this) { return true; } if ((other instanceof CreateWorkflowDefinition) == false) { return false; } CreateWorkflowDefinition rhs = ((CreateWorkflowDefinition) other); return (((((((((this.nodes == rhs.nodes)||((this.nodes!= null)&&this.nodes.equals(rhs.nodes)))&&((this.displayName == rhs.displayName)||((this.displayName!= null)&&this.displayName.equals(rhs.displayName))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.edges == rhs.edges)||((this.edges!= null)&&this.edges.equals(rhs.edges))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.owners == rhs.owners)||((this.owners!= null)&&this.owners.equals(rhs.owners))))&&((this.trigger == rhs.trigger)||((this.trigger!= null)&&this.trigger.equals(rhs.trigger))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type)))); } @Generated("jsonschema2pojo") public enum Type { EVENT_BASED_ENTITY_WORKFLOW("eventBasedEntityWorkflow"), PERIODIC_BATCH_ENTITY_WORKFLOW("periodicBatchEntityWorkflow"); private final String value; private final static Map CONSTANTS = new HashMap(); static { for (CreateWorkflowDefinition.Type c: values()) { CONSTANTS.put(c.value, c); } } Type(String value) { this.value = value; } @Override public String toString() { return this.value; } @JsonValue public String value() { return this.value; } @JsonCreator public static CreateWorkflowDefinition.Type fromValue(String value) { CreateWorkflowDefinition.Type constant = CONSTANTS.get(value); if (constant == null) { throw new IllegalArgumentException(value); } else { return constant; } } } }