com.amazonaws.services.chime.model.BatchChannelMemberships Maven / Gradle / Ivy
Show all versions of aws-java-sdk-chime 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.chime.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The membership information, including member ARNs, the channel ARN, and membership types.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class BatchChannelMemberships implements Serializable, Cloneable, StructuredPojo {
/**
*
* The identifier of the member who invited another member.
*
*/
private Identity invitedBy;
/**
*
* The membership types set for the channel users.
*
*/
private String type;
/**
*
* The users successfully added to the request.
*
*/
private java.util.List members;
/**
*
* The ARN of the channel to which you're adding users.
*
*/
private String channelArn;
/**
*
* The identifier of the member who invited another member.
*
*
* @param invitedBy
* The identifier of the member who invited another member.
*/
public void setInvitedBy(Identity invitedBy) {
this.invitedBy = invitedBy;
}
/**
*
* The identifier of the member who invited another member.
*
*
* @return The identifier of the member who invited another member.
*/
public Identity getInvitedBy() {
return this.invitedBy;
}
/**
*
* The identifier of the member who invited another member.
*
*
* @param invitedBy
* The identifier of the member who invited another member.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchChannelMemberships withInvitedBy(Identity invitedBy) {
setInvitedBy(invitedBy);
return this;
}
/**
*
* The membership types set for the channel users.
*
*
* @param type
* The membership types set for the channel users.
* @see ChannelMembershipType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The membership types set for the channel users.
*
*
* @return The membership types set for the channel users.
* @see ChannelMembershipType
*/
public String getType() {
return this.type;
}
/**
*
* The membership types set for the channel users.
*
*
* @param type
* The membership types set for the channel users.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelMembershipType
*/
public BatchChannelMemberships withType(String type) {
setType(type);
return this;
}
/**
*
* The membership types set for the channel users.
*
*
* @param type
* The membership types set for the channel users.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelMembershipType
*/
public BatchChannelMemberships withType(ChannelMembershipType type) {
this.type = type.toString();
return this;
}
/**
*
* The users successfully added to the request.
*
*
* @return The users successfully added to the request.
*/
public java.util.List getMembers() {
return members;
}
/**
*
* The users successfully added to the request.
*
*
* @param members
* The users successfully added to the request.
*/
public void setMembers(java.util.Collection members) {
if (members == null) {
this.members = null;
return;
}
this.members = new java.util.ArrayList(members);
}
/**
*
* The users successfully added to the request.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setMembers(java.util.Collection)} or {@link #withMembers(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param members
* The users successfully added to the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchChannelMemberships withMembers(Identity... members) {
if (this.members == null) {
setMembers(new java.util.ArrayList(members.length));
}
for (Identity ele : members) {
this.members.add(ele);
}
return this;
}
/**
*
* The users successfully added to the request.
*
*
* @param members
* The users successfully added to the request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchChannelMemberships withMembers(java.util.Collection members) {
setMembers(members);
return this;
}
/**
*
* The ARN of the channel to which you're adding users.
*
*
* @param channelArn
* The ARN of the channel to which you're adding users.
*/
public void setChannelArn(String channelArn) {
this.channelArn = channelArn;
}
/**
*
* The ARN of the channel to which you're adding users.
*
*
* @return The ARN of the channel to which you're adding users.
*/
public String getChannelArn() {
return this.channelArn;
}
/**
*
* The ARN of the channel to which you're adding users.
*
*
* @param channelArn
* The ARN of the channel to which you're adding users.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchChannelMemberships withChannelArn(String channelArn) {
setChannelArn(channelArn);
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 (getInvitedBy() != null)
sb.append("InvitedBy: ").append(getInvitedBy()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getMembers() != null)
sb.append("Members: ").append(getMembers()).append(",");
if (getChannelArn() != null)
sb.append("ChannelArn: ").append(getChannelArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof BatchChannelMemberships == false)
return false;
BatchChannelMemberships other = (BatchChannelMemberships) obj;
if (other.getInvitedBy() == null ^ this.getInvitedBy() == null)
return false;
if (other.getInvitedBy() != null && other.getInvitedBy().equals(this.getInvitedBy()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getMembers() == null ^ this.getMembers() == null)
return false;
if (other.getMembers() != null && other.getMembers().equals(this.getMembers()) == false)
return false;
if (other.getChannelArn() == null ^ this.getChannelArn() == null)
return false;
if (other.getChannelArn() != null && other.getChannelArn().equals(this.getChannelArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInvitedBy() == null) ? 0 : getInvitedBy().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getMembers() == null) ? 0 : getMembers().hashCode());
hashCode = prime * hashCode + ((getChannelArn() == null) ? 0 : getChannelArn().hashCode());
return hashCode;
}
@Override
public BatchChannelMemberships clone() {
try {
return (BatchChannelMemberships) 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.chime.model.transform.BatchChannelMembershipsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}