org.http4k.connect.amazon.sts.stsExtensions.kt Maven / Gradle / Ivy
package org.http4k.connect.amazon.sts
import dev.forkhandles.result4k.Result
import java.time.Duration
import kotlin.Long
import kotlin.String
import kotlin.collections.List
import org.http4k.connect.RemoteFailure
import org.http4k.connect.amazon.core.model.ARN
import org.http4k.connect.amazon.core.model.RoleSessionName
import org.http4k.connect.amazon.core.model.Tag
import org.http4k.connect.amazon.core.model.WebIdentityToken
import org.http4k.connect.amazon.sts.action.AssumeRole
import org.http4k.connect.amazon.sts.action.AssumeRoleWithWebIdentity
import org.http4k.connect.amazon.sts.action.AssumedRoleWithWebIdentityResponse
import org.http4k.connect.amazon.sts.action.SimpleAssumedRole
import org.http4k.connect.amazon.sts.model.TokenCode
/**
* @see org.http4k.connect.amazon.sts.action.AssumeRole
*/
public fun STS.assumeRole(
RoleArn: ARN,
RoleSessionName: RoleSessionName,
TokenCode: TokenCode? = null,
SerialNumber: Long? = null,
DurationSeconds: Duration? = null,
ExternalId: String? = null,
Policy: String? = null,
PolicyArns: List? = null,
Tags: List? = null,
TransitiveTagKeys: List? = null,
): Result = invoke(AssumeRole(RoleArn, RoleSessionName, TokenCode,
SerialNumber, DurationSeconds, ExternalId, Policy, PolicyArns, Tags, TransitiveTagKeys))
/**
* @see org.http4k.connect.amazon.sts.action.AssumeRoleWithWebIdentity
*/
public fun STS.assumeRoleWithWebIdentity(
RoleArn: ARN,
RoleSessionName: RoleSessionName,
WebIdentityToken: WebIdentityToken,
DurationSeconds: Duration? = null,
Policy: String? = null,
PolicyArns: List? = null,
ProviderId: String? = null,
Tags: List? = null,
): Result =
invoke(AssumeRoleWithWebIdentity(RoleArn, RoleSessionName, WebIdentityToken, DurationSeconds,
Policy, PolicyArns, ProviderId, Tags))