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

software.amazon.awssdk.services.eventbridge.model.RedshiftDataParameters Maven / Gradle / Ivy

Go to download

The AWS Java SDK for EventBridge module holds the client classes that are used for communicating with EventBridge.

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.eventbridge.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* These are custom parameters to be used when the target is a Redshift cluster to invoke the Redshift Data API * ExecuteStatement based on EventBridge events. *

*/ @Generated("software.amazon.awssdk:codegen") public final class RedshiftDataParameters implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField SECRET_MANAGER_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SecretManagerArn").getter(getter(RedshiftDataParameters::secretManagerArn)) .setter(setter(Builder::secretManagerArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretManagerArn").build()).build(); private static final SdkField DATABASE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("Database").getter(getter(RedshiftDataParameters::database)).setter(setter(Builder::database)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Database").build()).build(); private static final SdkField DB_USER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("DbUser") .getter(getter(RedshiftDataParameters::dbUser)).setter(setter(Builder::dbUser)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DbUser").build()).build(); private static final SdkField SQL_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Sql") .getter(getter(RedshiftDataParameters::sql)).setter(setter(Builder::sql)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Sql").build()).build(); private static final SdkField STATEMENT_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StatementName").getter(getter(RedshiftDataParameters::statementName)) .setter(setter(Builder::statementName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatementName").build()).build(); private static final SdkField WITH_EVENT_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("WithEvent").getter(getter(RedshiftDataParameters::withEvent)).setter(setter(Builder::withEvent)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WithEvent").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SECRET_MANAGER_ARN_FIELD, DATABASE_FIELD, DB_USER_FIELD, SQL_FIELD, STATEMENT_NAME_FIELD, WITH_EVENT_FIELD)); private static final long serialVersionUID = 1L; private final String secretManagerArn; private final String database; private final String dbUser; private final String sql; private final String statementName; private final Boolean withEvent; private RedshiftDataParameters(BuilderImpl builder) { this.secretManagerArn = builder.secretManagerArn; this.database = builder.database; this.dbUser = builder.dbUser; this.sql = builder.sql; this.statementName = builder.statementName; this.withEvent = builder.withEvent; } /** *

* The name or ARN of the secret that enables access to the database. Required when authenticating using AWS Secrets * Manager. *

* * @return The name or ARN of the secret that enables access to the database. Required when authenticating using AWS * Secrets Manager. */ public final String secretManagerArn() { return secretManagerArn; } /** *

* The name of the database. Required when authenticating using temporary credentials. *

* * @return The name of the database. Required when authenticating using temporary credentials. */ public final String database() { return database; } /** *

* The database user name. Required when authenticating using temporary credentials. *

* * @return The database user name. Required when authenticating using temporary credentials. */ public final String dbUser() { return dbUser; } /** *

* The SQL statement text to run. *

* * @return The SQL statement text to run. */ public final String sql() { return sql; } /** *

* The name of the SQL statement. You can name the SQL statement when you create it to identify the query. *

* * @return The name of the SQL statement. You can name the SQL statement when you create it to identify the query. */ public final String statementName() { return statementName; } /** *

* Indicates whether to send an event back to EventBridge after the SQL statement runs. *

* * @return Indicates whether to send an event back to EventBridge after the SQL statement runs. */ public final Boolean withEvent() { return withEvent; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(secretManagerArn()); hashCode = 31 * hashCode + Objects.hashCode(database()); hashCode = 31 * hashCode + Objects.hashCode(dbUser()); hashCode = 31 * hashCode + Objects.hashCode(sql()); hashCode = 31 * hashCode + Objects.hashCode(statementName()); hashCode = 31 * hashCode + Objects.hashCode(withEvent()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof RedshiftDataParameters)) { return false; } RedshiftDataParameters other = (RedshiftDataParameters) obj; return Objects.equals(secretManagerArn(), other.secretManagerArn()) && Objects.equals(database(), other.database()) && Objects.equals(dbUser(), other.dbUser()) && Objects.equals(sql(), other.sql()) && Objects.equals(statementName(), other.statementName()) && Objects.equals(withEvent(), other.withEvent()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("RedshiftDataParameters").add("SecretManagerArn", secretManagerArn()).add("Database", database()) .add("DbUser", dbUser()).add("Sql", sql()).add("StatementName", statementName()).add("WithEvent", withEvent()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "SecretManagerArn": return Optional.ofNullable(clazz.cast(secretManagerArn())); case "Database": return Optional.ofNullable(clazz.cast(database())); case "DbUser": return Optional.ofNullable(clazz.cast(dbUser())); case "Sql": return Optional.ofNullable(clazz.cast(sql())); case "StatementName": return Optional.ofNullable(clazz.cast(statementName())); case "WithEvent": return Optional.ofNullable(clazz.cast(withEvent())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((RedshiftDataParameters) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name or ARN of the secret that enables access to the database. Required when authenticating using AWS * Secrets Manager. *

* * @param secretManagerArn * The name or ARN of the secret that enables access to the database. Required when authenticating using * AWS Secrets Manager. * @return Returns a reference to this object so that method calls can be chained together. */ Builder secretManagerArn(String secretManagerArn); /** *

* The name of the database. Required when authenticating using temporary credentials. *

* * @param database * The name of the database. Required when authenticating using temporary credentials. * @return Returns a reference to this object so that method calls can be chained together. */ Builder database(String database); /** *

* The database user name. Required when authenticating using temporary credentials. *

* * @param dbUser * The database user name. Required when authenticating using temporary credentials. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dbUser(String dbUser); /** *

* The SQL statement text to run. *

* * @param sql * The SQL statement text to run. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sql(String sql); /** *

* The name of the SQL statement. You can name the SQL statement when you create it to identify the query. *

* * @param statementName * The name of the SQL statement. You can name the SQL statement when you create it to identify the * query. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statementName(String statementName); /** *

* Indicates whether to send an event back to EventBridge after the SQL statement runs. *

* * @param withEvent * Indicates whether to send an event back to EventBridge after the SQL statement runs. * @return Returns a reference to this object so that method calls can be chained together. */ Builder withEvent(Boolean withEvent); } static final class BuilderImpl implements Builder { private String secretManagerArn; private String database; private String dbUser; private String sql; private String statementName; private Boolean withEvent; private BuilderImpl() { } private BuilderImpl(RedshiftDataParameters model) { secretManagerArn(model.secretManagerArn); database(model.database); dbUser(model.dbUser); sql(model.sql); statementName(model.statementName); withEvent(model.withEvent); } public final String getSecretManagerArn() { return secretManagerArn; } @Override public final Builder secretManagerArn(String secretManagerArn) { this.secretManagerArn = secretManagerArn; return this; } public final void setSecretManagerArn(String secretManagerArn) { this.secretManagerArn = secretManagerArn; } public final String getDatabase() { return database; } @Override public final Builder database(String database) { this.database = database; return this; } public final void setDatabase(String database) { this.database = database; } public final String getDbUser() { return dbUser; } @Override public final Builder dbUser(String dbUser) { this.dbUser = dbUser; return this; } public final void setDbUser(String dbUser) { this.dbUser = dbUser; } public final String getSql() { return sql; } @Override public final Builder sql(String sql) { this.sql = sql; return this; } public final void setSql(String sql) { this.sql = sql; } public final String getStatementName() { return statementName; } @Override public final Builder statementName(String statementName) { this.statementName = statementName; return this; } public final void setStatementName(String statementName) { this.statementName = statementName; } public final Boolean getWithEvent() { return withEvent; } @Override public final Builder withEvent(Boolean withEvent) { this.withEvent = withEvent; return this; } public final void setWithEvent(Boolean withEvent) { this.withEvent = withEvent; } @Override public RedshiftDataParameters build() { return new RedshiftDataParameters(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy