All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.securitytoken.model.GetCallerIdentityResult Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS STS module holds the client classes that are used for communicating with AWS Security Token Service

There is a newer version: 1.9.31
Show newest version
/*
 * Copyright 2010-2016 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, Cloneable { /** *

* 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. *

*/ 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. *

* * @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. *

* * @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 this.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. * @return Returns a reference to this object so that method calls can be * chained together. */ public GetCallerIdentityResult withUserId(String userId) { setUserId(userId); return this; } /** *

* 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. *

* * @return The AWS account ID number of the account that owns or contains * the calling entity. */ public String getAccount() { return this.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. * @return Returns a reference to this object so that method calls can be * chained together. */ public GetCallerIdentityResult withAccount(String account) { setAccount(account); return this; } /** *

* The AWS ARN associated with the calling entity. *

* * @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. *

* * @return The AWS ARN associated with the calling entity. */ public String getArn() { return this.arn; } /** *

* The AWS ARN associated with the calling entity. *

* * @param arn * The AWS ARN associated with the calling entity. * @return Returns a reference to this object so that method calls can be * chained together. */ public GetCallerIdentityResult withArn(String arn) { setArn(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 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; } @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 GetCallerIdentityResult clone() { try { return (GetCallerIdentityResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy