/* * 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.licensemanager.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Describes a token. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class TokenData implements Serializable, Cloneable, StructuredPojo { /** ** Token ID. *
*/ private String tokenId; /** *
* Type of token generated. The supported value is REFRESH_TOKEN
.
*
* Amazon Resource Name (ARN) of the license. *
*/ private String licenseArn; /** ** Token expiration time, in ISO8601-UTC format. *
*/ private String expirationTime; /** ** Data specified by the caller. *
*/ private java.util.List* Amazon Resource Names (ARN) of the roles included in the token. *
*/ private java.util.List
* Token status. The possible values are AVAILABLE
and DELETED
.
*
* Token ID. *
* * @param tokenId * Token ID. */ public void setTokenId(String tokenId) { this.tokenId = tokenId; } /** ** Token ID. *
* * @return Token ID. */ public String getTokenId() { return this.tokenId; } /** ** Token ID. *
* * @param tokenId * Token ID. * @return Returns a reference to this object so that method calls can be chained together. */ public TokenData withTokenId(String tokenId) { setTokenId(tokenId); return this; } /** *
* Type of token generated. The supported value is REFRESH_TOKEN
.
*
REFRESH_TOKEN
.
*/
public void setTokenType(String tokenType) {
this.tokenType = tokenType;
}
/**
*
* Type of token generated. The supported value is REFRESH_TOKEN
.
*
REFRESH_TOKEN
.
*/
public String getTokenType() {
return this.tokenType;
}
/**
*
* Type of token generated. The supported value is REFRESH_TOKEN
.
*
REFRESH_TOKEN
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TokenData withTokenType(String tokenType) {
setTokenType(tokenType);
return this;
}
/**
* * Amazon Resource Name (ARN) of the license. *
* * @param licenseArn * Amazon Resource Name (ARN) of the license. */ public void setLicenseArn(String licenseArn) { this.licenseArn = licenseArn; } /** ** Amazon Resource Name (ARN) of the license. *
* * @return Amazon Resource Name (ARN) of the license. */ public String getLicenseArn() { return this.licenseArn; } /** ** Amazon Resource Name (ARN) of the license. *
* * @param licenseArn * Amazon Resource Name (ARN) of the license. * @return Returns a reference to this object so that method calls can be chained together. */ public TokenData withLicenseArn(String licenseArn) { setLicenseArn(licenseArn); return this; } /** ** Token expiration time, in ISO8601-UTC format. *
* * @param expirationTime * Token expiration time, in ISO8601-UTC format. */ public void setExpirationTime(String expirationTime) { this.expirationTime = expirationTime; } /** ** Token expiration time, in ISO8601-UTC format. *
* * @return Token expiration time, in ISO8601-UTC format. */ public String getExpirationTime() { return this.expirationTime; } /** ** Token expiration time, in ISO8601-UTC format. *
* * @param expirationTime * Token expiration time, in ISO8601-UTC format. * @return Returns a reference to this object so that method calls can be chained together. */ public TokenData withExpirationTime(String expirationTime) { setExpirationTime(expirationTime); return this; } /** ** Data specified by the caller. *
* * @return Data specified by the caller. */ public java.util.List* Data specified by the caller. *
* * @param tokenProperties * Data specified by the caller. */ public void setTokenProperties(java.util.Collection* Data specified by the caller. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTokenProperties(java.util.Collection)} or {@link #withTokenProperties(java.util.Collection)} if you * want to override the existing values. *
* * @param tokenProperties * Data specified by the caller. * @return Returns a reference to this object so that method calls can be chained together. */ public TokenData withTokenProperties(String... tokenProperties) { if (this.tokenProperties == null) { setTokenProperties(new java.util.ArrayList* Data specified by the caller. *
* * @param tokenProperties * Data specified by the caller. * @return Returns a reference to this object so that method calls can be chained together. */ public TokenData withTokenProperties(java.util.Collection* Amazon Resource Names (ARN) of the roles included in the token. *
* * @return Amazon Resource Names (ARN) of the roles included in the token. */ public java.util.List* Amazon Resource Names (ARN) of the roles included in the token. *
* * @param roleArns * Amazon Resource Names (ARN) of the roles included in the token. */ public void setRoleArns(java.util.Collection* Amazon Resource Names (ARN) of the roles included in the token. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setRoleArns(java.util.Collection)} or {@link #withRoleArns(java.util.Collection)} if you want to override * the existing values. *
* * @param roleArns * Amazon Resource Names (ARN) of the roles included in the token. * @return Returns a reference to this object so that method calls can be chained together. */ public TokenData withRoleArns(String... roleArns) { if (this.roleArns == null) { setRoleArns(new java.util.ArrayList* Amazon Resource Names (ARN) of the roles included in the token. *
* * @param roleArns * Amazon Resource Names (ARN) of the roles included in the token. * @return Returns a reference to this object so that method calls can be chained together. */ public TokenData withRoleArns(java.util.Collection
* Token status. The possible values are AVAILABLE
and DELETED
.
*
AVAILABLE
and DELETED
.
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* Token status. The possible values are AVAILABLE
and DELETED
.
*
AVAILABLE
and DELETED
.
*/
public String getStatus() {
return this.status;
}
/**
*
* Token status. The possible values are AVAILABLE
and DELETED
.
*
AVAILABLE
and DELETED
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public TokenData withStatus(String status) {
setStatus(status);
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 (getTokenId() != null)
sb.append("TokenId: ").append(getTokenId()).append(",");
if (getTokenType() != null)
sb.append("TokenType: ").append(getTokenType()).append(",");
if (getLicenseArn() != null)
sb.append("LicenseArn: ").append(getLicenseArn()).append(",");
if (getExpirationTime() != null)
sb.append("ExpirationTime: ").append(getExpirationTime()).append(",");
if (getTokenProperties() != null)
sb.append("TokenProperties: ").append(getTokenProperties()).append(",");
if (getRoleArns() != null)
sb.append("RoleArns: ").append(getRoleArns()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof TokenData == false)
return false;
TokenData other = (TokenData) obj;
if (other.getTokenId() == null ^ this.getTokenId() == null)
return false;
if (other.getTokenId() != null && other.getTokenId().equals(this.getTokenId()) == false)
return false;
if (other.getTokenType() == null ^ this.getTokenType() == null)
return false;
if (other.getTokenType() != null && other.getTokenType().equals(this.getTokenType()) == false)
return false;
if (other.getLicenseArn() == null ^ this.getLicenseArn() == null)
return false;
if (other.getLicenseArn() != null && other.getLicenseArn().equals(this.getLicenseArn()) == false)
return false;
if (other.getExpirationTime() == null ^ this.getExpirationTime() == null)
return false;
if (other.getExpirationTime() != null && other.getExpirationTime().equals(this.getExpirationTime()) == false)
return false;
if (other.getTokenProperties() == null ^ this.getTokenProperties() == null)
return false;
if (other.getTokenProperties() != null && other.getTokenProperties().equals(this.getTokenProperties()) == false)
return false;
if (other.getRoleArns() == null ^ this.getRoleArns() == null)
return false;
if (other.getRoleArns() != null && other.getRoleArns().equals(this.getRoleArns()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTokenId() == null) ? 0 : getTokenId().hashCode());
hashCode = prime * hashCode + ((getTokenType() == null) ? 0 : getTokenType().hashCode());
hashCode = prime * hashCode + ((getLicenseArn() == null) ? 0 : getLicenseArn().hashCode());
hashCode = prime * hashCode + ((getExpirationTime() == null) ? 0 : getExpirationTime().hashCode());
hashCode = prime * hashCode + ((getTokenProperties() == null) ? 0 : getTokenProperties().hashCode());
hashCode = prime * hashCode + ((getRoleArns() == null) ? 0 : getRoleArns().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
return hashCode;
}
@Override
public TokenData clone() {
try {
return (TokenData) 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.licensemanager.model.transform.TokenDataMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}