/* * 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.mq.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* A user associated with the broker. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is * accepted and created when a broker is first provisioned. All subsequent broker users are created by making RabbitMQ * API calls directly to brokers or via the RabbitMQ web console. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class User implements Serializable, Cloneable, StructuredPojo { /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. *
*/ private Boolean consoleAccess; /** ** The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric * characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Does * not apply to RabbitMQ brokers. *
*/ private java.util.List* Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 * unique characters, and must not contain commas, colons, or equal signs (,:=). *
*/ private String password; /** ** The username of the broker user. The following restrictions apply to broker usernames: *
** For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
** para>For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid * usename. This value must be 2-100 characters long. *
** Do not add personally identifiable information (PII) or other confidential or sensitive information in broker * usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. * Broker usernames are not intended to be used for private or sensitive data. *
** Defines if this user is intended for CRDR replication purposes. *
*/ private Boolean replicationUser; /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. *
* * @param consoleAccess * Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. */ public void setConsoleAccess(Boolean consoleAccess) { this.consoleAccess = consoleAccess; } /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. *
* * @return Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. */ public Boolean getConsoleAccess() { return this.consoleAccess; } /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. *
* * @param consoleAccess * Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. * @return Returns a reference to this object so that method calls can be chained together. */ public User withConsoleAccess(Boolean consoleAccess) { setConsoleAccess(consoleAccess); return this; } /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. *
* * @return Enables access to the ActiveMQ Web Console for the ActiveMQ user. Does not apply to RabbitMQ brokers. */ public Boolean isConsoleAccess() { return this.consoleAccess; } /** ** The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric * characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Does * not apply to RabbitMQ brokers. *
* * @return The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only * alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 * characters long. Does not apply to RabbitMQ brokers. */ public java.util.List* The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric * characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Does * not apply to RabbitMQ brokers. *
* * @param groups * The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only * alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 * characters long. Does not apply to RabbitMQ brokers. */ public void setGroups(java.util.Collection* The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric * characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Does * not apply to RabbitMQ brokers. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setGroups(java.util.Collection)} or {@link #withGroups(java.util.Collection)} if you want to override the * existing values. *
* * @param groups * The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only * alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 * characters long. Does not apply to RabbitMQ brokers. * @return Returns a reference to this object so that method calls can be chained together. */ public User withGroups(String... groups) { if (this.groups == null) { setGroups(new java.util.ArrayList* The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only alphanumeric * characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 characters long. Does * not apply to RabbitMQ brokers. *
* * @param groups * The list of groups (20 maximum) to which the ActiveMQ user belongs. This value can contain only * alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 2-100 * characters long. Does not apply to RabbitMQ brokers. * @return Returns a reference to this object so that method calls can be chained together. */ public User withGroups(java.util.Collection* Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 * unique characters, and must not contain commas, colons, or equal signs (,:=). *
* * @param password * Required. The password of the user. This value must be at least 12 characters long, must contain at least * 4 unique characters, and must not contain commas, colons, or equal signs (,:=). */ public void setPassword(String password) { this.password = password; } /** ** Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 * unique characters, and must not contain commas, colons, or equal signs (,:=). *
* * @return Required. The password of the user. This value must be at least 12 characters long, must contain at least * 4 unique characters, and must not contain commas, colons, or equal signs (,:=). */ public String getPassword() { return this.password; } /** ** Required. The password of the user. This value must be at least 12 characters long, must contain at least 4 * unique characters, and must not contain commas, colons, or equal signs (,:=). *
* * @param password * Required. The password of the user. This value must be at least 12 characters long, must contain at least * 4 unique characters, and must not contain commas, colons, or equal signs (,:=). * @return Returns a reference to this object so that method calls can be chained together. */ public User withPassword(String password) { setPassword(password); return this; } /** ** The username of the broker user. The following restrictions apply to broker usernames: *
** For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
** para>For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid * usename. This value must be 2-100 characters long. *
** Do not add personally identifiable information (PII) or other confidential or sensitive information in broker * usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. * Broker usernames are not intended to be used for private or sensitive data. *
** For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
** para>For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, * periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using * guest as a valid usename. This value must be 2-100 characters long. *
** Do not add personally identifiable information (PII) or other confidential or sensitive information in * broker usernames. Broker usernames are accessible to other Amazon Web Services services, including * CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data. *
*/ public void setUsername(String username) { this.username = username; } /** ** The username of the broker user. The following restrictions apply to broker usernames: *
** For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
** para>For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid * usename. This value must be 2-100 characters long. *
** Do not add personally identifiable information (PII) or other confidential or sensitive information in broker * usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. * Broker usernames are not intended to be used for private or sensitive data. *
** For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
** para>For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, * periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using * guest as a valid usename. This value must be 2-100 characters long. *
** Do not add personally identifiable information (PII) or other confidential or sensitive information in * broker usernames. Broker usernames are accessible to other Amazon Web Services services, including * CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data. *
*/ public String getUsername() { return this.username; } /** ** The username of the broker user. The following restrictions apply to broker usernames: *
** For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
** para>For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using guest as a valid * usename. This value must be 2-100 characters long. *
** Do not add personally identifiable information (PII) or other confidential or sensitive information in broker * usernames. Broker usernames are accessible to other Amazon Web Services services, including CloudWatch Logs. * Broker usernames are not intended to be used for private or sensitive data. *
** For Amazon MQ for ActiveMQ brokers, this value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
** para>For Amazon MQ for RabbitMQ brokers, this value can contain only alphanumeric characters, dashes, * periods, underscores (- . _). This value must not contain a tilde (~) character. Amazon MQ prohibts using * guest as a valid usename. This value must be 2-100 characters long. *
** Do not add personally identifiable information (PII) or other confidential or sensitive information in * broker usernames. Broker usernames are accessible to other Amazon Web Services services, including * CloudWatch Logs. Broker usernames are not intended to be used for private or sensitive data. *
* @return Returns a reference to this object so that method calls can be chained together. */ public User withUsername(String username) { setUsername(username); return this; } /** ** Defines if this user is intended for CRDR replication purposes. *
* * @param replicationUser * Defines if this user is intended for CRDR replication purposes. */ public void setReplicationUser(Boolean replicationUser) { this.replicationUser = replicationUser; } /** ** Defines if this user is intended for CRDR replication purposes. *
* * @return Defines if this user is intended for CRDR replication purposes. */ public Boolean getReplicationUser() { return this.replicationUser; } /** ** Defines if this user is intended for CRDR replication purposes. *
* * @param replicationUser * Defines if this user is intended for CRDR replication purposes. * @return Returns a reference to this object so that method calls can be chained together. */ public User withReplicationUser(Boolean replicationUser) { setReplicationUser(replicationUser); return this; } /** ** Defines if this user is intended for CRDR replication purposes. *
* * @return Defines if this user is intended for CRDR replication purposes. */ public Boolean isReplicationUser() { return this.replicationUser; } /** * 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 (getConsoleAccess() != null) sb.append("ConsoleAccess: ").append(getConsoleAccess()).append(","); if (getGroups() != null) sb.append("Groups: ").append(getGroups()).append(","); if (getPassword() != null) sb.append("Password: ").append(getPassword()).append(","); if (getUsername() != null) sb.append("Username: ").append(getUsername()).append(","); if (getReplicationUser() != null) sb.append("ReplicationUser: ").append(getReplicationUser()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof User == false) return false; User other = (User) obj; if (other.getConsoleAccess() == null ^ this.getConsoleAccess() == null) return false; if (other.getConsoleAccess() != null && other.getConsoleAccess().equals(this.getConsoleAccess()) == false) return false; if (other.getGroups() == null ^ this.getGroups() == null) return false; if (other.getGroups() != null && other.getGroups().equals(this.getGroups()) == false) return false; if (other.getPassword() == null ^ this.getPassword() == null) return false; if (other.getPassword() != null && other.getPassword().equals(this.getPassword()) == 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.getReplicationUser() == null ^ this.getReplicationUser() == null) return false; if (other.getReplicationUser() != null && other.getReplicationUser().equals(this.getReplicationUser()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getConsoleAccess() == null) ? 0 : getConsoleAccess().hashCode()); hashCode = prime * hashCode + ((getGroups() == null) ? 0 : getGroups().hashCode()); hashCode = prime * hashCode + ((getPassword() == null) ? 0 : getPassword().hashCode()); hashCode = prime * hashCode + ((getUsername() == null) ? 0 : getUsername().hashCode()); hashCode = prime * hashCode + ((getReplicationUser() == null) ? 0 : getReplicationUser().hashCode()); return hashCode; } @Override public User clone() { try { return (User) 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.mq.model.transform.UserMarshaller.getInstance().marshall(this, protocolMarshaller); } }