software.amazon.awscdk.services.glue.alpha.ConnectionOptions Maven / Gradle / Ivy
Show all versions of glue-alpha Show documentation
package software.amazon.awscdk.services.glue.alpha;
/**
* (experimental) Base Connection Options.
*
* Example:
*
*
* // The code below shows an example of how to instantiate this type.
* // The values are placeholders you should change.
* import software.amazon.awscdk.services.glue.alpha.*;
* import software.amazon.awscdk.services.ec2.*;
* SecurityGroup securityGroup;
* Subnet subnet;
* ConnectionOptions connectionOptions = ConnectionOptions.builder()
* .connectionName("connectionName")
* .description("description")
* .matchCriteria(List.of("matchCriteria"))
* .properties(Map.of(
* "propertiesKey", "properties"))
* .securityGroups(List.of(securityGroup))
* .subnet(subnet)
* .build();
*
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.99.0 (build 8f757e4)", date = "2024-06-13T18:49:27.651Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.glue.alpha.$Module.class, fqn = "@aws-cdk/aws-glue-alpha.ConnectionOptions")
@software.amazon.jsii.Jsii.Proxy(ConnectionOptions.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public interface ConnectionOptions extends software.amazon.jsii.JsiiSerializable {
/**
* (experimental) The name of the connection.
*
* Default: cloudformation generated name
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getConnectionName() {
return null;
}
/**
* (experimental) The description of the connection.
*
* Default: no description
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.lang.String getDescription() {
return null;
}
/**
* (experimental) A list of criteria that can be used in selecting this connection.
*
* This is useful for filtering the results of https://awscli.amazonaws.com/v2/documentation/api/latest/reference/glue/get-connections.html
*
* Default: no match criteria
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getMatchCriteria() {
return null;
}
/**
* (experimental) Key-Value pairs that define parameters for the connection.
*
* Default: empty properties
*
* @see https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-connect.html
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.Map getProperties() {
return null;
}
/**
* (experimental) The list of security groups needed to successfully make this connection e.g. to successfully connect to VPC.
*
* Default: no security group
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable java.util.List getSecurityGroups() {
return null;
}
/**
* (experimental) The VPC subnet to connect to resources within a VPC.
*
* See more at https://docs.aws.amazon.com/glue/latest/dg/start-connecting.html.
*
* Default: no subnet
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ec2.ISubnet getSubnet() {
return null;
}
/**
* @return a {@link Builder} of {@link ConnectionOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ConnectionOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
java.lang.String connectionName;
java.lang.String description;
java.util.List matchCriteria;
java.util.Map properties;
java.util.List securityGroups;
software.amazon.awscdk.services.ec2.ISubnet subnet;
/**
* Sets the value of {@link ConnectionOptions#getConnectionName}
* @param connectionName The name of the connection.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder connectionName(java.lang.String connectionName) {
this.connectionName = connectionName;
return this;
}
/**
* Sets the value of {@link ConnectionOptions#getDescription}
* @param description The description of the connection.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder description(java.lang.String description) {
this.description = description;
return this;
}
/**
* Sets the value of {@link ConnectionOptions#getMatchCriteria}
* @param matchCriteria A list of criteria that can be used in selecting this connection.
* This is useful for filtering the results of https://awscli.amazonaws.com/v2/documentation/api/latest/reference/glue/get-connections.html
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder matchCriteria(java.util.List matchCriteria) {
this.matchCriteria = matchCriteria;
return this;
}
/**
* Sets the value of {@link ConnectionOptions#getProperties}
* @param properties Key-Value pairs that define parameters for the connection.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder properties(java.util.Map properties) {
this.properties = properties;
return this;
}
/**
* Sets the value of {@link ConnectionOptions#getSecurityGroups}
* @param securityGroups The list of security groups needed to successfully make this connection e.g. to successfully connect to VPC.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@SuppressWarnings("unchecked")
public Builder securityGroups(java.util.List extends software.amazon.awscdk.services.ec2.ISecurityGroup> securityGroups) {
this.securityGroups = (java.util.List)securityGroups;
return this;
}
/**
* Sets the value of {@link ConnectionOptions#getSubnet}
* @param subnet The VPC subnet to connect to resources within a VPC.
* See more at https://docs.aws.amazon.com/glue/latest/dg/start-connecting.html.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder subnet(software.amazon.awscdk.services.ec2.ISubnet subnet) {
this.subnet = subnet;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ConnectionOptions}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public ConnectionOptions build() {
return new Jsii$Proxy(this);
}
}
/**
* An implementation for {@link ConnectionOptions}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ConnectionOptions {
private final java.lang.String connectionName;
private final java.lang.String description;
private final java.util.List matchCriteria;
private final java.util.Map properties;
private final java.util.List securityGroups;
private final software.amazon.awscdk.services.ec2.ISubnet subnet;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.connectionName = software.amazon.jsii.Kernel.get(this, "connectionName", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.description = software.amazon.jsii.Kernel.get(this, "description", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.matchCriteria = software.amazon.jsii.Kernel.get(this, "matchCriteria", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.properties = software.amazon.jsii.Kernel.get(this, "properties", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
this.securityGroups = software.amazon.jsii.Kernel.get(this, "securityGroups", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.ISecurityGroup.class)));
this.subnet = software.amazon.jsii.Kernel.get(this, "subnet", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ec2.ISubnet.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
@SuppressWarnings("unchecked")
protected Jsii$Proxy(final Builder builder) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.connectionName = builder.connectionName;
this.description = builder.description;
this.matchCriteria = builder.matchCriteria;
this.properties = builder.properties;
this.securityGroups = (java.util.List)builder.securityGroups;
this.subnet = builder.subnet;
}
@Override
public final java.lang.String getConnectionName() {
return this.connectionName;
}
@Override
public final java.lang.String getDescription() {
return this.description;
}
@Override
public final java.util.List getMatchCriteria() {
return this.matchCriteria;
}
@Override
public final java.util.Map getProperties() {
return this.properties;
}
@Override
public final java.util.List getSecurityGroups() {
return this.securityGroups;
}
@Override
public final software.amazon.awscdk.services.ec2.ISubnet getSubnet() {
return this.subnet;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getConnectionName() != null) {
data.set("connectionName", om.valueToTree(this.getConnectionName()));
}
if (this.getDescription() != null) {
data.set("description", om.valueToTree(this.getDescription()));
}
if (this.getMatchCriteria() != null) {
data.set("matchCriteria", om.valueToTree(this.getMatchCriteria()));
}
if (this.getProperties() != null) {
data.set("properties", om.valueToTree(this.getProperties()));
}
if (this.getSecurityGroups() != null) {
data.set("securityGroups", om.valueToTree(this.getSecurityGroups()));
}
if (this.getSubnet() != null) {
data.set("subnet", om.valueToTree(this.getSubnet()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("@aws-cdk/aws-glue-alpha.ConnectionOptions"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ConnectionOptions.Jsii$Proxy that = (ConnectionOptions.Jsii$Proxy) o;
if (this.connectionName != null ? !this.connectionName.equals(that.connectionName) : that.connectionName != null) return false;
if (this.description != null ? !this.description.equals(that.description) : that.description != null) return false;
if (this.matchCriteria != null ? !this.matchCriteria.equals(that.matchCriteria) : that.matchCriteria != null) return false;
if (this.properties != null ? !this.properties.equals(that.properties) : that.properties != null) return false;
if (this.securityGroups != null ? !this.securityGroups.equals(that.securityGroups) : that.securityGroups != null) return false;
return this.subnet != null ? this.subnet.equals(that.subnet) : that.subnet == null;
}
@Override
public final int hashCode() {
int result = this.connectionName != null ? this.connectionName.hashCode() : 0;
result = 31 * result + (this.description != null ? this.description.hashCode() : 0);
result = 31 * result + (this.matchCriteria != null ? this.matchCriteria.hashCode() : 0);
result = 31 * result + (this.properties != null ? this.properties.hashCode() : 0);
result = 31 * result + (this.securityGroups != null ? this.securityGroups.hashCode() : 0);
result = 31 * result + (this.subnet != null ? this.subnet.hashCode() : 0);
return result;
}
}
}