com.amazonaws.services.redshiftdataapi.model.BatchExecuteStatementRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-redshiftdataapi Show documentation
/*
* Copyright 2017-2022 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 com.amazonaws.services.redshiftdataapi.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class BatchExecuteStatementRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either
* Secrets Manager or temporary credentials.
*
*/
private String clusterIdentifier;
/**
*
* The name of the database. This parameter is required when authenticating using either Secrets Manager or
* temporary credentials.
*
*/
private String database;
/**
*
* The database user name. This parameter is required when connecting to a cluster and authenticating using
* temporary credentials.
*
*/
private String dbUser;
/**
*
* The name or ARN of the secret that enables access to the database. This parameter is required when authenticating
* using Secrets Manager.
*
*/
private String secretArn;
/**
*
* One or more SQL statements to run.
*
*/
private java.util.List sqls;
/**
*
* The name of the SQL statements. You can name the SQL statements when you create them to identify the query.
*
*/
private String statementName;
/**
*
* A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statements run.
*
*/
private Boolean withEvent;
/**
*
* The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either
* Secrets Manager or temporary credentials.
*
*
* @param clusterIdentifier
* The cluster identifier. This parameter is required when connecting to a cluster and authenticating using
* either Secrets Manager or temporary credentials.
*/
public void setClusterIdentifier(String clusterIdentifier) {
this.clusterIdentifier = clusterIdentifier;
}
/**
*
* The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either
* Secrets Manager or temporary credentials.
*
*
* @return The cluster identifier. This parameter is required when connecting to a cluster and authenticating using
* either Secrets Manager or temporary credentials.
*/
public String getClusterIdentifier() {
return this.clusterIdentifier;
}
/**
*
* The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either
* Secrets Manager or temporary credentials.
*
*
* @param clusterIdentifier
* The cluster identifier. This parameter is required when connecting to a cluster and authenticating using
* either Secrets Manager or temporary credentials.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchExecuteStatementRequest withClusterIdentifier(String clusterIdentifier) {
setClusterIdentifier(clusterIdentifier);
return this;
}
/**
*
* The name of the database. This parameter is required when authenticating using either Secrets Manager or
* temporary credentials.
*
*
* @param database
* The name of the database. This parameter is required when authenticating using either Secrets Manager or
* temporary credentials.
*/
public void setDatabase(String database) {
this.database = database;
}
/**
*
* The name of the database. This parameter is required when authenticating using either Secrets Manager or
* temporary credentials.
*
*
* @return The name of the database. This parameter is required when authenticating using either Secrets Manager or
* temporary credentials.
*/
public String getDatabase() {
return this.database;
}
/**
*
* The name of the database. This parameter is required when authenticating using either Secrets Manager or
* temporary credentials.
*
*
* @param database
* The name of the database. This parameter is required when authenticating using either Secrets Manager or
* temporary credentials.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchExecuteStatementRequest withDatabase(String database) {
setDatabase(database);
return this;
}
/**
*
* The database user name. This parameter is required when connecting to a cluster and authenticating using
* temporary credentials.
*
*
* @param dbUser
* The database user name. This parameter is required when connecting to a cluster and authenticating using
* temporary credentials.
*/
public void setDbUser(String dbUser) {
this.dbUser = dbUser;
}
/**
*
* The database user name. This parameter is required when connecting to a cluster and authenticating using
* temporary credentials.
*
*
* @return The database user name. This parameter is required when connecting to a cluster and authenticating using
* temporary credentials.
*/
public String getDbUser() {
return this.dbUser;
}
/**
*
* The database user name. This parameter is required when connecting to a cluster and authenticating using
* temporary credentials.
*
*
* @param dbUser
* The database user name. This parameter is required when connecting to a cluster and authenticating using
* temporary credentials.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchExecuteStatementRequest withDbUser(String dbUser) {
setDbUser(dbUser);
return this;
}
/**
*
* The name or ARN of the secret that enables access to the database. This parameter is required when authenticating
* using Secrets Manager.
*
*
* @param secretArn
* The name or ARN of the secret that enables access to the database. This parameter is required when
* authenticating using Secrets Manager.
*/
public void setSecretArn(String secretArn) {
this.secretArn = secretArn;
}
/**
*
* The name or ARN of the secret that enables access to the database. This parameter is required when authenticating
* using Secrets Manager.
*
*
* @return The name or ARN of the secret that enables access to the database. This parameter is required when
* authenticating using Secrets Manager.
*/
public String getSecretArn() {
return this.secretArn;
}
/**
*
* The name or ARN of the secret that enables access to the database. This parameter is required when authenticating
* using Secrets Manager.
*
*
* @param secretArn
* The name or ARN of the secret that enables access to the database. This parameter is required when
* authenticating using Secrets Manager.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchExecuteStatementRequest withSecretArn(String secretArn) {
setSecretArn(secretArn);
return this;
}
/**
*
* One or more SQL statements to run.
*
*
* @return One or more SQL statements to run.
*/
public java.util.List getSqls() {
return sqls;
}
/**
*
* One or more SQL statements to run.
*
*
* @param sqls
* One or more SQL statements to run.
*/
public void setSqls(java.util.Collection sqls) {
if (sqls == null) {
this.sqls = null;
return;
}
this.sqls = new java.util.ArrayList(sqls);
}
/**
*
* One or more SQL statements to run.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSqls(java.util.Collection)} or {@link #withSqls(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param sqls
* One or more SQL statements to run.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchExecuteStatementRequest withSqls(String... sqls) {
if (this.sqls == null) {
setSqls(new java.util.ArrayList(sqls.length));
}
for (String ele : sqls) {
this.sqls.add(ele);
}
return this;
}
/**
*
* One or more SQL statements to run.
*
*
* @param sqls
* One or more SQL statements to run.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchExecuteStatementRequest withSqls(java.util.Collection sqls) {
setSqls(sqls);
return this;
}
/**
*
* The name of the SQL statements. You can name the SQL statements when you create them to identify the query.
*
*
* @param statementName
* The name of the SQL statements. You can name the SQL statements when you create them to identify the
* query.
*/
public void setStatementName(String statementName) {
this.statementName = statementName;
}
/**
*
* The name of the SQL statements. You can name the SQL statements when you create them to identify the query.
*
*
* @return The name of the SQL statements. You can name the SQL statements when you create them to identify the
* query.
*/
public String getStatementName() {
return this.statementName;
}
/**
*
* The name of the SQL statements. You can name the SQL statements when you create them to identify the query.
*
*
* @param statementName
* The name of the SQL statements. You can name the SQL statements when you create them to identify the
* query.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchExecuteStatementRequest withStatementName(String statementName) {
setStatementName(statementName);
return this;
}
/**
*
* A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statements run.
*
*
* @param withEvent
* A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL
* statements run.
*/
public void setWithEvent(Boolean withEvent) {
this.withEvent = withEvent;
}
/**
*
* A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statements run.
*
*
* @return A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL
* statements run.
*/
public Boolean getWithEvent() {
return this.withEvent;
}
/**
*
* A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statements run.
*
*
* @param withEvent
* A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL
* statements run.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchExecuteStatementRequest withWithEvent(Boolean withEvent) {
setWithEvent(withEvent);
return this;
}
/**
*
* A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statements run.
*
*
* @return A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL
* statements run.
*/
public Boolean isWithEvent() {
return this.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.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getClusterIdentifier() != null)
sb.append("ClusterIdentifier: ").append(getClusterIdentifier()).append(",");
if (getDatabase() != null)
sb.append("Database: ").append(getDatabase()).append(",");
if (getDbUser() != null)
sb.append("DbUser: ").append(getDbUser()).append(",");
if (getSecretArn() != null)
sb.append("SecretArn: ").append(getSecretArn()).append(",");
if (getSqls() != null)
sb.append("Sqls: ").append(getSqls()).append(",");
if (getStatementName() != null)
sb.append("StatementName: ").append(getStatementName()).append(",");
if (getWithEvent() != null)
sb.append("WithEvent: ").append(getWithEvent());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof BatchExecuteStatementRequest == false)
return false;
BatchExecuteStatementRequest other = (BatchExecuteStatementRequest) obj;
if (other.getClusterIdentifier() == null ^ this.getClusterIdentifier() == null)
return false;
if (other.getClusterIdentifier() != null && other.getClusterIdentifier().equals(this.getClusterIdentifier()) == false)
return false;
if (other.getDatabase() == null ^ this.getDatabase() == null)
return false;
if (other.getDatabase() != null && other.getDatabase().equals(this.getDatabase()) == false)
return false;
if (other.getDbUser() == null ^ this.getDbUser() == null)
return false;
if (other.getDbUser() != null && other.getDbUser().equals(this.getDbUser()) == false)
return false;
if (other.getSecretArn() == null ^ this.getSecretArn() == null)
return false;
if (other.getSecretArn() != null && other.getSecretArn().equals(this.getSecretArn()) == false)
return false;
if (other.getSqls() == null ^ this.getSqls() == null)
return false;
if (other.getSqls() != null && other.getSqls().equals(this.getSqls()) == false)
return false;
if (other.getStatementName() == null ^ this.getStatementName() == null)
return false;
if (other.getStatementName() != null && other.getStatementName().equals(this.getStatementName()) == false)
return false;
if (other.getWithEvent() == null ^ this.getWithEvent() == null)
return false;
if (other.getWithEvent() != null && other.getWithEvent().equals(this.getWithEvent()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClusterIdentifier() == null) ? 0 : getClusterIdentifier().hashCode());
hashCode = prime * hashCode + ((getDatabase() == null) ? 0 : getDatabase().hashCode());
hashCode = prime * hashCode + ((getDbUser() == null) ? 0 : getDbUser().hashCode());
hashCode = prime * hashCode + ((getSecretArn() == null) ? 0 : getSecretArn().hashCode());
hashCode = prime * hashCode + ((getSqls() == null) ? 0 : getSqls().hashCode());
hashCode = prime * hashCode + ((getStatementName() == null) ? 0 : getStatementName().hashCode());
hashCode = prime * hashCode + ((getWithEvent() == null) ? 0 : getWithEvent().hashCode());
return hashCode;
}
@Override
public BatchExecuteStatementRequest clone() {
return (BatchExecuteStatementRequest) super.clone();
}
}