org.openmetadata.schema.services.connections.dashboard.SigmaConnection Maven / Gradle / Ivy
package org.openmetadata.schema.services.connections.dashboard;
import java.net.URI;
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.ExposedField;
import org.openmetadata.annotations.PasswordField;
/**
* SigmaConnection
*
* Sigma Connection Config
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"hostPort",
"clientId",
"clientSecret",
"apiVersion"
})
@Generated("jsonschema2pojo")
public class SigmaConnection {
/**
* Sigma service type
*
*/
@JsonProperty("type")
@JsonPropertyDescription("Sigma service type")
private SigmaConnection.SigmaType type = SigmaConnection.SigmaType.fromValue("Sigma");
/**
* Host and Port
*
* Sigma API url.
* (Required)
*
*/
@JsonProperty("hostPort")
@JsonPropertyDescription("Sigma API url.")
@ExposedField
@NotNull
private URI hostPort = URI.create("https://api.sigmacomputing.com");
/**
* Client ID
*
* client_id for Sigma.
* (Required)
*
*/
@JsonProperty("clientId")
@JsonPropertyDescription("client_id for Sigma.")
@NotNull
private String clientId;
/**
* Client Secret
*
* clientSecret for Sigma.
* (Required)
*
*/
@JsonProperty("clientSecret")
@JsonPropertyDescription("clientSecret for Sigma.")
@PasswordField
@NotNull
private String clientSecret;
/**
* API Version
*
* Sigma API version.
*
*/
@JsonProperty("apiVersion")
@JsonPropertyDescription("Sigma API version.")
private String apiVersion = "v2";
/**
* Sigma service type
*
*/
@JsonProperty("type")
public SigmaConnection.SigmaType getType() {
return type;
}
/**
* Sigma service type
*
*/
@JsonProperty("type")
public void setType(SigmaConnection.SigmaType type) {
this.type = type;
}
public SigmaConnection withType(SigmaConnection.SigmaType type) {
this.type = type;
return this;
}
/**
* Host and Port
*
* Sigma API url.
* (Required)
*
*/
@JsonProperty("hostPort")
@ExposedField
public URI getHostPort() {
return hostPort;
}
/**
* Host and Port
*
* Sigma API url.
* (Required)
*
*/
@JsonProperty("hostPort")
@ExposedField
public void setHostPort(URI hostPort) {
this.hostPort = hostPort;
}
public SigmaConnection withHostPort(URI hostPort) {
this.hostPort = hostPort;
return this;
}
/**
* Client ID
*
* client_id for Sigma.
* (Required)
*
*/
@JsonProperty("clientId")
public String getClientId() {
return clientId;
}
/**
* Client ID
*
* client_id for Sigma.
* (Required)
*
*/
@JsonProperty("clientId")
public void setClientId(String clientId) {
this.clientId = clientId;
}
public SigmaConnection withClientId(String clientId) {
this.clientId = clientId;
return this;
}
/**
* Client Secret
*
* clientSecret for Sigma.
* (Required)
*
*/
@JsonProperty("clientSecret")
@PasswordField
public String getClientSecret() {
return clientSecret;
}
/**
* Client Secret
*
* clientSecret for Sigma.
* (Required)
*
*/
@JsonProperty("clientSecret")
@PasswordField
public void setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
}
public SigmaConnection withClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
return this;
}
/**
* API Version
*
* Sigma API version.
*
*/
@JsonProperty("apiVersion")
public String getApiVersion() {
return apiVersion;
}
/**
* API Version
*
* Sigma API version.
*
*/
@JsonProperty("apiVersion")
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public SigmaConnection withApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(SigmaConnection.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("clientId");
sb.append('=');
sb.append(((this.clientId == null)?"":this.clientId));
sb.append(',');
sb.append("clientSecret");
sb.append('=');
sb.append(((this.clientSecret == null)?"":this.clientSecret));
sb.append(',');
sb.append("apiVersion");
sb.append('=');
sb.append(((this.apiVersion == null)?"":this.apiVersion));
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.hostPort == null)? 0 :this.hostPort.hashCode()));
result = ((result* 31)+((this.clientSecret == null)? 0 :this.clientSecret.hashCode()));
result = ((result* 31)+((this.clientId == null)? 0 :this.clientId.hashCode()));
result = ((result* 31)+((this.apiVersion == null)? 0 :this.apiVersion.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 SigmaConnection) == false) {
return false;
}
SigmaConnection rhs = ((SigmaConnection) other);
return ((((((this.hostPort == rhs.hostPort)||((this.hostPort!= null)&&this.hostPort.equals(rhs.hostPort)))&&((this.clientSecret == rhs.clientSecret)||((this.clientSecret!= null)&&this.clientSecret.equals(rhs.clientSecret))))&&((this.clientId == rhs.clientId)||((this.clientId!= null)&&this.clientId.equals(rhs.clientId))))&&((this.apiVersion == rhs.apiVersion)||((this.apiVersion!= null)&&this.apiVersion.equals(rhs.apiVersion))))&&((this.type == rhs.type)||((this.type!= null)&&this.type.equals(rhs.type))));
}
/**
* Sigma service type
*
*/
@Generated("jsonschema2pojo")
public enum SigmaType {
SIGMA("Sigma");
private final String value;
private final static Map CONSTANTS = new HashMap();
static {
for (SigmaConnection.SigmaType c: values()) {
CONSTANTS.put(c.value, c);
}
}
SigmaType(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static SigmaConnection.SigmaType fromValue(String value) {
SigmaConnection.SigmaType constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}