/* * 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.AmazonWebServiceRequest; /** *
* Creates a new ActiveMQ user. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateUserRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** ** The unique ID that Amazon MQ generates for the broker. *
*/ private String brokerId; /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. *
*/ 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. *
*/ 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 ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
*/ private String username; /** ** Defines if this user is intended for CRDR replication purposes. *
*/ private Boolean replicationUser; /** ** The unique ID that Amazon MQ generates for the broker. *
* * @param brokerId * The unique ID that Amazon MQ generates for the broker. */ public void setBrokerId(String brokerId) { this.brokerId = brokerId; } /** ** The unique ID that Amazon MQ generates for the broker. *
* * @return The unique ID that Amazon MQ generates for the broker. */ public String getBrokerId() { return this.brokerId; } /** ** The unique ID that Amazon MQ generates for the broker. *
* * @param brokerId * The unique ID that Amazon MQ generates for the broker. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateUserRequest withBrokerId(String brokerId) { setBrokerId(brokerId); return this; } /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. *
* * @param consoleAccess * Enables access to the ActiveMQ Web Console for the ActiveMQ user. */ public void setConsoleAccess(Boolean consoleAccess) { this.consoleAccess = consoleAccess; } /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. *
* * @return Enables access to the ActiveMQ Web Console for the ActiveMQ user. */ public Boolean getConsoleAccess() { return this.consoleAccess; } /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. *
* * @param consoleAccess * Enables access to the ActiveMQ Web Console for the ActiveMQ user. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateUserRequest withConsoleAccess(Boolean consoleAccess) { setConsoleAccess(consoleAccess); return this; } /** ** Enables access to the ActiveMQ Web Console for the ActiveMQ user. *
* * @return Enables access to the ActiveMQ Web Console for the ActiveMQ user. */ 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. *
* * @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. */ 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. *
* * @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. */ 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. *
** 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. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateUserRequest 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. *
* * @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. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateUserRequest 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 CreateUserRequest withPassword(String password) { setPassword(password); return this; } /** ** The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
* * @param username * The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. */ public void setUsername(String username) { this.username = username; } /** ** The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
* * @return The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. */ public String getUsername() { return this.username; } /** ** The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. *
* * @param username * The username of the ActiveMQ user. This value can contain only alphanumeric characters, dashes, periods, * underscores, and tildes (- . _ ~). This value must be 2-100 characters long. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateUserRequest 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 CreateUserRequest 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 (getBrokerId() != null) sb.append("BrokerId: ").append(getBrokerId()).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 CreateUserRequest == false) return false; CreateUserRequest other = (CreateUserRequest) obj; if (other.getBrokerId() == null ^ this.getBrokerId() == null) return false; if (other.getBrokerId() != null && other.getBrokerId().equals(this.getBrokerId()) == false) return false; 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 + ((getBrokerId() == null) ? 0 : getBrokerId().hashCode()); 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 CreateUserRequest clone() { return (CreateUserRequest) super.clone(); } }