/* * 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.chimesdkmessaging.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 ARN of the AppInstanceUser
or AppInstanceBot
that makes the API call.
*
* The ID of the channel in the request. *
*/ private String channelId; /** ** The ARNs of the channel members in the request. *
*/ private java.util.List* The ARNs of the channel moderators in the request. *
*/ private java.util.List* The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of * 1-million users, excluding moderators. *
*/ private ElasticChannelConfiguration elasticChannelConfiguration; /** ** Settings that control the interval after which the channel is automatically deleted. *
*/ private ExpirationSettings expirationSettings; /** ** 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 ARN of the AppInstanceUser
or AppInstanceBot
that makes the API call.
*
AppInstanceUser
or AppInstanceBot
that makes the API call.
*/
public void setChimeBearer(String chimeBearer) {
this.chimeBearer = chimeBearer;
}
/**
*
* The ARN of the AppInstanceUser
or AppInstanceBot
that makes the API call.
*
AppInstanceUser
or AppInstanceBot
that makes the API call.
*/
public String getChimeBearer() {
return this.chimeBearer;
}
/**
*
* The ARN of the AppInstanceUser
or AppInstanceBot
that makes the API call.
*
AppInstanceUser
or AppInstanceBot
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;
}
/**
* * The ID of the channel in the request. *
* * @param channelId * The ID of the channel in the request. */ public void setChannelId(String channelId) { this.channelId = channelId; } /** ** The ID of the channel in the request. *
* * @return The ID of the channel in the request. */ public String getChannelId() { return this.channelId; } /** ** The ID of the channel in the request. *
* * @param channelId * The ID of the channel in the request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withChannelId(String channelId) { setChannelId(channelId); return this; } /** ** The ARNs of the channel members in the request. *
* * @return The ARNs of the channel members in the request. */ public java.util.List* The ARNs of the channel members in the request. *
* * @param memberArns * The ARNs of the channel members in the request. */ public void setMemberArns(java.util.Collection* The ARNs of the channel members in the request. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setMemberArns(java.util.Collection)} or {@link #withMemberArns(java.util.Collection)} if you want to * override the existing values. *
* * @param memberArns * The ARNs of the channel members in the request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withMemberArns(String... memberArns) { if (this.memberArns == null) { setMemberArns(new java.util.ArrayList* The ARNs of the channel members in the request. *
* * @param memberArns * The ARNs of the channel members in the request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withMemberArns(java.util.Collection* The ARNs of the channel moderators in the request. *
* * @return The ARNs of the channel moderators in the request. */ public java.util.List* The ARNs of the channel moderators in the request. *
* * @param moderatorArns * The ARNs of the channel moderators in the request. */ public void setModeratorArns(java.util.Collection* The ARNs of the channel moderators in the request. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setModeratorArns(java.util.Collection)} or {@link #withModeratorArns(java.util.Collection)} if you want * to override the existing values. *
* * @param moderatorArns * The ARNs of the channel moderators in the request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withModeratorArns(String... moderatorArns) { if (this.moderatorArns == null) { setModeratorArns(new java.util.ArrayList* The ARNs of the channel moderators in the request. *
* * @param moderatorArns * The ARNs of the channel moderators in the request. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withModeratorArns(java.util.Collection* The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of * 1-million users, excluding moderators. *
* * @param elasticChannelConfiguration * The attributes required to configure and create an elastic channel. An elastic channel can support a * maximum of 1-million users, excluding moderators. */ public void setElasticChannelConfiguration(ElasticChannelConfiguration elasticChannelConfiguration) { this.elasticChannelConfiguration = elasticChannelConfiguration; } /** ** The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of * 1-million users, excluding moderators. *
* * @return The attributes required to configure and create an elastic channel. An elastic channel can support a * maximum of 1-million users, excluding moderators. */ public ElasticChannelConfiguration getElasticChannelConfiguration() { return this.elasticChannelConfiguration; } /** ** The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of * 1-million users, excluding moderators. *
* * @param elasticChannelConfiguration * The attributes required to configure and create an elastic channel. An elastic channel can support a * maximum of 1-million users, excluding moderators. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withElasticChannelConfiguration(ElasticChannelConfiguration elasticChannelConfiguration) { setElasticChannelConfiguration(elasticChannelConfiguration); return this; } /** ** Settings that control the interval after which the channel is automatically deleted. *
* * @param expirationSettings * Settings that control the interval after which the channel is automatically deleted. */ public void setExpirationSettings(ExpirationSettings expirationSettings) { this.expirationSettings = expirationSettings; } /** ** Settings that control the interval after which the channel is automatically deleted. *
* * @return Settings that control the interval after which the channel is automatically deleted. */ public ExpirationSettings getExpirationSettings() { return this.expirationSettings; } /** ** Settings that control the interval after which the channel is automatically deleted. *
* * @param expirationSettings * Settings that control the interval after which the channel is automatically deleted. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateChannelRequest withExpirationSettings(ExpirationSettings expirationSettings) { setExpirationSettings(expirationSettings); 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()).append(","); if (getChannelId() != null) sb.append("ChannelId: ").append("***Sensitive Data Redacted***").append(","); if (getMemberArns() != null) sb.append("MemberArns: ").append(getMemberArns()).append(","); if (getModeratorArns() != null) sb.append("ModeratorArns: ").append(getModeratorArns()).append(","); if (getElasticChannelConfiguration() != null) sb.append("ElasticChannelConfiguration: ").append(getElasticChannelConfiguration()).append(","); if (getExpirationSettings() != null) sb.append("ExpirationSettings: ").append(getExpirationSettings()); 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; if (other.getChannelId() == null ^ this.getChannelId() == null) return false; if (other.getChannelId() != null && other.getChannelId().equals(this.getChannelId()) == false) return false; if (other.getMemberArns() == null ^ this.getMemberArns() == null) return false; if (other.getMemberArns() != null && other.getMemberArns().equals(this.getMemberArns()) == false) return false; if (other.getModeratorArns() == null ^ this.getModeratorArns() == null) return false; if (other.getModeratorArns() != null && other.getModeratorArns().equals(this.getModeratorArns()) == false) return false; if (other.getElasticChannelConfiguration() == null ^ this.getElasticChannelConfiguration() == null) return false; if (other.getElasticChannelConfiguration() != null && other.getElasticChannelConfiguration().equals(this.getElasticChannelConfiguration()) == false) return false; if (other.getExpirationSettings() == null ^ this.getExpirationSettings() == null) return false; if (other.getExpirationSettings() != null && other.getExpirationSettings().equals(this.getExpirationSettings()) == 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()); hashCode = prime * hashCode + ((getChannelId() == null) ? 0 : getChannelId().hashCode()); hashCode = prime * hashCode + ((getMemberArns() == null) ? 0 : getMemberArns().hashCode()); hashCode = prime * hashCode + ((getModeratorArns() == null) ? 0 : getModeratorArns().hashCode()); hashCode = prime * hashCode + ((getElasticChannelConfiguration() == null) ? 0 : getElasticChannelConfiguration().hashCode()); hashCode = prime * hashCode + ((getExpirationSettings() == null) ? 0 : getExpirationSettings().hashCode()); return hashCode; } @Override public CreateChannelRequest clone() { return (CreateChannelRequest) super.clone(); } }