/* * 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.chime.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class CreateChannelRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The ARN of the channel request. *
*/ private String appInstanceArn; /** ** The name of the channel. *
*/ private String name; /** *
     * The channel mode: UNRESTRICTED or RESTRICTED. Administrators, moderators, and channel
     * members can add themselves and other members to unrestricted channels. Only administrators and moderators can add
     * members to restricted channels.
     * 
     * The channel's privacy level: PUBLIC or PRIVATE. Private channels aren't discoverable by
     * users outside the channel. Public channels are discoverable by anyone in the AppInstance.
     * 
* The metadata of the creation request. Limited to 1KB and UTF-8. *
*/ private String metadata; /** *
     * The client token for the request. An Idempotency token.
     * 
* The tags for the creation request. *
*/ private java.util.List
     * The AppInstanceUserArn of the user that makes the API call.
     * 
* The ARN of the channel request. *
* * @param appInstanceArn * The ARN of the channel request. */ public void setAppInstanceArn(String appInstanceArn) { this.appInstanceArn = appInstanceArn; } /** ** The ARN of the channel request. *
* * @return The ARN of the channel request. */ public String getAppInstanceArn() { return this.appInstanceArn; } /** ** The ARN of the channel request. *
* * @param appInstanceArn * The ARN of the channel request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withAppInstanceArn(String appInstanceArn) { setAppInstanceArn(appInstanceArn); return this; } /** ** The name of the channel. *
* * @param name * The name of the channel. */ public void setName(String name) { this.name = name; } /** ** The name of the channel. *
* * @return The name of the channel. */ public String getName() { return this.name; } /** ** The name of the channel. *
* * @param name * The name of the channel. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withName(String name) { setName(name); return this; } /** *
     * The channel mode: UNRESTRICTED or RESTRICTED. Administrators, moderators, and channel
     * members can add themselves and other members to unrestricted channels. Only administrators and moderators can add
     * members to restricted channels.
     * 
UNRESTRICTED or RESTRICTED. Administrators, moderators, and
     *        channel members can add themselves and other members to unrestricted channels. Only administrators and
     *        moderators can add members to restricted channels.
     * @see ChannelMode
     */
    public void setMode(String mode) {
        this.mode = mode;
    }
    /**
     * 
     * The channel mode: UNRESTRICTED or RESTRICTED. Administrators, moderators, and channel
     * members can add themselves and other members to unrestricted channels. Only administrators and moderators can add
     * members to restricted channels.
     * 
UNRESTRICTED or RESTRICTED. Administrators, moderators, and
     *         channel members can add themselves and other members to unrestricted channels. Only administrators and
     *         moderators can add members to restricted channels.
     * @see ChannelMode
     */
    public String getMode() {
        return this.mode;
    }
    /**
     * 
     * The channel mode: UNRESTRICTED or RESTRICTED. Administrators, moderators, and channel
     * members can add themselves and other members to unrestricted channels. Only administrators and moderators can add
     * members to restricted channels.
     * 
UNRESTRICTED or RESTRICTED. Administrators, moderators, and
     *        channel members can add themselves and other members to unrestricted channels. Only administrators and
     *        moderators can add members to restricted channels.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ChannelMode
     */
    public CreateChannelRequest withMode(String mode) {
        setMode(mode);
        return this;
    }
    /**
     * 
     * The channel mode: UNRESTRICTED or RESTRICTED. Administrators, moderators, and channel
     * members can add themselves and other members to unrestricted channels. Only administrators and moderators can add
     * members to restricted channels.
     * 
UNRESTRICTED or RESTRICTED. Administrators, moderators, and
     *        channel members can add themselves and other members to unrestricted channels. Only administrators and
     *        moderators can add members to restricted channels.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ChannelMode
     */
    public CreateChannelRequest withMode(ChannelMode mode) {
        this.mode = mode.toString();
        return this;
    }
    /**
     * 
     * The channel's privacy level: PUBLIC or PRIVATE. Private channels aren't discoverable by
     * users outside the channel. Public channels are discoverable by anyone in the AppInstance.
     * 
PUBLIC or PRIVATE. Private channels aren't
     *        discoverable by users outside the channel. Public channels are discoverable by anyone in the
     *        AppInstance.
     * @see ChannelPrivacy
     */
    public void setPrivacy(String privacy) {
        this.privacy = privacy;
    }
    /**
     * 
     * The channel's privacy level: PUBLIC or PRIVATE. Private channels aren't discoverable by
     * users outside the channel. Public channels are discoverable by anyone in the AppInstance.
     * 
PUBLIC or PRIVATE. Private channels aren't
     *         discoverable by users outside the channel. Public channels are discoverable by anyone in the
     *         AppInstance.
     * @see ChannelPrivacy
     */
    public String getPrivacy() {
        return this.privacy;
    }
    /**
     * 
     * The channel's privacy level: PUBLIC or PRIVATE. Private channels aren't discoverable by
     * users outside the channel. Public channels are discoverable by anyone in the AppInstance.
     * 
PUBLIC or PRIVATE. Private channels aren't
     *        discoverable by users outside the channel. Public channels are discoverable by anyone in the
     *        AppInstance.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ChannelPrivacy
     */
    public CreateChannelRequest withPrivacy(String privacy) {
        setPrivacy(privacy);
        return this;
    }
    /**
     * 
     * The channel's privacy level: PUBLIC or PRIVATE. Private channels aren't discoverable by
     * users outside the channel. Public channels are discoverable by anyone in the AppInstance.
     * 
PUBLIC or PRIVATE. Private channels aren't
     *        discoverable by users outside the channel. Public channels are discoverable by anyone in the
     *        AppInstance.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see ChannelPrivacy
     */
    public CreateChannelRequest withPrivacy(ChannelPrivacy privacy) {
        this.privacy = privacy.toString();
        return this;
    }
    /**
     * * The metadata of the creation request. Limited to 1KB and UTF-8. *
* * @param metadata * The metadata of the creation request. Limited to 1KB and UTF-8. */ public void setMetadata(String metadata) { this.metadata = metadata; } /** ** The metadata of the creation request. Limited to 1KB and UTF-8. *
* * @return The metadata of the creation request. Limited to 1KB and UTF-8. */ public String getMetadata() { return this.metadata; } /** ** The metadata of the creation request. Limited to 1KB and UTF-8. *
* * @param metadata * The metadata of the creation request. Limited to 1KB and UTF-8. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withMetadata(String metadata) { setMetadata(metadata); return this; } /** *
     * The client token for the request. An Idempotency token.
     * 
Idempotency token.
     */
    public void setClientRequestToken(String clientRequestToken) {
        this.clientRequestToken = clientRequestToken;
    }
    /**
     * 
     * The client token for the request. An Idempotency token.
     * 
Idempotency token.
     */
    public String getClientRequestToken() {
        return this.clientRequestToken;
    }
    /**
     * 
     * The client token for the request. An Idempotency token.
     * 
Idempotency token.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public CreateChannelRequest withClientRequestToken(String clientRequestToken) {
        setClientRequestToken(clientRequestToken);
        return this;
    }
    /**
     * * The tags for the creation request. *
* * @return The tags for the creation request. */ public java.util.List* The tags for the creation request. *
* * @param tags * The tags for the creation request. */ public void setTags(java.util.Collection* The tags for the creation request. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * The tags for the creation request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withTags(Tag... tags) { if (this.tags == null) { setTags(new java.util.ArrayList* The tags for the creation request. *
* * @param tags * The tags for the creation request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withTags(java.util.Collection
     * The AppInstanceUserArn of the user that makes the API call.
     * 
AppInstanceUserArn of the user that makes the API call.
     */
    public void setChimeBearer(String chimeBearer) {
        this.chimeBearer = chimeBearer;
    }
    /**
     * 
     * The AppInstanceUserArn of the user that makes the API call.
     * 
AppInstanceUserArn of the user that makes the API call.
     */
    public String getChimeBearer() {
        return this.chimeBearer;
    }
    /**
     * 
     * The AppInstanceUserArn of the user that makes the API call.
     * 
AppInstanceUserArn of the user that makes the API call.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public CreateChannelRequest withChimeBearer(String chimeBearer) {
        setChimeBearer(chimeBearer);
        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 (getAppInstanceArn() != null)
            sb.append("AppInstanceArn: ").append(getAppInstanceArn()).append(",");
        if (getName() != null)
            sb.append("Name: ").append("***Sensitive Data Redacted***").append(",");
        if (getMode() != null)
            sb.append("Mode: ").append(getMode()).append(",");
        if (getPrivacy() != null)
            sb.append("Privacy: ").append(getPrivacy()).append(",");
        if (getMetadata() != null)
            sb.append("Metadata: ").append("***Sensitive Data Redacted***").append(",");
        if (getClientRequestToken() != null)
            sb.append("ClientRequestToken: ").append("***Sensitive Data Redacted***").append(",");
        if (getTags() != null)
            sb.append("Tags: ").append(getTags()).append(",");
        if (getChimeBearer() != null)
            sb.append("ChimeBearer: ").append(getChimeBearer());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof CreateChannelRequest == false)
            return false;
        CreateChannelRequest other = (CreateChannelRequest) obj;
        if (other.getAppInstanceArn() == null ^ this.getAppInstanceArn() == null)
            return false;
        if (other.getAppInstanceArn() != null && other.getAppInstanceArn().equals(this.getAppInstanceArn()) == false)
            return false;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getMode() == null ^ this.getMode() == null)
            return false;
        if (other.getMode() != null && other.getMode().equals(this.getMode()) == false)
            return false;
        if (other.getPrivacy() == null ^ this.getPrivacy() == null)
            return false;
        if (other.getPrivacy() != null && other.getPrivacy().equals(this.getPrivacy()) == false)
            return false;
        if (other.getMetadata() == null ^ this.getMetadata() == null)
            return false;
        if (other.getMetadata() != null && other.getMetadata().equals(this.getMetadata()) == false)
            return false;
        if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null)
            return false;
        if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false)
            return false;
        if (other.getTags() == null ^ this.getTags() == null)
            return false;
        if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
            return false;
        if (other.getChimeBearer() == null ^ this.getChimeBearer() == null)
            return false;
        if (other.getChimeBearer() != null && other.getChimeBearer().equals(this.getChimeBearer()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode + ((getAppInstanceArn() == null) ? 0 : getAppInstanceArn().hashCode());
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getMode() == null) ? 0 : getMode().hashCode());
        hashCode = prime * hashCode + ((getPrivacy() == null) ? 0 : getPrivacy().hashCode());
        hashCode = prime * hashCode + ((getMetadata() == null) ? 0 : getMetadata().hashCode());
        hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode());
        hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
        hashCode = prime * hashCode + ((getChimeBearer() == null) ? 0 : getChimeBearer().hashCode());
        return hashCode;
    }
    @Override
    public CreateChannelRequest clone() {
        return (CreateChannelRequest) super.clone();
    }
}