org.openmetadata.schema.services.connections.pipeline.StitchConnection Maven / Gradle / Ivy
package org.openmetadata.schema.services.connections.pipeline;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.processing.Generated;
import javax.validation.constraints.NotNull;
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.annotations.PasswordField;
/**
* StitchConnection
*
* Stitch Connection
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"hostPort",
"token",
"supportsMetadataExtraction"
})
@Generated("jsonschema2pojo")
public class StitchConnection {
/**
* Service type.
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Service type.")
private StitchConnection.StitchType type = StitchConnection.StitchType.fromValue("Stitch");
/**
* Host and Port
*
* Host and port of the Stitch API host
* (Required)
*
*/
@JsonProperty("hostPort")
@JsonPropertyDescription("Host and port of the Stitch API host")
@NotNull
private String hostPort = "https://api.stitchdata.com/v4";
/**
* JWT Token
*
* Token to connect to Stitch api doc
* (Required)
*
*/
@JsonProperty("token")
@JsonPropertyDescription("Token to connect to Stitch api doc")
@PasswordField
@NotNull
private String token;
/**
* Supports Metadata Extraction.
*
*/
@JsonProperty("supportsMetadataExtraction")
@JsonPropertyDescription("Supports Metadata Extraction.")
private Boolean supportsMetadataExtraction = true;
/**
* Service type.
*
*/
@JsonProperty("type")
public StitchConnection.StitchType getType() {
return type;
}
/**
* Service type.
*
*/
@JsonProperty("type")
public void setType(StitchConnection.StitchType type) {
this.type = type;
}
public StitchConnection withType(StitchConnection.StitchType type) {
this.type = type;
return this;
}
/**
* Host and Port
*
* Host and port of the Stitch API host
* (Required)
*
*/
@JsonProperty("hostPort")
public String getHostPort() {
return hostPort;
}
/**
* Host and Port
*
* Host and port of the Stitch API host
* (Required)
*
*/
@JsonProperty("hostPort")
public void setHostPort(String hostPort) {
this.hostPort = hostPort;
}
public StitchConnection withHostPort(String hostPort) {
this.hostPort = hostPort;
return this;
}
/**
* JWT Token
*
* Token to connect to Stitch api doc
* (Required)
*
*/
@JsonProperty("token")
@PasswordField
public String getToken() {
return token;
}
/**
* JWT Token
*
* Token to connect to Stitch api doc
* (Required)
*
*/
@JsonProperty("token")
@PasswordField
public void setToken(String token) {
this.token = token;
}
public StitchConnection withToken(String token) {
this.token = token;
return this;
}
/**
* Supports Metadata Extraction.
*
*/
@JsonProperty("supportsMetadataExtraction")
public Boolean getSupportsMetadataExtraction() {
return supportsMetadataExtraction;
}
/**
* Supports Metadata Extraction.
*
*/
@JsonProperty("supportsMetadataExtraction")
public void setSupportsMetadataExtraction(Boolean supportsMetadataExtraction) {
this.supportsMetadataExtraction = supportsMetadataExtraction;
}
public StitchConnection withSupportsMetadataExtraction(Boolean supportsMetadataExtraction) {
this.supportsMetadataExtraction = supportsMetadataExtraction;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(StitchConnection.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("type");
sb.append('=');
sb.append(((this.type == null)?"":this.type));
sb.append(',');
sb.append("hostPort");
sb.append('=');
sb.append(((this.hostPort == null)?"":this.hostPort));
sb.append(',');
sb.append("token");
sb.append('=');
sb.append(((this.token == null)?"":this.token));
sb.append(',');
sb.append("supportsMetadataExtraction");
sb.append('=');
sb.append(((this.supportsMetadataExtraction == null)?"":this.supportsMetadataExtraction));
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.supportsMetadataExtraction == null)? 0 :this.supportsMetadataExtraction.hashCode()));
result = ((result* 31)+((this.hostPort == null)? 0 :this.hostPort.hashCode()));
result = ((result* 31)+((this.type == null)? 0 :this.type.hashCode()));
result = ((result* 31)+((this.token == null)? 0 :this.token.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof StitchConnection) == false) {
return false;
}
StitchConnection rhs = ((StitchConnection) other);
return (((((this.supportsMetadataExtraction == rhs.supportsMetadataExtraction)||((this.supportsMetadataExtraction!= null)&&this.supportsMetadataExtraction.equals(rhs.supportsMetadataExtraction)))&&((this.hostPort == rhs.hostPort)||((this.hostPort!= null)&&this.hostPort.equals(rhs.hostPort))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))))&&((this.token == rhs.token)||((this.token!= null)&&this.token.equals(rhs.token))));
}
/**
* Service type.
*
*/
@Generated("jsonschema2pojo")
public enum StitchType {
STITCH("Stitch");
private final String value;
private final static Map CONSTANTS = new HashMap();
static {
for (StitchConnection.StitchType c: values()) {
CONSTANTS.put(c.value, c);
}
}
StitchType(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static StitchConnection.StitchType fromValue(String value) {
StitchConnection.StitchType constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}