com.amazonaws.services.workspaces.model.AccountLink Maven / Gradle / Ivy
Show all versions of aws-java-sdk-workspaces 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.workspaces.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about about the account link.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AccountLink implements Serializable, Cloneable, StructuredPojo {
/**
*
* The identifier of the account link.
*
*/
private String accountLinkId;
/**
*
* The status of the account link.
*
*/
private String accountLinkStatus;
/**
*
* The identifier of the source account.
*
*/
private String sourceAccountId;
/**
*
* The identifier of the target account.
*
*/
private String targetAccountId;
/**
*
* The identifier of the account link.
*
*
* @param accountLinkId
* The identifier of the account link.
*/
public void setAccountLinkId(String accountLinkId) {
this.accountLinkId = accountLinkId;
}
/**
*
* The identifier of the account link.
*
*
* @return The identifier of the account link.
*/
public String getAccountLinkId() {
return this.accountLinkId;
}
/**
*
* The identifier of the account link.
*
*
* @param accountLinkId
* The identifier of the account link.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AccountLink withAccountLinkId(String accountLinkId) {
setAccountLinkId(accountLinkId);
return this;
}
/**
*
* The status of the account link.
*
*
* @param accountLinkStatus
* The status of the account link.
* @see AccountLinkStatusEnum
*/
public void setAccountLinkStatus(String accountLinkStatus) {
this.accountLinkStatus = accountLinkStatus;
}
/**
*
* The status of the account link.
*
*
* @return The status of the account link.
* @see AccountLinkStatusEnum
*/
public String getAccountLinkStatus() {
return this.accountLinkStatus;
}
/**
*
* The status of the account link.
*
*
* @param accountLinkStatus
* The status of the account link.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AccountLinkStatusEnum
*/
public AccountLink withAccountLinkStatus(String accountLinkStatus) {
setAccountLinkStatus(accountLinkStatus);
return this;
}
/**
*
* The status of the account link.
*
*
* @param accountLinkStatus
* The status of the account link.
* @return Returns a reference to this object so that method calls can be chained together.
* @see AccountLinkStatusEnum
*/
public AccountLink withAccountLinkStatus(AccountLinkStatusEnum accountLinkStatus) {
this.accountLinkStatus = accountLinkStatus.toString();
return this;
}
/**
*
* The identifier of the source account.
*
*
* @param sourceAccountId
* The identifier of the source account.
*/
public void setSourceAccountId(String sourceAccountId) {
this.sourceAccountId = sourceAccountId;
}
/**
*
* The identifier of the source account.
*
*
* @return The identifier of the source account.
*/
public String getSourceAccountId() {
return this.sourceAccountId;
}
/**
*
* The identifier of the source account.
*
*
* @param sourceAccountId
* The identifier of the source account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AccountLink withSourceAccountId(String sourceAccountId) {
setSourceAccountId(sourceAccountId);
return this;
}
/**
*
* The identifier of the target account.
*
*
* @param targetAccountId
* The identifier of the target account.
*/
public void setTargetAccountId(String targetAccountId) {
this.targetAccountId = targetAccountId;
}
/**
*
* The identifier of the target account.
*
*
* @return The identifier of the target account.
*/
public String getTargetAccountId() {
return this.targetAccountId;
}
/**
*
* The identifier of the target account.
*
*
* @param targetAccountId
* The identifier of the target account.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AccountLink withTargetAccountId(String targetAccountId) {
setTargetAccountId(targetAccountId);
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 (getAccountLinkId() != null)
sb.append("AccountLinkId: ").append(getAccountLinkId()).append(",");
if (getAccountLinkStatus() != null)
sb.append("AccountLinkStatus: ").append(getAccountLinkStatus()).append(",");
if (getSourceAccountId() != null)
sb.append("SourceAccountId: ").append(getSourceAccountId()).append(",");
if (getTargetAccountId() != null)
sb.append("TargetAccountId: ").append(getTargetAccountId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AccountLink == false)
return false;
AccountLink other = (AccountLink) obj;
if (other.getAccountLinkId() == null ^ this.getAccountLinkId() == null)
return false;
if (other.getAccountLinkId() != null && other.getAccountLinkId().equals(this.getAccountLinkId()) == false)
return false;
if (other.getAccountLinkStatus() == null ^ this.getAccountLinkStatus() == null)
return false;
if (other.getAccountLinkStatus() != null && other.getAccountLinkStatus().equals(this.getAccountLinkStatus()) == false)
return false;
if (other.getSourceAccountId() == null ^ this.getSourceAccountId() == null)
return false;
if (other.getSourceAccountId() != null && other.getSourceAccountId().equals(this.getSourceAccountId()) == false)
return false;
if (other.getTargetAccountId() == null ^ this.getTargetAccountId() == null)
return false;
if (other.getTargetAccountId() != null && other.getTargetAccountId().equals(this.getTargetAccountId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccountLinkId() == null) ? 0 : getAccountLinkId().hashCode());
hashCode = prime * hashCode + ((getAccountLinkStatus() == null) ? 0 : getAccountLinkStatus().hashCode());
hashCode = prime * hashCode + ((getSourceAccountId() == null) ? 0 : getSourceAccountId().hashCode());
hashCode = prime * hashCode + ((getTargetAccountId() == null) ? 0 : getTargetAccountId().hashCode());
return hashCode;
}
@Override
public AccountLink clone() {
try {
return (AccountLink) 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.workspaces.model.transform.AccountLinkMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}