com.amazonaws.services.securitytoken.model.GetCallerIdentityResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-core Show documentation
/*
* Copyright 2010-2018 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.securitytoken.model;
import java.io.Serializable;
/**
*
* Contains the response to a successful GetCallerIdentity request,
* including information about the entity making the request.
*
*/
public class GetCallerIdentityResult implements Serializable {
/**
*
* The unique identifier of the calling entity. The exact value depends on
* the type of entity making the call. The values returned are those listed
* in the aws:userid column in the Principal table found on the Policy Variables reference page
* in the IAM User Guide.
*
*/
private String userId;
/**
*
* The AWS account ID number of the account that owns or contains the
* calling entity.
*
*/
private String account;
/**
*
* The AWS ARN associated with the calling entity.
*
*
* Constraints:
* Length: 20 - 2048
* Pattern: [
* -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]+
*/
private String arn;
/**
*
* The unique identifier of the calling entity. The exact value depends on
* the type of entity making the call. The values returned are those listed
* in the aws:userid column in the Principal table found on the Policy Variables reference page
* in the IAM User Guide.
*
*
* @return
* The unique identifier of the calling entity. The exact value
* depends on the type of entity making the call. The values
* returned are those listed in the aws:userid column in the
* Principal table found on the Policy Variables
* reference page in the IAM User Guide.
*
*/
public String getUserId() {
return userId;
}
/**
*
* The unique identifier of the calling entity. The exact value depends on
* the type of entity making the call. The values returned are those listed
* in the aws:userid column in the Principal table found on the Policy Variables reference page
* in the IAM User Guide.
*
*
* @param userId
* The unique identifier of the calling entity. The exact value
* depends on the type of entity making the call. The values
* returned are those listed in the aws:userid column in
* the Principal table found on the Policy Variables
* reference page in the IAM User Guide.
*
*/
public void setUserId(String userId) {
this.userId = userId;
}
/**
*
* The unique identifier of the calling entity. The exact value depends on
* the type of entity making the call. The values returned are those listed
* in the aws:userid column in the Principal table found on the Policy Variables reference page
* in the IAM User Guide.
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param userId
* The unique identifier of the calling entity. The exact value
* depends on the type of entity making the call. The values
* returned are those listed in the aws:userid column in
* the Principal table found on the Policy Variables
* reference page in the IAM User Guide.
*
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public GetCallerIdentityResult withUserId(String userId) {
this.userId = userId;
return this;
}
/**
*
* The AWS account ID number of the account that owns or contains the
* calling entity.
*
*
* @return
* The AWS account ID number of the account that owns or contains
* the calling entity.
*
*/
public String getAccount() {
return account;
}
/**
*
* The AWS account ID number of the account that owns or contains the
* calling entity.
*
*
* @param account
* The AWS account ID number of the account that owns or contains
* the calling entity.
*
*/
public void setAccount(String account) {
this.account = account;
}
/**
*
* The AWS account ID number of the account that owns or contains the
* calling entity.
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* @param account
* The AWS account ID number of the account that owns or contains
* the calling entity.
*
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public GetCallerIdentityResult withAccount(String account) {
this.account = account;
return this;
}
/**
*
* The AWS ARN associated with the calling entity.
*
*
* Constraints:
* Length: 20 - 2048
* Pattern: [
* -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]+
*
* @return
* The AWS ARN associated with the calling entity.
*
*/
public String getArn() {
return arn;
}
/**
*
* The AWS ARN associated with the calling entity.
*
*
* Constraints:
* Length: 20 - 2048
* Pattern: [
* -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]+
*
* @param arn
* The AWS ARN associated with the calling entity.
*
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The AWS ARN associated with the calling entity.
*
*
* Returns a reference to this object so that method calls can be chained
* together.
*
* Constraints:
* Length: 20 - 2048
* Pattern: [
* -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]+
*
* @param arn
* The AWS ARN associated with the calling entity.
*
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public GetCallerIdentityResult withArn(String arn) {
this.arn = arn;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getUserId() != null)
sb.append("UserId: " + getUserId() + ",");
if (getAccount() != null)
sb.append("Account: " + getAccount() + ",");
if (getArn() != null)
sb.append("Arn: " + getArn());
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode());
hashCode = prime * hashCode + ((getAccount() == null) ? 0 : getAccount().hashCode());
hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof GetCallerIdentityResult == false)
return false;
GetCallerIdentityResult other = (GetCallerIdentityResult) obj;
if (other.getUserId() == null ^ this.getUserId() == null)
return false;
if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false)
return false;
if (other.getAccount() == null ^ this.getAccount() == null)
return false;
if (other.getAccount() != null && other.getAccount().equals(this.getAccount()) == false)
return false;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
return true;
}
}