org.openmetadata.schema.api.tests.CreateTestDefinition Maven / Gradle / Ivy
package org.openmetadata.schema.api.tests;
import java.util.ArrayList;
import java.util.List;
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.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.openmetadata.schema.CreateEntity;
import org.openmetadata.schema.tests.TestCaseParameter;
import org.openmetadata.schema.tests.TestPlatform;
import org.openmetadata.schema.type.ColumnDataType;
import org.openmetadata.schema.type.EntityReference;
import org.openmetadata.schema.type.ProviderType;
import org.openmetadata.schema.type.TestDefinitionEntityType;
/**
* CreateTestDefinitionRequest
*
* Schema corresponding to a Test Definition
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"name",
"displayName",
"description",
"owners",
"entityType",
"testPlatforms",
"supportedDataTypes",
"provider",
"parameterDefinition",
"domain"
})
@Generated("jsonschema2pojo")
public class CreateTestDefinition implements CreateEntity
{
/**
* Name that identifies a test definition and test case.
* (Required)
*
*/
@JsonProperty("name")
@JsonPropertyDescription("Name that identifies a test definition and test case.")
@Pattern(regexp = "^((?!::).)*$")
@Size(min = 1)
@NotNull
private String name;
/**
* Display Name that identifies this test case.
*
*/
@JsonProperty("displayName")
@JsonPropertyDescription("Display Name that identifies this test case.")
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;
/**
* This enum defines the type for which this test definition applies to.
* (Required)
*
*/
@JsonProperty("entityType")
@JsonPropertyDescription("This enum defines the type for which this test definition applies to.")
@NotNull
private TestDefinitionEntityType entityType;
/**
*
* (Required)
*
*/
@JsonProperty("testPlatforms")
@Valid
@NotNull
private List testPlatforms = new ArrayList();
@JsonProperty("supportedDataTypes")
@Valid
private List supportedDataTypes = new ArrayList();
/**
* Type of provider of an entity. Some entities are provided by the `system`. Some are entities created and provided by the `user`. Typically `system` provide entities can't be deleted and can only be disabled.
*
*/
@JsonProperty("provider")
@JsonPropertyDescription("Type of provider of an entity. Some entities are provided by the `system`. Some are entities created and provided by the `user`. Typically `system` provide entities can't be deleted and can only be disabled.")
private ProviderType provider = ProviderType.fromValue("user");
@JsonProperty("parameterDefinition")
@Valid
private List parameterDefinition = new ArrayList();
/**
* Fully qualified name of the domain the Table belongs to.
*
*/
@JsonProperty("domain")
@JsonPropertyDescription("Fully qualified name of the domain the Table belongs to.")
private String domain;
/**
* Name that identifies a test definition and test case.
* (Required)
*
*/
@JsonProperty("name")
public String getName() {
return name;
}
/**
* Name that identifies a test definition and test case.
* (Required)
*
*/
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
public CreateTestDefinition withName(String name) {
this.name = name;
return this;
}
/**
* Display Name that identifies this test case.
*
*/
@JsonProperty("displayName")
public String getDisplayName() {
return displayName;
}
/**
* Display Name that identifies this test case.
*
*/
@JsonProperty("displayName")
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public CreateTestDefinition 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 CreateTestDefinition 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 CreateTestDefinition withOwners(List owners) {
this.owners = owners;
return this;
}
/**
* This enum defines the type for which this test definition applies to.
* (Required)
*
*/
@JsonProperty("entityType")
public TestDefinitionEntityType getEntityType() {
return entityType;
}
/**
* This enum defines the type for which this test definition applies to.
* (Required)
*
*/
@JsonProperty("entityType")
public void setEntityType(TestDefinitionEntityType entityType) {
this.entityType = entityType;
}
public CreateTestDefinition withEntityType(TestDefinitionEntityType entityType) {
this.entityType = entityType;
return this;
}
/**
*
* (Required)
*
*/
@JsonProperty("testPlatforms")
public List getTestPlatforms() {
return testPlatforms;
}
/**
*
* (Required)
*
*/
@JsonProperty("testPlatforms")
public void setTestPlatforms(List testPlatforms) {
this.testPlatforms = testPlatforms;
}
public CreateTestDefinition withTestPlatforms(List testPlatforms) {
this.testPlatforms = testPlatforms;
return this;
}
@JsonProperty("supportedDataTypes")
public List getSupportedDataTypes() {
return supportedDataTypes;
}
@JsonProperty("supportedDataTypes")
public void setSupportedDataTypes(List supportedDataTypes) {
this.supportedDataTypes = supportedDataTypes;
}
public CreateTestDefinition withSupportedDataTypes(List supportedDataTypes) {
this.supportedDataTypes = supportedDataTypes;
return this;
}
/**
* Type of provider of an entity. Some entities are provided by the `system`. Some are entities created and provided by the `user`. Typically `system` provide entities can't be deleted and can only be disabled.
*
*/
@JsonProperty("provider")
public ProviderType getProvider() {
return provider;
}
/**
* Type of provider of an entity. Some entities are provided by the `system`. Some are entities created and provided by the `user`. Typically `system` provide entities can't be deleted and can only be disabled.
*
*/
@JsonProperty("provider")
public void setProvider(ProviderType provider) {
this.provider = provider;
}
public CreateTestDefinition withProvider(ProviderType provider) {
this.provider = provider;
return this;
}
@JsonProperty("parameterDefinition")
public List getParameterDefinition() {
return parameterDefinition;
}
@JsonProperty("parameterDefinition")
public void setParameterDefinition(List parameterDefinition) {
this.parameterDefinition = parameterDefinition;
}
public CreateTestDefinition withParameterDefinition(List parameterDefinition) {
this.parameterDefinition = parameterDefinition;
return this;
}
/**
* Fully qualified name of the domain the Table belongs to.
*
*/
@JsonProperty("domain")
public String getDomain() {
return domain;
}
/**
* Fully qualified name of the domain the Table belongs to.
*
*/
@JsonProperty("domain")
public void setDomain(String domain) {
this.domain = domain;
}
public CreateTestDefinition withDomain(String domain) {
this.domain = domain;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(CreateTestDefinition.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("entityType");
sb.append('=');
sb.append(((this.entityType == null)?"":this.entityType));
sb.append(',');
sb.append("testPlatforms");
sb.append('=');
sb.append(((this.testPlatforms == null)?"":this.testPlatforms));
sb.append(',');
sb.append("supportedDataTypes");
sb.append('=');
sb.append(((this.supportedDataTypes == null)?"":this.supportedDataTypes));
sb.append(',');
sb.append("provider");
sb.append('=');
sb.append(((this.provider == null)?"":this.provider));
sb.append(',');
sb.append("parameterDefinition");
sb.append('=');
sb.append(((this.parameterDefinition == null)?"":this.parameterDefinition));
sb.append(',');
sb.append("domain");
sb.append('=');
sb.append(((this.domain == null)?"":this.domain));
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.testPlatforms == null)? 0 :this.testPlatforms.hashCode()));
result = ((result* 31)+((this.provider == null)? 0 :this.provider.hashCode()));
result = ((result* 31)+((this.displayName == null)? 0 :this.displayName.hashCode()));
result = ((result* 31)+((this.entityType == null)? 0 :this.entityType.hashCode()));
result = ((result* 31)+((this.domain == null)? 0 :this.domain.hashCode()));
result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode()));
result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode()));
result = ((result* 31)+((this.supportedDataTypes == null)? 0 :this.supportedDataTypes.hashCode()));
result = ((result* 31)+((this.owners == null)? 0 :this.owners.hashCode()));
result = ((result* 31)+((this.parameterDefinition == null)? 0 :this.parameterDefinition.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof CreateTestDefinition) == false) {
return false;
}
CreateTestDefinition rhs = ((CreateTestDefinition) other);
return (((((((((((this.testPlatforms == rhs.testPlatforms)||((this.testPlatforms!= null)&&this.testPlatforms.equals(rhs.testPlatforms)))&&((this.provider == rhs.provider)||((this.provider!= null)&&this.provider.equals(rhs.provider))))&&((this.displayName == rhs.displayName)||((this.displayName!= null)&&this.displayName.equals(rhs.displayName))))&&((this.entityType == rhs.entityType)||((this.entityType!= null)&&this.entityType.equals(rhs.entityType))))&&((this.domain == rhs.domain)||((this.domain!= null)&&this.domain.equals(rhs.domain))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.supportedDataTypes == rhs.supportedDataTypes)||((this.supportedDataTypes!= null)&&this.supportedDataTypes.equals(rhs.supportedDataTypes))))&&((this.owners == rhs.owners)||((this.owners!= null)&&this.owners.equals(rhs.owners))))&&((this.parameterDefinition == rhs.parameterDefinition)||((this.parameterDefinition!= null)&&this.parameterDefinition.equals(rhs.parameterDefinition))));
}
}