/* * 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.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 members. *
*/ private String type; /** ** The users successfully added to the request. *
*/ private java.util.List* The ARN of the channel to which you're adding members. *
*/ private String channelArn; /** ** The ID of the SubChannel. *
*/ private String subChannelId; /** ** 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 members. *
* * @param type * The membership types set for the channel members. * @see ChannelMembershipType */ public void setType(String type) { this.type = type; } /** ** The membership types set for the channel members. *
* * @return The membership types set for the channel members. * @see ChannelMembershipType */ public String getType() { return this.type; } /** ** The membership types set for the channel members. *
* * @param type * The membership types set for the channel members. * @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 members. *
* * @param type * The membership types set for the channel members. * @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* The users successfully added to the request. *
* * @param members * The users successfully added to the request. */ public void setMembers(java.util.Collection* 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* 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* The ARN of the channel to which you're adding members. *
* * @param channelArn * The ARN of the channel to which you're adding members. */ public void setChannelArn(String channelArn) { this.channelArn = channelArn; } /** ** The ARN of the channel to which you're adding members. *
* * @return The ARN of the channel to which you're adding members. */ public String getChannelArn() { return this.channelArn; } /** ** The ARN of the channel to which you're adding members. *
* * @param channelArn * The ARN of the channel to which you're adding members. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchChannelMemberships withChannelArn(String channelArn) { setChannelArn(channelArn); return this; } /** ** The ID of the SubChannel. *
* * @param subChannelId * The ID of the SubChannel. */ public void setSubChannelId(String subChannelId) { this.subChannelId = subChannelId; } /** ** The ID of the SubChannel. *
* * @return The ID of the SubChannel. */ public String getSubChannelId() { return this.subChannelId; } /** ** The ID of the SubChannel. *
* * @param subChannelId * The ID of the SubChannel. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchChannelMemberships withSubChannelId(String subChannelId) { setSubChannelId(subChannelId); 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()).append(","); if (getSubChannelId() != null) sb.append("SubChannelId: ").append(getSubChannelId()); 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; if (other.getSubChannelId() == null ^ this.getSubChannelId() == null) return false; if (other.getSubChannelId() != null && other.getSubChannelId().equals(this.getSubChannelId()) == 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()); hashCode = prime * hashCode + ((getSubChannelId() == null) ? 0 : getSubChannelId().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.chimesdkmessaging.model.transform.BatchChannelMembershipsMarshaller.getInstance().marshall(this, protocolMarshaller); } }