org.openmetadata.client.model.TableConstraint Maven / Gradle / Ivy
/*
* OpenMetadata Apis
* --- title: APIs slug: /main-concepts/metadata-standard/apis --- # APIs OpenMetadata supports REST APIs for getting data and in and out of the metadata service. APIs are built using general best practices of REST API design. We take a schema-first approach by defining Types and Entities in JSON Schema. We implement APIs based on these schemas. ## Overview ### URI Following REST API conventions are followed for Resource URIs: - Operations for an entity are available through the Resource URI as a collection `.../api//entities`. - Plural of the entity name is used as the collection name - example `.../api/v1/users`. - Trailing forward slash is not used in the endpoint URI. Example use `.../api/v1/databases` instead of `.../api/v1/databases/`. - Resource URI for an entity instance by the entity id is `.../api/v1/entities/{id}`. - Resource URI for an entity instance by name is `.../api/v1/entities/name/{name}`. ### Resource Representation - The REST API calls return a response with JSON `Content-Type` and `Content-Length` that includes the length of the response. - All responses include the Resource ID field even though the id was provided in the request to simplify the consumption of the response at the client. - Entity names and field names use `camelCase` per Javascript naming convention. - All resources include an attribute `href` with Resource URI. All relationship fields of an entity will also include `href` links to the related resource for easy access. - Unknown fields sent by the client in API requests are not ignored to ensure the data sent by the client is not dropped at the server without the user being aware of it. ## API Organization You can find the swagger documentation [here](/swagger.html). In a nutshell: **Data Asset APIs** - support operations related to data asset entities. - `.../api/v1/databases` - `...api/v1/tables` - `.../api/v1/metrics` - `.../api/v1/dashboards` - `.../api/v1/reports` - `.../api/v1/pipelines` - `.../api/v1/topics` **Service APIs** - support operations related to services from which metadata is collected: - `.../api/v1/services` is the collection of all service resources. - `.../api/v1/services/databaseService` - APIs related to database services. This includes Transactional databases - MySQL, Postgres, MSSQL, Oracle, and Data Warehouses - Apache Hive BigQuery, Redshift, and Snowflake. - `.../api/v1/services/dashboardService` - APIs related to Dashboard Services. This includes Looker, Superset, and Tableau. - `.../api/v1/services/messagingService` - APIs related to Messaging Services. This includes Apache Kafka, Redpanda, - Kinesis, and others. **Teams & Users APIs** - `.../api/v1/teams` - APIs related to team entities - `.../api/v1/users` - APIs related to user entities **Search & Suggest APIs** - support search and suggest APIs: - `.../api/v1/search` - collection for search and suggest APIs - `.../api/v1/search/query` - search entities using query text - `.../api/v1/search/suggest` - get suggested entities used for auto-completion **Other APIs** - `.../api/v1/tags` for APIs related to Classification and Tag entities - `../api/v1/feeds` for APIs related to Threads and Posts entities - `.../api/v1/usage` for reporting usage information of entities
*
* The version of the OpenAPI document: 1.5.4
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openmetadata.client.model;
import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;
/**
* TableConstraint
*/
@JsonPropertyOrder({
TableConstraint.JSON_PROPERTY_COLUMNS,
TableConstraint.JSON_PROPERTY_CONSTRAINT_TYPE,
TableConstraint.JSON_PROPERTY_REFERRED_COLUMNS
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-09-13T20:15:57.513387948Z[Etc/UTC]")
public class TableConstraint {
public static final String JSON_PROPERTY_COLUMNS = "columns";
private List columns;
/**
* Gets or Sets constraintType
*/
public enum ConstraintTypeEnum {
UNIQUE("UNIQUE"),
PRIMARY_KEY("PRIMARY_KEY"),
FOREIGN_KEY("FOREIGN_KEY"),
SORT_KEY("SORT_KEY"),
DIST_KEY("DIST_KEY");
private String value;
ConstraintTypeEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static ConstraintTypeEnum fromValue(String value) {
for (ConstraintTypeEnum b : ConstraintTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
public static final String JSON_PROPERTY_CONSTRAINT_TYPE = "constraintType";
private ConstraintTypeEnum constraintType;
public static final String JSON_PROPERTY_REFERRED_COLUMNS = "referredColumns";
private List referredColumns;
public TableConstraint() {
}
public TableConstraint columns(List columns) {
this.columns = columns;
return this;
}
public TableConstraint addColumnsItem(String columnsItem) {
if (this.columns == null) {
this.columns = new ArrayList<>();
}
this.columns.add(columnsItem);
return this;
}
/**
* Get columns
* @return columns
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_COLUMNS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getColumns() {
return columns;
}
@JsonProperty(JSON_PROPERTY_COLUMNS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setColumns(List columns) {
this.columns = columns;
}
public TableConstraint constraintType(ConstraintTypeEnum constraintType) {
this.constraintType = constraintType;
return this;
}
/**
* Get constraintType
* @return constraintType
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CONSTRAINT_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public ConstraintTypeEnum getConstraintType() {
return constraintType;
}
@JsonProperty(JSON_PROPERTY_CONSTRAINT_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setConstraintType(ConstraintTypeEnum constraintType) {
this.constraintType = constraintType;
}
public TableConstraint referredColumns(List referredColumns) {
this.referredColumns = referredColumns;
return this;
}
public TableConstraint addReferredColumnsItem(String referredColumnsItem) {
if (this.referredColumns == null) {
this.referredColumns = new ArrayList<>();
}
this.referredColumns.add(referredColumnsItem);
return this;
}
/**
* Get referredColumns
* @return referredColumns
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_REFERRED_COLUMNS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List getReferredColumns() {
return referredColumns;
}
@JsonProperty(JSON_PROPERTY_REFERRED_COLUMNS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setReferredColumns(List referredColumns) {
this.referredColumns = referredColumns;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TableConstraint tableConstraint = (TableConstraint) o;
return Objects.equals(this.columns, tableConstraint.columns) &&
Objects.equals(this.constraintType, tableConstraint.constraintType) &&
Objects.equals(this.referredColumns, tableConstraint.referredColumns);
}
@Override
public int hashCode() {
return Objects.hash(columns, constraintType, referredColumns);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TableConstraint {\n");
sb.append(" columns: ").append(toIndentedString(columns)).append("\n");
sb.append(" constraintType: ").append(toIndentedString(constraintType)).append("\n");
sb.append(" referredColumns: ").append(toIndentedString(referredColumns)).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(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}