Search in sources :

Example 1 with GetCallerIdentityResponse

use of software.amazon.awssdk.services.sts.model.GetCallerIdentityResponse in project aws-doc-sdk-examples by awsdocs.

the class GetCallerIdentity method getCallerId.

// snippet-start:[sts.java2.get_call_id.main]
public static void getCallerId(StsClient stsClient) {
    try {
        GetCallerIdentityResponse response = stsClient.getCallerIdentity();
        System.out.println("The user id is" + response.userId());
        System.out.println("The ARN value is" + response.arn());
    } catch (StsException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : GetCallerIdentityResponse(software.amazon.awssdk.services.sts.model.GetCallerIdentityResponse) StsException(software.amazon.awssdk.services.sts.model.StsException)

Aggregations

GetCallerIdentityResponse (software.amazon.awssdk.services.sts.model.GetCallerIdentityResponse)1 StsException (software.amazon.awssdk.services.sts.model.StsException)1