com.amazonaws.services.macie2.model.Member Maven / Gradle / Ivy
Show all versions of aws-java-sdk-macie2 Show documentation
/*
* 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.macie2.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Provides information about an account that's associated with an Amazon Macie administrator account.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Member implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Web Services account ID for the account.
*
*/
private String accountId;
/**
*
* The Amazon Web Services account ID for the administrator account.
*
*/
private String administratorAccountId;
/**
*
* The Amazon Resource Name (ARN) of the account.
*
*/
private String arn;
/**
*
* The email address for the account. This value is null if the account is associated with the administrator account
* through Organizations.
*
*/
private String email;
/**
*
* The date and time, in UTC and extended ISO 8601 format, when an Amazon Macie membership invitation was last sent
* to the account. This value is null if a Macie membership invitation hasn't been sent to the account.
*
*/
private java.util.Date invitedAt;
/**
*
* (Deprecated) The Amazon Web Services account ID for the administrator account. This property has been replaced by
* the administratorAccountId property and is retained only for backward compatibility.
*
*/
private String masterAccountId;
/**
*
* The current status of the relationship between the account and the administrator account.
*
*/
private String relationshipStatus;
/**
*
* A map of key-value pairs that specifies which tags (keys and values) are associated with the account in Amazon
* Macie.
*
*/
private java.util.Map tags;
/**
*
* The date and time, in UTC and extended ISO 8601 format, of the most recent change to the status of the
* relationship between the account and the administrator account.
*
*/
private java.util.Date updatedAt;
/**
*
* The Amazon Web Services account ID for the account.
*
*
* @param accountId
* The Amazon Web Services account ID for the account.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
*
* The Amazon Web Services account ID for the account.
*
*
* @return The Amazon Web Services account ID for the account.
*/
public String getAccountId() {
return this.accountId;
}
/**
*
* The Amazon Web Services account ID for the account.
*
*
* @param accountId
* The Amazon Web Services account ID for the account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Member withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
*
* The Amazon Web Services account ID for the administrator account.
*
*
* @param administratorAccountId
* The Amazon Web Services account ID for the administrator account.
*/
public void setAdministratorAccountId(String administratorAccountId) {
this.administratorAccountId = administratorAccountId;
}
/**
*
* The Amazon Web Services account ID for the administrator account.
*
*
* @return The Amazon Web Services account ID for the administrator account.
*/
public String getAdministratorAccountId() {
return this.administratorAccountId;
}
/**
*
* The Amazon Web Services account ID for the administrator account.
*
*
* @param administratorAccountId
* The Amazon Web Services account ID for the administrator account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Member withAdministratorAccountId(String administratorAccountId) {
setAdministratorAccountId(administratorAccountId);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the account.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the account.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name (ARN) of the account.
*
*
* @return The Amazon Resource Name (ARN) of the account.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name (ARN) of the account.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Member withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The email address for the account. This value is null if the account is associated with the administrator account
* through Organizations.
*
*
* @param email
* The email address for the account. This value is null if the account is associated with the administrator
* account through Organizations.
*/
public void setEmail(String email) {
this.email = email;
}
/**
*
* The email address for the account. This value is null if the account is associated with the administrator account
* through Organizations.
*
*
* @return The email address for the account. This value is null if the account is associated with the administrator
* account through Organizations.
*/
public String getEmail() {
return this.email;
}
/**
*
* The email address for the account. This value is null if the account is associated with the administrator account
* through Organizations.
*
*
* @param email
* The email address for the account. This value is null if the account is associated with the administrator
* account through Organizations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Member withEmail(String email) {
setEmail(email);
return this;
}
/**
*
* The date and time, in UTC and extended ISO 8601 format, when an Amazon Macie membership invitation was last sent
* to the account. This value is null if a Macie membership invitation hasn't been sent to the account.
*
*
* @param invitedAt
* The date and time, in UTC and extended ISO 8601 format, when an Amazon Macie membership invitation was
* last sent to the account. This value is null if a Macie membership invitation hasn't been sent to the
* account.
*/
public void setInvitedAt(java.util.Date invitedAt) {
this.invitedAt = invitedAt;
}
/**
*
* The date and time, in UTC and extended ISO 8601 format, when an Amazon Macie membership invitation was last sent
* to the account. This value is null if a Macie membership invitation hasn't been sent to the account.
*
*
* @return The date and time, in UTC and extended ISO 8601 format, when an Amazon Macie membership invitation was
* last sent to the account. This value is null if a Macie membership invitation hasn't been sent to the
* account.
*/
public java.util.Date getInvitedAt() {
return this.invitedAt;
}
/**
*
* The date and time, in UTC and extended ISO 8601 format, when an Amazon Macie membership invitation was last sent
* to the account. This value is null if a Macie membership invitation hasn't been sent to the account.
*
*
* @param invitedAt
* The date and time, in UTC and extended ISO 8601 format, when an Amazon Macie membership invitation was
* last sent to the account. This value is null if a Macie membership invitation hasn't been sent to the
* account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Member withInvitedAt(java.util.Date invitedAt) {
setInvitedAt(invitedAt);
return this;
}
/**
*
* (Deprecated) The Amazon Web Services account ID for the administrator account. This property has been replaced by
* the administratorAccountId property and is retained only for backward compatibility.
*
*
* @param masterAccountId
* (Deprecated) The Amazon Web Services account ID for the administrator account. This property has been
* replaced by the administratorAccountId property and is retained only for backward compatibility.
*/
public void setMasterAccountId(String masterAccountId) {
this.masterAccountId = masterAccountId;
}
/**
*
* (Deprecated) The Amazon Web Services account ID for the administrator account. This property has been replaced by
* the administratorAccountId property and is retained only for backward compatibility.
*
*
* @return (Deprecated) The Amazon Web Services account ID for the administrator account. This property has been
* replaced by the administratorAccountId property and is retained only for backward compatibility.
*/
public String getMasterAccountId() {
return this.masterAccountId;
}
/**
*
* (Deprecated) The Amazon Web Services account ID for the administrator account. This property has been replaced by
* the administratorAccountId property and is retained only for backward compatibility.
*
*
* @param masterAccountId
* (Deprecated) The Amazon Web Services account ID for the administrator account. This property has been
* replaced by the administratorAccountId property and is retained only for backward compatibility.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Member withMasterAccountId(String masterAccountId) {
setMasterAccountId(masterAccountId);
return this;
}
/**
*
* The current status of the relationship between the account and the administrator account.
*
*
* @param relationshipStatus
* The current status of the relationship between the account and the administrator account.
* @see RelationshipStatus
*/
public void setRelationshipStatus(String relationshipStatus) {
this.relationshipStatus = relationshipStatus;
}
/**
*
* The current status of the relationship between the account and the administrator account.
*
*
* @return The current status of the relationship between the account and the administrator account.
* @see RelationshipStatus
*/
public String getRelationshipStatus() {
return this.relationshipStatus;
}
/**
*
* The current status of the relationship between the account and the administrator account.
*
*
* @param relationshipStatus
* The current status of the relationship between the account and the administrator account.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RelationshipStatus
*/
public Member withRelationshipStatus(String relationshipStatus) {
setRelationshipStatus(relationshipStatus);
return this;
}
/**
*
* The current status of the relationship between the account and the administrator account.
*
*
* @param relationshipStatus
* The current status of the relationship between the account and the administrator account.
* @return Returns a reference to this object so that method calls can be chained together.
* @see RelationshipStatus
*/
public Member withRelationshipStatus(RelationshipStatus relationshipStatus) {
this.relationshipStatus = relationshipStatus.toString();
return this;
}
/**
*
* A map of key-value pairs that specifies which tags (keys and values) are associated with the account in Amazon
* Macie.
*
*
* @return A map of key-value pairs that specifies which tags (keys and values) are associated with the account in
* Amazon Macie.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* A map of key-value pairs that specifies which tags (keys and values) are associated with the account in Amazon
* Macie.
*
*
* @param tags
* A map of key-value pairs that specifies which tags (keys and values) are associated with the account in
* Amazon Macie.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* A map of key-value pairs that specifies which tags (keys and values) are associated with the account in Amazon
* Macie.
*
*
* @param tags
* A map of key-value pairs that specifies which tags (keys and values) are associated with the account in
* Amazon Macie.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Member withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see Member#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public Member addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Member clearTagsEntries() {
this.tags = null;
return this;
}
/**
*
* The date and time, in UTC and extended ISO 8601 format, of the most recent change to the status of the
* relationship between the account and the administrator account.
*
*
* @param updatedAt
* The date and time, in UTC and extended ISO 8601 format, of the most recent change to the status of the
* relationship between the account and the administrator account.
*/
public void setUpdatedAt(java.util.Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
*
* The date and time, in UTC and extended ISO 8601 format, of the most recent change to the status of the
* relationship between the account and the administrator account.
*
*
* @return The date and time, in UTC and extended ISO 8601 format, of the most recent change to the status of the
* relationship between the account and the administrator account.
*/
public java.util.Date getUpdatedAt() {
return this.updatedAt;
}
/**
*
* The date and time, in UTC and extended ISO 8601 format, of the most recent change to the status of the
* relationship between the account and the administrator account.
*
*
* @param updatedAt
* The date and time, in UTC and extended ISO 8601 format, of the most recent change to the status of the
* relationship between the account and the administrator account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Member withUpdatedAt(java.util.Date updatedAt) {
setUpdatedAt(updatedAt);
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 (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId()).append(",");
if (getAdministratorAccountId() != null)
sb.append("AdministratorAccountId: ").append(getAdministratorAccountId()).append(",");
if (getArn() != null)
sb.append("Arn: ").append(getArn()).append(",");
if (getEmail() != null)
sb.append("Email: ").append(getEmail()).append(",");
if (getInvitedAt() != null)
sb.append("InvitedAt: ").append(getInvitedAt()).append(",");
if (getMasterAccountId() != null)
sb.append("MasterAccountId: ").append(getMasterAccountId()).append(",");
if (getRelationshipStatus() != null)
sb.append("RelationshipStatus: ").append(getRelationshipStatus()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getUpdatedAt() != null)
sb.append("UpdatedAt: ").append(getUpdatedAt());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Member == false)
return false;
Member other = (Member) obj;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
if (other.getAdministratorAccountId() == null ^ this.getAdministratorAccountId() == null)
return false;
if (other.getAdministratorAccountId() != null && other.getAdministratorAccountId().equals(this.getAdministratorAccountId()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getEmail() == null ^ this.getEmail() == null)
return false;
if (other.getEmail() != null && other.getEmail().equals(this.getEmail()) == false)
return false;
if (other.getInvitedAt() == null ^ this.getInvitedAt() == null)
return false;
if (other.getInvitedAt() != null && other.getInvitedAt().equals(this.getInvitedAt()) == false)
return false;
if (other.getMasterAccountId() == null ^ this.getMasterAccountId() == null)
return false;
if (other.getMasterAccountId() != null && other.getMasterAccountId().equals(this.getMasterAccountId()) == false)
return false;
if (other.getRelationshipStatus() == null ^ this.getRelationshipStatus() == null)
return false;
if (other.getRelationshipStatus() != null && other.getRelationshipStatus().equals(this.getRelationshipStatus()) == 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.getUpdatedAt() == null ^ this.getUpdatedAt() == null)
return false;
if (other.getUpdatedAt() != null && other.getUpdatedAt().equals(this.getUpdatedAt()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
hashCode = prime * hashCode + ((getAdministratorAccountId() == null) ? 0 : getAdministratorAccountId().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
hashCode = prime * hashCode + ((getEmail() == null) ? 0 : getEmail().hashCode());
hashCode = prime * hashCode + ((getInvitedAt() == null) ? 0 : getInvitedAt().hashCode());
hashCode = prime * hashCode + ((getMasterAccountId() == null) ? 0 : getMasterAccountId().hashCode());
hashCode = prime * hashCode + ((getRelationshipStatus() == null) ? 0 : getRelationshipStatus().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
return hashCode;
}
@Override
public Member clone() {
try {
return (Member) 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.macie2.model.transform.MemberMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}