com.amazonaws.services.redshift.model.GetClusterCredentialsResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-redshift Show documentation
/*
* Copyright 2019-2024 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.redshift.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Temporary credentials with authorization to log on to an Amazon Redshift database.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class GetClusterCredentialsResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* A database user name that is authorized to log on to the database DbName
using the password
* DbPassword
. If the specified DbUser exists in the database, the new user name has the same database
* permissions as the the user named in DbUser. By default, the user is added to PUBLIC. If the
* DbGroups
parameter is specifed, DbUser
is added to the listed groups for any sessions
* created using these credentials.
*
*/
private String dbUser;
/**
*
* A temporary password that authorizes the user name returned by DbUser
to log on to the database
* DbName
.
*
*/
private String dbPassword;
/**
*
* The date and time the password in DbPassword
expires.
*
*/
private java.util.Date expiration;
/**
*
* A database user name that is authorized to log on to the database DbName
using the password
* DbPassword
. If the specified DbUser exists in the database, the new user name has the same database
* permissions as the the user named in DbUser. By default, the user is added to PUBLIC. If the
* DbGroups
parameter is specifed, DbUser
is added to the listed groups for any sessions
* created using these credentials.
*
*
* @param dbUser
* A database user name that is authorized to log on to the database DbName
using the password
* DbPassword
. If the specified DbUser exists in the database, the new user name has the same
* database permissions as the the user named in DbUser. By default, the user is added to PUBLIC. If the
* DbGroups
parameter is specifed, DbUser
is added to the listed groups for any
* sessions created using these credentials.
*/
public void setDbUser(String dbUser) {
this.dbUser = dbUser;
}
/**
*
* A database user name that is authorized to log on to the database DbName
using the password
* DbPassword
. If the specified DbUser exists in the database, the new user name has the same database
* permissions as the the user named in DbUser. By default, the user is added to PUBLIC. If the
* DbGroups
parameter is specifed, DbUser
is added to the listed groups for any sessions
* created using these credentials.
*
*
* @return A database user name that is authorized to log on to the database DbName
using the password
* DbPassword
. If the specified DbUser exists in the database, the new user name has the same
* database permissions as the the user named in DbUser. By default, the user is added to PUBLIC. If the
* DbGroups
parameter is specifed, DbUser
is added to the listed groups for any
* sessions created using these credentials.
*/
public String getDbUser() {
return this.dbUser;
}
/**
*
* A database user name that is authorized to log on to the database DbName
using the password
* DbPassword
. If the specified DbUser exists in the database, the new user name has the same database
* permissions as the the user named in DbUser. By default, the user is added to PUBLIC. If the
* DbGroups
parameter is specifed, DbUser
is added to the listed groups for any sessions
* created using these credentials.
*
*
* @param dbUser
* A database user name that is authorized to log on to the database DbName
using the password
* DbPassword
. If the specified DbUser exists in the database, the new user name has the same
* database permissions as the the user named in DbUser. By default, the user is added to PUBLIC. If the
* DbGroups
parameter is specifed, DbUser
is added to the listed groups for any
* sessions created using these credentials.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetClusterCredentialsResult withDbUser(String dbUser) {
setDbUser(dbUser);
return this;
}
/**
*
* A temporary password that authorizes the user name returned by DbUser
to log on to the database
* DbName
.
*
*
* @param dbPassword
* A temporary password that authorizes the user name returned by DbUser
to log on to the
* database DbName
.
*/
public void setDbPassword(String dbPassword) {
this.dbPassword = dbPassword;
}
/**
*
* A temporary password that authorizes the user name returned by DbUser
to log on to the database
* DbName
.
*
*
* @return A temporary password that authorizes the user name returned by DbUser
to log on to the
* database DbName
.
*/
public String getDbPassword() {
return this.dbPassword;
}
/**
*
* A temporary password that authorizes the user name returned by DbUser
to log on to the database
* DbName
.
*
*
* @param dbPassword
* A temporary password that authorizes the user name returned by DbUser
to log on to the
* database DbName
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetClusterCredentialsResult withDbPassword(String dbPassword) {
setDbPassword(dbPassword);
return this;
}
/**
*
* The date and time the password in DbPassword
expires.
*
*
* @param expiration
* The date and time the password in DbPassword
expires.
*/
public void setExpiration(java.util.Date expiration) {
this.expiration = expiration;
}
/**
*
* The date and time the password in DbPassword
expires.
*
*
* @return The date and time the password in DbPassword
expires.
*/
public java.util.Date getExpiration() {
return this.expiration;
}
/**
*
* The date and time the password in DbPassword
expires.
*
*
* @param expiration
* The date and time the password in DbPassword
expires.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public GetClusterCredentialsResult withExpiration(java.util.Date expiration) {
setExpiration(expiration);
return this;
}
/**
* 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 (getDbUser() != null)
sb.append("DbUser: ").append(getDbUser()).append(",");
if (getDbPassword() != null)
sb.append("DbPassword: ").append("***Sensitive Data Redacted***").append(",");
if (getExpiration() != null)
sb.append("Expiration: ").append(getExpiration());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetClusterCredentialsResult == false)
return false;
GetClusterCredentialsResult other = (GetClusterCredentialsResult) obj;
if (other.getDbUser() == null ^ this.getDbUser() == null)
return false;
if (other.getDbUser() != null && other.getDbUser().equals(this.getDbUser()) == false)
return false;
if (other.getDbPassword() == null ^ this.getDbPassword() == null)
return false;
if (other.getDbPassword() != null && other.getDbPassword().equals(this.getDbPassword()) == false)
return false;
if (other.getExpiration() == null ^ this.getExpiration() == null)
return false;
if (other.getExpiration() != null && other.getExpiration().equals(this.getExpiration()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDbUser() == null) ? 0 : getDbUser().hashCode());
hashCode = prime * hashCode + ((getDbPassword() == null) ? 0 : getDbPassword().hashCode());
hashCode = prime * hashCode + ((getExpiration() == null) ? 0 : getExpiration().hashCode());
return hashCode;
}
@Override
public GetClusterCredentialsResult clone() {
try {
return (GetClusterCredentialsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}