All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.redshift.alpha.Table Maven / Gradle / Ivy

There is a newer version: 2.167.1-alpha.0
Show newest version
package software.amazon.awscdk.services.redshift.alpha;

/**
 * (experimental) A table in a Redshift cluster.
 * 

* Example: *

*

 * Table.Builder.create(this, "Table")
 *         .tableColumns(List.of(Column.builder().name("col1").dataType("varchar(4)").distKey(true).build(), Column.builder().name("col2").dataType("float").build()))
 *         .cluster(cluster)
 *         .databaseName("databaseName")
 *         .distStyle(TableDistStyle.KEY)
 *         .build();
 * 
*/ @javax.annotation.Generated(value = "jsii-pacmak/1.103.1 (build bef2dea)", date = "2024-10-10T18:25:33.209Z") @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.redshift.alpha.$Module.class, fqn = "@aws-cdk/aws-redshift-alpha.Table") public class Table extends software.constructs.Construct implements software.amazon.awscdk.services.redshift.alpha.ITable { protected Table(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); } protected Table(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) { super(initializationMode); } /** * @param scope This parameter is required. * @param id This parameter is required. * @param props This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Table(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.redshift.alpha.TableProps props) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(props, "props is required") }); } /** * (experimental) Specify a Redshift table using a table name and schema that already exists. *

* @param scope This parameter is required. * @param id This parameter is required. * @param attrs This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.redshift.alpha.ITable fromTableAttributes(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String id, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.redshift.alpha.TableAttributes attrs) { return software.amazon.jsii.JsiiObject.jsiiStaticCall(software.amazon.awscdk.services.redshift.alpha.Table.class, "fromTableAttributes", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.redshift.alpha.ITable.class), new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(id, "id is required"), java.util.Objects.requireNonNull(attrs, "attrs is required") }); } /** * (experimental) Apply the given removal policy to this resource. *

* The Removal Policy controls what happens to this resource when it stops * being managed by CloudFormation, either because you've removed it from the * CDK application or because you've made a change that requires the resource * to be replaced. *

* The resource can be destroyed (RemovalPolicy.DESTROY), or left in your AWS * account for data recovery and cleanup later (RemovalPolicy.RETAIN). *

* This resource is retained by default. *

* @param policy This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public void applyRemovalPolicy(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.RemovalPolicy policy) { software.amazon.jsii.Kernel.call(this, "applyRemovalPolicy", software.amazon.jsii.NativeType.VOID, new Object[] { java.util.Objects.requireNonNull(policy, "policy is required") }); } /** * (experimental) Grant a user privilege to access this table. *

* @param user This parameter is required. * @param actions This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public void grant(final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.redshift.alpha.IUser user, final @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.redshift.alpha.TableAction... actions) { software.amazon.jsii.Kernel.call(this, "grant", software.amazon.jsii.NativeType.VOID, java.util.stream.Stream.concat(java.util.Arrays.stream(new Object[] { java.util.Objects.requireNonNull(user, "user is required") }), java.util.Arrays.stream(actions)).toArray(Object[]::new)); } /** * (experimental) The cluster where the table is located. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.redshift.alpha.ICluster getCluster() { return software.amazon.jsii.Kernel.get(this, "cluster", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.redshift.alpha.ICluster.class)); } /** * (experimental) The name of the database where the table is located. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.lang.String getDatabaseName() { return software.amazon.jsii.Kernel.get(this, "databaseName", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * (experimental) The columns of the table. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.util.List getTableColumns() { return java.util.Collections.unmodifiableList(software.amazon.jsii.Kernel.get(this, "tableColumns", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.redshift.alpha.Column.class)))); } /** * (experimental) Name of the table. */ @Override @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public @org.jetbrains.annotations.NotNull java.lang.String getTableName() { return software.amazon.jsii.Kernel.get(this, "tableName", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * (experimental) A fluent builder for {@link software.amazon.awscdk.services.redshift.alpha.Table}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static final class Builder implements software.amazon.jsii.Builder { /** * @return a new instance of {@link Builder}. * @param scope This parameter is required. * @param id This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public static Builder create(final software.constructs.Construct scope, final java.lang.String id) { return new Builder(scope, id); } private final software.constructs.Construct scope; private final java.lang.String id; private final software.amazon.awscdk.services.redshift.alpha.TableProps.Builder props; private Builder(final software.constructs.Construct scope, final java.lang.String id) { this.scope = scope; this.id = id; this.props = new software.amazon.awscdk.services.redshift.alpha.TableProps.Builder(); } /** * (experimental) The cluster containing the database. *

* @return {@code this} * @param cluster The cluster containing the database. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder cluster(final software.amazon.awscdk.services.redshift.alpha.ICluster cluster) { this.props.cluster(cluster); return this; } /** * (experimental) The name of the database. *

* @return {@code this} * @param databaseName The name of the database. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder databaseName(final java.lang.String databaseName) { this.props.databaseName(databaseName); return this; } /** * (experimental) The secret containing credentials to a Redshift user with administrator privileges. *

* Secret JSON schema: { username: string; password: string }. *

* Default: - the admin secret is taken from the cluster *

* @return {@code this} * @param adminUser The secret containing credentials to a Redshift user with administrator privileges. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder adminUser(final software.amazon.awscdk.services.secretsmanager.ISecret adminUser) { this.props.adminUser(adminUser); return this; } /** * (experimental) The columns of the table. *

* @return {@code this} * @param tableColumns The columns of the table. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder tableColumns(final java.util.List tableColumns) { this.props.tableColumns(tableColumns); return this; } /** * (experimental) The distribution style of the table. *

* Default: TableDistStyle.AUTO *

* @return {@code this} * @param distStyle The distribution style of the table. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder distStyle(final software.amazon.awscdk.services.redshift.alpha.TableDistStyle distStyle) { this.props.distStyle(distStyle); return this; } /** * (experimental) The policy to apply when this resource is removed from the application. *

* Default: cdk.RemovalPolicy.Retain *

* @return {@code this} * @param removalPolicy The policy to apply when this resource is removed from the application. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder removalPolicy(final software.amazon.awscdk.RemovalPolicy removalPolicy) { this.props.removalPolicy(removalPolicy); return this; } /** * (experimental) The sort style of the table. *

* Default: TableSortStyle.AUTO if no sort key is specified, TableSortStyle.COMPOUND if a sort key is specified *

* @return {@code this} * @param sortStyle The sort style of the table. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder sortStyle(final software.amazon.awscdk.services.redshift.alpha.TableSortStyle sortStyle) { this.props.sortStyle(sortStyle); return this; } /** * (experimental) A comment to attach to the table. *

* Default: - no comment *

* @return {@code this} * @param tableComment A comment to attach to the table. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder tableComment(final java.lang.String tableComment) { this.props.tableComment(tableComment); return this; } /** * (experimental) The name of the table. *

* Default: - a name is generated *

* @return {@code this} * @param tableName The name of the table. This parameter is required. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) public Builder tableName(final java.lang.String tableName) { this.props.tableName(tableName); return this; } /** * @return a newly built instance of {@link software.amazon.awscdk.services.redshift.alpha.Table}. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental) @Override public software.amazon.awscdk.services.redshift.alpha.Table build() { return new software.amazon.awscdk.services.redshift.alpha.Table( this.scope, this.id, this.props.build() ); } } }