/* * Copyright 2018-2023 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.rds.model; import java.io.Serializable; import javax.annotation.Generated; /** *
* Specifies the details of authentication used by a proxy to log in as a specific database user. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class UserAuthConfig implements Serializable, Cloneable { /** ** A user-specified description about the authentication used by a proxy to log in as a specific database user. *
*/ private String description; /** ** The name of the database user to which the proxy connects. *
*/ private String userName; /** ** The type of authentication that the proxy uses for connections from the proxy to the underlying database. *
*/ private String authScheme; /** ** The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB instance * or Aurora DB cluster. These secrets are stored within Amazon Secrets Manager. *
*/ private String secretArn; /** *
* Whether to require or disallow Amazon Web Services Identity and Access Management (IAM) authentication for
* connections to the proxy. The ENABLED
value is valid only for proxies with RDS for Microsoft SQL
* Server.
*
* The type of authentication the proxy uses for connections from clients. *
*/ private String clientPasswordAuthType; /** ** A user-specified description about the authentication used by a proxy to log in as a specific database user. *
* * @param description * A user-specified description about the authentication used by a proxy to log in as a specific database * user. */ public void setDescription(String description) { this.description = description; } /** ** A user-specified description about the authentication used by a proxy to log in as a specific database user. *
* * @return A user-specified description about the authentication used by a proxy to log in as a specific database * user. */ public String getDescription() { return this.description; } /** ** A user-specified description about the authentication used by a proxy to log in as a specific database user. *
* * @param description * A user-specified description about the authentication used by a proxy to log in as a specific database * user. * @return Returns a reference to this object so that method calls can be chained together. */ public UserAuthConfig withDescription(String description) { setDescription(description); return this; } /** ** The name of the database user to which the proxy connects. *
* * @param userName * The name of the database user to which the proxy connects. */ public void setUserName(String userName) { this.userName = userName; } /** ** The name of the database user to which the proxy connects. *
* * @return The name of the database user to which the proxy connects. */ public String getUserName() { return this.userName; } /** ** The name of the database user to which the proxy connects. *
* * @param userName * The name of the database user to which the proxy connects. * @return Returns a reference to this object so that method calls can be chained together. */ public UserAuthConfig withUserName(String userName) { setUserName(userName); return this; } /** ** The type of authentication that the proxy uses for connections from the proxy to the underlying database. *
* * @param authScheme * The type of authentication that the proxy uses for connections from the proxy to the underlying database. * @see AuthScheme */ public void setAuthScheme(String authScheme) { this.authScheme = authScheme; } /** ** The type of authentication that the proxy uses for connections from the proxy to the underlying database. *
* * @return The type of authentication that the proxy uses for connections from the proxy to the underlying database. * @see AuthScheme */ public String getAuthScheme() { return this.authScheme; } /** ** The type of authentication that the proxy uses for connections from the proxy to the underlying database. *
* * @param authScheme * The type of authentication that the proxy uses for connections from the proxy to the underlying database. * @return Returns a reference to this object so that method calls can be chained together. * @see AuthScheme */ public UserAuthConfig withAuthScheme(String authScheme) { setAuthScheme(authScheme); return this; } /** ** The type of authentication that the proxy uses for connections from the proxy to the underlying database. *
* * @param authScheme * The type of authentication that the proxy uses for connections from the proxy to the underlying database. * @return Returns a reference to this object so that method calls can be chained together. * @see AuthScheme */ public UserAuthConfig withAuthScheme(AuthScheme authScheme) { this.authScheme = authScheme.toString(); return this; } /** ** The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB instance * or Aurora DB cluster. These secrets are stored within Amazon Secrets Manager. *
* * @param secretArn * The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB * instance or Aurora DB cluster. These secrets are stored within Amazon Secrets Manager. */ public void setSecretArn(String secretArn) { this.secretArn = secretArn; } /** ** The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB instance * or Aurora DB cluster. These secrets are stored within Amazon Secrets Manager. *
* * @return The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB * instance or Aurora DB cluster. These secrets are stored within Amazon Secrets Manager. */ public String getSecretArn() { return this.secretArn; } /** ** The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB instance * or Aurora DB cluster. These secrets are stored within Amazon Secrets Manager. *
* * @param secretArn * The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB * instance or Aurora DB cluster. These secrets are stored within Amazon Secrets Manager. * @return Returns a reference to this object so that method calls can be chained together. */ public UserAuthConfig withSecretArn(String secretArn) { setSecretArn(secretArn); return this; } /** *
* Whether to require or disallow Amazon Web Services Identity and Access Management (IAM) authentication for
* connections to the proxy. The ENABLED
value is valid only for proxies with RDS for Microsoft SQL
* Server.
*
ENABLED
value is valid only for proxies with RDS for Microsoft
* SQL Server.
* @see IAMAuthMode
*/
public void setIAMAuth(String iAMAuth) {
this.iAMAuth = iAMAuth;
}
/**
*
* Whether to require or disallow Amazon Web Services Identity and Access Management (IAM) authentication for
* connections to the proxy. The ENABLED
value is valid only for proxies with RDS for Microsoft SQL
* Server.
*
ENABLED
value is valid only for proxies with RDS for
* Microsoft SQL Server.
* @see IAMAuthMode
*/
public String getIAMAuth() {
return this.iAMAuth;
}
/**
*
* Whether to require or disallow Amazon Web Services Identity and Access Management (IAM) authentication for
* connections to the proxy. The ENABLED
value is valid only for proxies with RDS for Microsoft SQL
* Server.
*
ENABLED
value is valid only for proxies with RDS for Microsoft
* SQL Server.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IAMAuthMode
*/
public UserAuthConfig withIAMAuth(String iAMAuth) {
setIAMAuth(iAMAuth);
return this;
}
/**
*
* Whether to require or disallow Amazon Web Services Identity and Access Management (IAM) authentication for
* connections to the proxy. The ENABLED
value is valid only for proxies with RDS for Microsoft SQL
* Server.
*
ENABLED
value is valid only for proxies with RDS for Microsoft
* SQL Server.
* @return Returns a reference to this object so that method calls can be chained together.
* @see IAMAuthMode
*/
public UserAuthConfig withIAMAuth(IAMAuthMode iAMAuth) {
this.iAMAuth = iAMAuth.toString();
return this;
}
/**
* * The type of authentication the proxy uses for connections from clients. *
* * @param clientPasswordAuthType * The type of authentication the proxy uses for connections from clients. * @see ClientPasswordAuthType */ public void setClientPasswordAuthType(String clientPasswordAuthType) { this.clientPasswordAuthType = clientPasswordAuthType; } /** ** The type of authentication the proxy uses for connections from clients. *
* * @return The type of authentication the proxy uses for connections from clients. * @see ClientPasswordAuthType */ public String getClientPasswordAuthType() { return this.clientPasswordAuthType; } /** ** The type of authentication the proxy uses for connections from clients. *
* * @param clientPasswordAuthType * The type of authentication the proxy uses for connections from clients. * @return Returns a reference to this object so that method calls can be chained together. * @see ClientPasswordAuthType */ public UserAuthConfig withClientPasswordAuthType(String clientPasswordAuthType) { setClientPasswordAuthType(clientPasswordAuthType); return this; } /** ** The type of authentication the proxy uses for connections from clients. *
* * @param clientPasswordAuthType * The type of authentication the proxy uses for connections from clients. * @return Returns a reference to this object so that method calls can be chained together. * @see ClientPasswordAuthType */ public UserAuthConfig withClientPasswordAuthType(ClientPasswordAuthType clientPasswordAuthType) { this.clientPasswordAuthType = clientPasswordAuthType.toString(); 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 (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getUserName() != null) sb.append("UserName: ").append(getUserName()).append(","); if (getAuthScheme() != null) sb.append("AuthScheme: ").append(getAuthScheme()).append(","); if (getSecretArn() != null) sb.append("SecretArn: ").append(getSecretArn()).append(","); if (getIAMAuth() != null) sb.append("IAMAuth: ").append(getIAMAuth()).append(","); if (getClientPasswordAuthType() != null) sb.append("ClientPasswordAuthType: ").append(getClientPasswordAuthType()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UserAuthConfig == false) return false; UserAuthConfig other = (UserAuthConfig) obj; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; if (other.getUserName() == null ^ this.getUserName() == null) return false; if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == false) return false; if (other.getAuthScheme() == null ^ this.getAuthScheme() == null) return false; if (other.getAuthScheme() != null && other.getAuthScheme().equals(this.getAuthScheme()) == 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.getIAMAuth() == null ^ this.getIAMAuth() == null) return false; if (other.getIAMAuth() != null && other.getIAMAuth().equals(this.getIAMAuth()) == false) return false; if (other.getClientPasswordAuthType() == null ^ this.getClientPasswordAuthType() == null) return false; if (other.getClientPasswordAuthType() != null && other.getClientPasswordAuthType().equals(this.getClientPasswordAuthType()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); hashCode = prime * hashCode + ((getAuthScheme() == null) ? 0 : getAuthScheme().hashCode()); hashCode = prime * hashCode + ((getSecretArn() == null) ? 0 : getSecretArn().hashCode()); hashCode = prime * hashCode + ((getIAMAuth() == null) ? 0 : getIAMAuth().hashCode()); hashCode = prime * hashCode + ((getClientPasswordAuthType() == null) ? 0 : getClientPasswordAuthType().hashCode()); return hashCode; } @Override public UserAuthConfig clone() { try { return (UserAuthConfig) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }