com.amazonaws.services.redshiftserverless.model.Namespace Maven / Gradle / Ivy
Show all versions of aws-java-sdk-redshiftserverless 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.redshiftserverless.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A collection of database objects and users.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Namespace implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Resource Name (ARN) for the namespace's admin user credentials secret.
*
*/
private String adminPasswordSecretArn;
/**
*
* The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials
* secret.
*
*/
private String adminPasswordSecretKmsKeyId;
/**
*
* The username of the administrator for the first database created in the namespace.
*
*/
private String adminUsername;
/**
*
* The date of when the namespace was created.
*
*/
private java.util.Date creationDate;
/**
*
* The name of the first database created in the namespace.
*
*/
private String dbName;
/**
*
* The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
*
*/
private String defaultIamRoleArn;
/**
*
* A list of IAM roles to associate with the namespace.
*
*/
private java.util.List iamRoles;
/**
*
* The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
*
*/
private String kmsKeyId;
/**
*
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
*
*/
private java.util.List logExports;
/**
*
* The Amazon Resource Name (ARN) associated with a namespace.
*
*/
private String namespaceArn;
/**
*
* The unique identifier of a namespace.
*
*/
private String namespaceId;
/**
*
* The name of the namespace. Must be between 3-64 alphanumeric characters in lowercase, and it cannot be a reserved
* word. A list of reserved words can be found in Reserved Words in the Amazon
* Redshift Database Developer Guide.
*
*/
private String namespaceName;
/**
*
* The status of the namespace.
*
*/
private String status;
/**
*
* The Amazon Resource Name (ARN) for the namespace's admin user credentials secret.
*
*
* @param adminPasswordSecretArn
* The Amazon Resource Name (ARN) for the namespace's admin user credentials secret.
*/
public void setAdminPasswordSecretArn(String adminPasswordSecretArn) {
this.adminPasswordSecretArn = adminPasswordSecretArn;
}
/**
*
* The Amazon Resource Name (ARN) for the namespace's admin user credentials secret.
*
*
* @return The Amazon Resource Name (ARN) for the namespace's admin user credentials secret.
*/
public String getAdminPasswordSecretArn() {
return this.adminPasswordSecretArn;
}
/**
*
* The Amazon Resource Name (ARN) for the namespace's admin user credentials secret.
*
*
* @param adminPasswordSecretArn
* The Amazon Resource Name (ARN) for the namespace's admin user credentials secret.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withAdminPasswordSecretArn(String adminPasswordSecretArn) {
setAdminPasswordSecretArn(adminPasswordSecretArn);
return this;
}
/**
*
* The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials
* secret.
*
*
* @param adminPasswordSecretKmsKeyId
* The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials
* secret.
*/
public void setAdminPasswordSecretKmsKeyId(String adminPasswordSecretKmsKeyId) {
this.adminPasswordSecretKmsKeyId = adminPasswordSecretKmsKeyId;
}
/**
*
* The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials
* secret.
*
*
* @return The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin
* credentials secret.
*/
public String getAdminPasswordSecretKmsKeyId() {
return this.adminPasswordSecretKmsKeyId;
}
/**
*
* The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials
* secret.
*
*
* @param adminPasswordSecretKmsKeyId
* The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials
* secret.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withAdminPasswordSecretKmsKeyId(String adminPasswordSecretKmsKeyId) {
setAdminPasswordSecretKmsKeyId(adminPasswordSecretKmsKeyId);
return this;
}
/**
*
* The username of the administrator for the first database created in the namespace.
*
*
* @param adminUsername
* The username of the administrator for the first database created in the namespace.
*/
public void setAdminUsername(String adminUsername) {
this.adminUsername = adminUsername;
}
/**
*
* The username of the administrator for the first database created in the namespace.
*
*
* @return The username of the administrator for the first database created in the namespace.
*/
public String getAdminUsername() {
return this.adminUsername;
}
/**
*
* The username of the administrator for the first database created in the namespace.
*
*
* @param adminUsername
* The username of the administrator for the first database created in the namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withAdminUsername(String adminUsername) {
setAdminUsername(adminUsername);
return this;
}
/**
*
* The date of when the namespace was created.
*
*
* @param creationDate
* The date of when the namespace was created.
*/
public void setCreationDate(java.util.Date creationDate) {
this.creationDate = creationDate;
}
/**
*
* The date of when the namespace was created.
*
*
* @return The date of when the namespace was created.
*/
public java.util.Date getCreationDate() {
return this.creationDate;
}
/**
*
* The date of when the namespace was created.
*
*
* @param creationDate
* The date of when the namespace was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withCreationDate(java.util.Date creationDate) {
setCreationDate(creationDate);
return this;
}
/**
*
* The name of the first database created in the namespace.
*
*
* @param dbName
* The name of the first database created in the namespace.
*/
public void setDbName(String dbName) {
this.dbName = dbName;
}
/**
*
* The name of the first database created in the namespace.
*
*
* @return The name of the first database created in the namespace.
*/
public String getDbName() {
return this.dbName;
}
/**
*
* The name of the first database created in the namespace.
*
*
* @param dbName
* The name of the first database created in the namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withDbName(String dbName) {
setDbName(dbName);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
*
*
* @param defaultIamRoleArn
* The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
*/
public void setDefaultIamRoleArn(String defaultIamRoleArn) {
this.defaultIamRoleArn = defaultIamRoleArn;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
*
*
* @return The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
*/
public String getDefaultIamRoleArn() {
return this.defaultIamRoleArn;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
*
*
* @param defaultIamRoleArn
* The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withDefaultIamRoleArn(String defaultIamRoleArn) {
setDefaultIamRoleArn(defaultIamRoleArn);
return this;
}
/**
*
* A list of IAM roles to associate with the namespace.
*
*
* @return A list of IAM roles to associate with the namespace.
*/
public java.util.List getIamRoles() {
return iamRoles;
}
/**
*
* A list of IAM roles to associate with the namespace.
*
*
* @param iamRoles
* A list of IAM roles to associate with the namespace.
*/
public void setIamRoles(java.util.Collection iamRoles) {
if (iamRoles == null) {
this.iamRoles = null;
return;
}
this.iamRoles = new java.util.ArrayList(iamRoles);
}
/**
*
* A list of IAM roles to associate with the namespace.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setIamRoles(java.util.Collection)} or {@link #withIamRoles(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param iamRoles
* A list of IAM roles to associate with the namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withIamRoles(String... iamRoles) {
if (this.iamRoles == null) {
setIamRoles(new java.util.ArrayList(iamRoles.length));
}
for (String ele : iamRoles) {
this.iamRoles.add(ele);
}
return this;
}
/**
*
* A list of IAM roles to associate with the namespace.
*
*
* @param iamRoles
* A list of IAM roles to associate with the namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withIamRoles(java.util.Collection iamRoles) {
setIamRoles(iamRoles);
return this;
}
/**
*
* The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
*
*
* @param kmsKeyId
* The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
*/
public void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
/**
*
* The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
*
*
* @return The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
*/
public String getKmsKeyId() {
return this.kmsKeyId;
}
/**
*
* The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
*
*
* @param kmsKeyId
* The ID of the Amazon Web Services Key Management Service key used to encrypt your data.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withKmsKeyId(String kmsKeyId) {
setKmsKeyId(kmsKeyId);
return this;
}
/**
*
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
*
*
* @return The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
* @see LogExport
*/
public java.util.List getLogExports() {
return logExports;
}
/**
*
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
*
*
* @param logExports
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
* @see LogExport
*/
public void setLogExports(java.util.Collection logExports) {
if (logExports == null) {
this.logExports = null;
return;
}
this.logExports = new java.util.ArrayList(logExports);
}
/**
*
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLogExports(java.util.Collection)} or {@link #withLogExports(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param logExports
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LogExport
*/
public Namespace withLogExports(String... logExports) {
if (this.logExports == null) {
setLogExports(new java.util.ArrayList(logExports.length));
}
for (String ele : logExports) {
this.logExports.add(ele);
}
return this;
}
/**
*
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
*
*
* @param logExports
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LogExport
*/
public Namespace withLogExports(java.util.Collection logExports) {
setLogExports(logExports);
return this;
}
/**
*
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
*
*
* @param logExports
* The types of logs the namespace can export. Available export types are User log, Connection log, and User
* activity log.
* @return Returns a reference to this object so that method calls can be chained together.
* @see LogExport
*/
public Namespace withLogExports(LogExport... logExports) {
java.util.ArrayList logExportsCopy = new java.util.ArrayList(logExports.length);
for (LogExport value : logExports) {
logExportsCopy.add(value.toString());
}
if (getLogExports() == null) {
setLogExports(logExportsCopy);
} else {
getLogExports().addAll(logExportsCopy);
}
return this;
}
/**
*
* The Amazon Resource Name (ARN) associated with a namespace.
*
*
* @param namespaceArn
* The Amazon Resource Name (ARN) associated with a namespace.
*/
public void setNamespaceArn(String namespaceArn) {
this.namespaceArn = namespaceArn;
}
/**
*
* The Amazon Resource Name (ARN) associated with a namespace.
*
*
* @return The Amazon Resource Name (ARN) associated with a namespace.
*/
public String getNamespaceArn() {
return this.namespaceArn;
}
/**
*
* The Amazon Resource Name (ARN) associated with a namespace.
*
*
* @param namespaceArn
* The Amazon Resource Name (ARN) associated with a namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withNamespaceArn(String namespaceArn) {
setNamespaceArn(namespaceArn);
return this;
}
/**
*
* The unique identifier of a namespace.
*
*
* @param namespaceId
* The unique identifier of a namespace.
*/
public void setNamespaceId(String namespaceId) {
this.namespaceId = namespaceId;
}
/**
*
* The unique identifier of a namespace.
*
*
* @return The unique identifier of a namespace.
*/
public String getNamespaceId() {
return this.namespaceId;
}
/**
*
* The unique identifier of a namespace.
*
*
* @param namespaceId
* The unique identifier of a namespace.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withNamespaceId(String namespaceId) {
setNamespaceId(namespaceId);
return this;
}
/**
*
* The name of the namespace. Must be between 3-64 alphanumeric characters in lowercase, and it cannot be a reserved
* word. A list of reserved words can be found in Reserved Words in the Amazon
* Redshift Database Developer Guide.
*
*
* @param namespaceName
* The name of the namespace. Must be between 3-64 alphanumeric characters in lowercase, and it cannot be a
* reserved word. A list of reserved words can be found in Reserved Words in the Amazon
* Redshift Database Developer Guide.
*/
public void setNamespaceName(String namespaceName) {
this.namespaceName = namespaceName;
}
/**
*
* The name of the namespace. Must be between 3-64 alphanumeric characters in lowercase, and it cannot be a reserved
* word. A list of reserved words can be found in Reserved Words in the Amazon
* Redshift Database Developer Guide.
*
*
* @return The name of the namespace. Must be between 3-64 alphanumeric characters in lowercase, and it cannot be a
* reserved word. A list of reserved words can be found in Reserved Words in the Amazon
* Redshift Database Developer Guide.
*/
public String getNamespaceName() {
return this.namespaceName;
}
/**
*
* The name of the namespace. Must be between 3-64 alphanumeric characters in lowercase, and it cannot be a reserved
* word. A list of reserved words can be found in Reserved Words in the Amazon
* Redshift Database Developer Guide.
*
*
* @param namespaceName
* The name of the namespace. Must be between 3-64 alphanumeric characters in lowercase, and it cannot be a
* reserved word. A list of reserved words can be found in Reserved Words in the Amazon
* Redshift Database Developer Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Namespace withNamespaceName(String namespaceName) {
setNamespaceName(namespaceName);
return this;
}
/**
*
* The status of the namespace.
*
*
* @param status
* The status of the namespace.
* @see NamespaceStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the namespace.
*
*
* @return The status of the namespace.
* @see NamespaceStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the namespace.
*
*
* @param status
* The status of the namespace.
* @return Returns a reference to this object so that method calls can be chained together.
* @see NamespaceStatus
*/
public Namespace withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the namespace.
*
*
* @param status
* The status of the namespace.
* @return Returns a reference to this object so that method calls can be chained together.
* @see NamespaceStatus
*/
public Namespace withStatus(NamespaceStatus status) {
this.status = status.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 (getAdminPasswordSecretArn() != null)
sb.append("AdminPasswordSecretArn: ").append(getAdminPasswordSecretArn()).append(",");
if (getAdminPasswordSecretKmsKeyId() != null)
sb.append("AdminPasswordSecretKmsKeyId: ").append(getAdminPasswordSecretKmsKeyId()).append(",");
if (getAdminUsername() != null)
sb.append("AdminUsername: ").append("***Sensitive Data Redacted***").append(",");
if (getCreationDate() != null)
sb.append("CreationDate: ").append(getCreationDate()).append(",");
if (getDbName() != null)
sb.append("DbName: ").append(getDbName()).append(",");
if (getDefaultIamRoleArn() != null)
sb.append("DefaultIamRoleArn: ").append(getDefaultIamRoleArn()).append(",");
if (getIamRoles() != null)
sb.append("IamRoles: ").append(getIamRoles()).append(",");
if (getKmsKeyId() != null)
sb.append("KmsKeyId: ").append(getKmsKeyId()).append(",");
if (getLogExports() != null)
sb.append("LogExports: ").append(getLogExports()).append(",");
if (getNamespaceArn() != null)
sb.append("NamespaceArn: ").append(getNamespaceArn()).append(",");
if (getNamespaceId() != null)
sb.append("NamespaceId: ").append(getNamespaceId()).append(",");
if (getNamespaceName() != null)
sb.append("NamespaceName: ").append(getNamespaceName()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Namespace == false)
return false;
Namespace other = (Namespace) obj;
if (other.getAdminPasswordSecretArn() == null ^ this.getAdminPasswordSecretArn() == null)
return false;
if (other.getAdminPasswordSecretArn() != null && other.getAdminPasswordSecretArn().equals(this.getAdminPasswordSecretArn()) == false)
return false;
if (other.getAdminPasswordSecretKmsKeyId() == null ^ this.getAdminPasswordSecretKmsKeyId() == null)
return false;
if (other.getAdminPasswordSecretKmsKeyId() != null && other.getAdminPasswordSecretKmsKeyId().equals(this.getAdminPasswordSecretKmsKeyId()) == false)
return false;
if (other.getAdminUsername() == null ^ this.getAdminUsername() == null)
return false;
if (other.getAdminUsername() != null && other.getAdminUsername().equals(this.getAdminUsername()) == false)
return false;
if (other.getCreationDate() == null ^ this.getCreationDate() == null)
return false;
if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false)
return false;
if (other.getDbName() == null ^ this.getDbName() == null)
return false;
if (other.getDbName() != null && other.getDbName().equals(this.getDbName()) == false)
return false;
if (other.getDefaultIamRoleArn() == null ^ this.getDefaultIamRoleArn() == null)
return false;
if (other.getDefaultIamRoleArn() != null && other.getDefaultIamRoleArn().equals(this.getDefaultIamRoleArn()) == false)
return false;
if (other.getIamRoles() == null ^ this.getIamRoles() == null)
return false;
if (other.getIamRoles() != null && other.getIamRoles().equals(this.getIamRoles()) == false)
return false;
if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null)
return false;
if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false)
return false;
if (other.getLogExports() == null ^ this.getLogExports() == null)
return false;
if (other.getLogExports() != null && other.getLogExports().equals(this.getLogExports()) == false)
return false;
if (other.getNamespaceArn() == null ^ this.getNamespaceArn() == null)
return false;
if (other.getNamespaceArn() != null && other.getNamespaceArn().equals(this.getNamespaceArn()) == false)
return false;
if (other.getNamespaceId() == null ^ this.getNamespaceId() == null)
return false;
if (other.getNamespaceId() != null && other.getNamespaceId().equals(this.getNamespaceId()) == false)
return false;
if (other.getNamespaceName() == null ^ this.getNamespaceName() == null)
return false;
if (other.getNamespaceName() != null && other.getNamespaceName().equals(this.getNamespaceName()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAdminPasswordSecretArn() == null) ? 0 : getAdminPasswordSecretArn().hashCode());
hashCode = prime * hashCode + ((getAdminPasswordSecretKmsKeyId() == null) ? 0 : getAdminPasswordSecretKmsKeyId().hashCode());
hashCode = prime * hashCode + ((getAdminUsername() == null) ? 0 : getAdminUsername().hashCode());
hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode());
hashCode = prime * hashCode + ((getDbName() == null) ? 0 : getDbName().hashCode());
hashCode = prime * hashCode + ((getDefaultIamRoleArn() == null) ? 0 : getDefaultIamRoleArn().hashCode());
hashCode = prime * hashCode + ((getIamRoles() == null) ? 0 : getIamRoles().hashCode());
hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode());
hashCode = prime * hashCode + ((getLogExports() == null) ? 0 : getLogExports().hashCode());
hashCode = prime * hashCode + ((getNamespaceArn() == null) ? 0 : getNamespaceArn().hashCode());
hashCode = prime * hashCode + ((getNamespaceId() == null) ? 0 : getNamespaceId().hashCode());
hashCode = prime * hashCode + ((getNamespaceName() == null) ? 0 : getNamespaceName().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
return hashCode;
}
@Override
public Namespace clone() {
try {
return (Namespace) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.redshiftserverless.model.transform.NamespaceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}