This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.joelforjava.aws.assumerole.example; | |
import software.amazon.awssdk.auth.credentials.*; | |
import software.amazon.awssdk.regions.Region; | |
import software.amazon.awssdk.services.s3.S3Client; | |
import software.amazon.awssdk.services.s3.model.ListObjectsRequest; | |
import software.amazon.awssdk.services.s3.model.ListObjectsResponse; | |
import software.amazon.awssdk.services.sts.StsAsyncClient; | |
import software.amazon.awssdk.services.sts.model.AssumeRoleRequest; | |
import software.amazon.awssdk.services.sts.model.AssumeRoleResponse; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.joelforjava.aws.assumerole.example; | |
import com.amazonaws.auth.AWSCredentialsProvider; | |
import com.amazonaws.auth.AWSStaticCredentialsProvider; | |
import com.amazonaws.auth.BasicSessionCredentials; | |
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; | |
import com.amazonaws.auth.profile.ProfileCredentialsProvider; | |
import com.amazonaws.services.s3.AmazonS3; | |
import com.amazonaws.services.s3.AmazonS3ClientBuilder; | |
import com.amazonaws.services.s3.model.ObjectListing; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TwoUp { | |
private var money = 1000 | |
func tossWasHeads() -> Bool { | |
let next = randomNumber() | |
return next % 2 == 0 | |
} | |
func moreTurns() -> Bool { | |
if (money > 0) { |