
commonMain.aws.sdk.kotlin.services.rolesanywhere.DefaultRolesAnywhereClient.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.rolesanywhere
import aws.sdk.kotlin.runtime.client.AwsClientOption
import aws.sdk.kotlin.runtime.http.ApiMetadata
import aws.sdk.kotlin.runtime.http.AwsUserAgentMetadata
import aws.sdk.kotlin.runtime.http.interceptors.AwsSpanInterceptor
import aws.sdk.kotlin.runtime.http.middleware.AwsRetryHeaderMiddleware
import aws.sdk.kotlin.runtime.http.middleware.RecursionDetection
import aws.sdk.kotlin.runtime.http.middleware.UserAgent
import aws.sdk.kotlin.services.rolesanywhere.auth.AuthSchemeProviderAdapter
import aws.sdk.kotlin.services.rolesanywhere.auth.IdentityProviderConfigAdapter
import aws.sdk.kotlin.services.rolesanywhere.endpoints.internal.EndpointResolverAdapter
import aws.sdk.kotlin.services.rolesanywhere.model.*
import aws.sdk.kotlin.services.rolesanywhere.transform.*
import aws.smithy.kotlin.runtime.auth.AuthSchemeId
import aws.smithy.kotlin.runtime.auth.awssigning.AwsSigningAttributes
import aws.smithy.kotlin.runtime.auth.awssigning.DefaultAwsSigner
import aws.smithy.kotlin.runtime.client.SdkClientOption
import aws.smithy.kotlin.runtime.http.SdkHttpClient
import aws.smithy.kotlin.runtime.http.auth.HttpAuthScheme
import aws.smithy.kotlin.runtime.http.auth.SigV4AuthScheme
import aws.smithy.kotlin.runtime.http.operation.OperationAuthConfig
import aws.smithy.kotlin.runtime.http.operation.OperationMetrics
import aws.smithy.kotlin.runtime.http.operation.SdkHttpOperation
import aws.smithy.kotlin.runtime.http.operation.context
import aws.smithy.kotlin.runtime.http.operation.roundTrip
import aws.smithy.kotlin.runtime.http.operation.telemetry
import aws.smithy.kotlin.runtime.io.SdkManagedGroup
import aws.smithy.kotlin.runtime.io.addIfManaged
import aws.smithy.kotlin.runtime.operation.ExecutionContext
import aws.smithy.kotlin.runtime.util.attributesOf
import aws.smithy.kotlin.runtime.util.putIfAbsent
import aws.smithy.kotlin.runtime.util.putIfAbsentNotNull
public const val ServiceApiVersion: String = "2018-05-10"
internal class DefaultRolesAnywhereClient(override val config: RolesAnywhereClient.Config) : RolesAnywhereClient {
private val managedResources = SdkManagedGroup()
private val client = SdkHttpClient(config.httpClient)
private val identityProviderConfig = IdentityProviderConfigAdapter(config)
private val configuredAuthSchemes = with(config.authSchemes.associateBy(HttpAuthScheme::schemeId).toMutableMap()){
getOrPut(AuthSchemeId.AwsSigV4){
SigV4AuthScheme(DefaultAwsSigner, "rolesanywhere")
}
toMap()
}
private val telemetryScope = "aws.sdk.kotlin.services.rolesanywhere"
private val opMetrics = OperationMetrics(telemetryScope, config.telemetryProvider)
init {
managedResources.addIfManaged(config.httpClient)
managedResources.addIfManaged(config.credentialsProvider)
}
private val awsUserAgentMetadata = AwsUserAgentMetadata.fromEnvironment(ApiMetadata(ServiceId, SdkVersion))
/**
* Creates a *profile*, a list of the roles that Roles Anywhere service is trusted to assume. You use profiles to intersect permissions with IAM managed policies.
*
* **Required permissions: **`rolesanywhere:CreateProfile`.
*/
override suspend fun createProfile(input: CreateProfileRequest): CreateProfileResponse {
val op = SdkHttpOperation.build {
serializer = CreateProfileOperationSerializer()
deserializer = CreateProfileOperationDeserializer()
context {
expectedHttpStatus = 201
operationName = "CreateProfile"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Creates a trust anchor to establish trust between IAM Roles Anywhere and your certificate authority (CA). You can define a trust anchor as a reference to an Private Certificate Authority (Private CA) or by uploading a CA certificate. Your Amazon Web Services workloads can authenticate with the trust anchor using certificates issued by the CA in exchange for temporary Amazon Web Services credentials.
*
* **Required permissions: **`rolesanywhere:CreateTrustAnchor`.
*/
override suspend fun createTrustAnchor(input: CreateTrustAnchorRequest): CreateTrustAnchorResponse {
val op = SdkHttpOperation.build {
serializer = CreateTrustAnchorOperationSerializer()
deserializer = CreateTrustAnchorOperationDeserializer()
context {
expectedHttpStatus = 201
operationName = "CreateTrustAnchor"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Deletes a certificate revocation list (CRL).
*
* **Required permissions: **`rolesanywhere:DeleteCrl`.
*/
override suspend fun deleteCrl(input: DeleteCrlRequest): DeleteCrlResponse {
val op = SdkHttpOperation.build {
serializer = DeleteCrlOperationSerializer()
deserializer = DeleteCrlOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "DeleteCrl"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Deletes a profile.
*
* **Required permissions: **`rolesanywhere:DeleteProfile`.
*/
override suspend fun deleteProfile(input: DeleteProfileRequest): DeleteProfileResponse {
val op = SdkHttpOperation.build {
serializer = DeleteProfileOperationSerializer()
deserializer = DeleteProfileOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "DeleteProfile"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Deletes a trust anchor.
*
* **Required permissions: **`rolesanywhere:DeleteTrustAnchor`.
*/
override suspend fun deleteTrustAnchor(input: DeleteTrustAnchorRequest): DeleteTrustAnchorResponse {
val op = SdkHttpOperation.build {
serializer = DeleteTrustAnchorOperationSerializer()
deserializer = DeleteTrustAnchorOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "DeleteTrustAnchor"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Disables a certificate revocation list (CRL).
*
* **Required permissions: **`rolesanywhere:DisableCrl`.
*/
override suspend fun disableCrl(input: DisableCrlRequest): DisableCrlResponse {
val op = SdkHttpOperation.build {
serializer = DisableCrlOperationSerializer()
deserializer = DisableCrlOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "DisableCrl"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Disables a profile. When disabled, temporary credential requests with this profile fail.
*
* **Required permissions: **`rolesanywhere:DisableProfile`.
*/
override suspend fun disableProfile(input: DisableProfileRequest): DisableProfileResponse {
val op = SdkHttpOperation.build {
serializer = DisableProfileOperationSerializer()
deserializer = DisableProfileOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "DisableProfile"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Disables a trust anchor. When disabled, temporary credential requests specifying this trust anchor are unauthorized.
*
* **Required permissions: **`rolesanywhere:DisableTrustAnchor`.
*/
override suspend fun disableTrustAnchor(input: DisableTrustAnchorRequest): DisableTrustAnchorResponse {
val op = SdkHttpOperation.build {
serializer = DisableTrustAnchorOperationSerializer()
deserializer = DisableTrustAnchorOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "DisableTrustAnchor"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Enables a certificate revocation list (CRL). When enabled, certificates stored in the CRL are unauthorized to receive session credentials.
*
* **Required permissions: **`rolesanywhere:EnableCrl`.
*/
override suspend fun enableCrl(input: EnableCrlRequest): EnableCrlResponse {
val op = SdkHttpOperation.build {
serializer = EnableCrlOperationSerializer()
deserializer = EnableCrlOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "EnableCrl"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Enables temporary credential requests for a profile.
*
* **Required permissions: **`rolesanywhere:EnableProfile`.
*/
override suspend fun enableProfile(input: EnableProfileRequest): EnableProfileResponse {
val op = SdkHttpOperation.build {
serializer = EnableProfileOperationSerializer()
deserializer = EnableProfileOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "EnableProfile"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Enables a trust anchor. When enabled, certificates in the trust anchor chain are authorized for trust validation.
*
* **Required permissions: **`rolesanywhere:EnableTrustAnchor`.
*/
override suspend fun enableTrustAnchor(input: EnableTrustAnchorRequest): EnableTrustAnchorResponse {
val op = SdkHttpOperation.build {
serializer = EnableTrustAnchorOperationSerializer()
deserializer = EnableTrustAnchorOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "EnableTrustAnchor"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets a certificate revocation list (CRL).
*
* **Required permissions: **`rolesanywhere:GetCrl`.
*/
override suspend fun getCrl(input: GetCrlRequest): GetCrlResponse {
val op = SdkHttpOperation.build {
serializer = GetCrlOperationSerializer()
deserializer = GetCrlOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "GetCrl"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets a profile.
*
* **Required permissions: **`rolesanywhere:GetProfile`.
*/
override suspend fun getProfile(input: GetProfileRequest): GetProfileResponse {
val op = SdkHttpOperation.build {
serializer = GetProfileOperationSerializer()
deserializer = GetProfileOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "GetProfile"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets a *subject*, which associates a certificate identity with authentication attempts. The subject stores auditing information such as the status of the last authentication attempt, the certificate data used in the attempt, and the last time the associated identity attempted authentication.
*
* **Required permissions: **`rolesanywhere:GetSubject`.
*/
override suspend fun getSubject(input: GetSubjectRequest): GetSubjectResponse {
val op = SdkHttpOperation.build {
serializer = GetSubjectOperationSerializer()
deserializer = GetSubjectOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "GetSubject"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Gets a trust anchor.
*
* **Required permissions: **`rolesanywhere:GetTrustAnchor`.
*/
override suspend fun getTrustAnchor(input: GetTrustAnchorRequest): GetTrustAnchorResponse {
val op = SdkHttpOperation.build {
serializer = GetTrustAnchorOperationSerializer()
deserializer = GetTrustAnchorOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "GetTrustAnchor"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Imports the certificate revocation list (CRL). A CRL is a list of certificates that have been revoked by the issuing certificate Authority (CA). IAM Roles Anywhere validates against the CRL before issuing credentials.
*
* **Required permissions: **`rolesanywhere:ImportCrl`.
*/
override suspend fun importCrl(input: ImportCrlRequest): ImportCrlResponse {
val op = SdkHttpOperation.build {
serializer = ImportCrlOperationSerializer()
deserializer = ImportCrlOperationDeserializer()
context {
expectedHttpStatus = 201
operationName = "ImportCrl"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Lists all certificate revocation lists (CRL) in the authenticated account and Amazon Web Services Region.
*
* **Required permissions: **`rolesanywhere:ListCrls`.
*/
override suspend fun listCrls(input: ListCrlsRequest): ListCrlsResponse {
val op = SdkHttpOperation.build {
serializer = ListCrlsOperationSerializer()
deserializer = ListCrlsOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "ListCrls"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Lists all profiles in the authenticated account and Amazon Web Services Region.
*
* **Required permissions: **`rolesanywhere:ListProfiles`.
*/
override suspend fun listProfiles(input: ListProfilesRequest): ListProfilesResponse {
val op = SdkHttpOperation.build {
serializer = ListProfilesOperationSerializer()
deserializer = ListProfilesOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "ListProfiles"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Lists the subjects in the authenticated account and Amazon Web Services Region.
*
* **Required permissions: **`rolesanywhere:ListSubjects`.
*/
override suspend fun listSubjects(input: ListSubjectsRequest): ListSubjectsResponse {
val op = SdkHttpOperation.build {
serializer = ListSubjectsOperationSerializer()
deserializer = ListSubjectsOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "ListSubjects"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Lists the tags attached to the resource.
*
* **Required permissions: **`rolesanywhere:ListTagsForResource`.
*/
override suspend fun listTagsForResource(input: ListTagsForResourceRequest): ListTagsForResourceResponse {
val op = SdkHttpOperation.build {
serializer = ListTagsForResourceOperationSerializer()
deserializer = ListTagsForResourceOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "ListTagsForResource"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Lists the trust anchors in the authenticated account and Amazon Web Services Region.
*
* **Required permissions: **`rolesanywhere:ListTrustAnchors`.
*/
override suspend fun listTrustAnchors(input: ListTrustAnchorsRequest): ListTrustAnchorsResponse {
val op = SdkHttpOperation.build {
serializer = ListTrustAnchorsOperationSerializer()
deserializer = ListTrustAnchorsOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "ListTrustAnchors"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Attaches a list of *notification settings* to a trust anchor.
*
* A notification setting includes information such as event name, threshold, status of the notification setting, and the channel to notify.
*
* **Required permissions: **`rolesanywhere:PutNotificationSettings`.
*/
override suspend fun putNotificationSettings(input: PutNotificationSettingsRequest): PutNotificationSettingsResponse {
val op = SdkHttpOperation.build {
serializer = PutNotificationSettingsOperationSerializer()
deserializer = PutNotificationSettingsOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "PutNotificationSettings"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Resets the *custom notification setting* to IAM Roles Anywhere default setting.
*
* **Required permissions: **`rolesanywhere:ResetNotificationSettings`.
*/
override suspend fun resetNotificationSettings(input: ResetNotificationSettingsRequest): ResetNotificationSettingsResponse {
val op = SdkHttpOperation.build {
serializer = ResetNotificationSettingsOperationSerializer()
deserializer = ResetNotificationSettingsOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "ResetNotificationSettings"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Attaches tags to a resource.
*
* **Required permissions: **`rolesanywhere:TagResource`.
*/
override suspend fun tagResource(input: TagResourceRequest): TagResourceResponse {
val op = SdkHttpOperation.build {
serializer = TagResourceOperationSerializer()
deserializer = TagResourceOperationDeserializer()
context {
expectedHttpStatus = 201
operationName = "TagResource"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Removes tags from the resource.
*
* **Required permissions: **`rolesanywhere:UntagResource`.
*/
override suspend fun untagResource(input: UntagResourceRequest): UntagResourceResponse {
val op = SdkHttpOperation.build {
serializer = UntagResourceOperationSerializer()
deserializer = UntagResourceOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "UntagResource"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Updates the certificate revocation list (CRL). A CRL is a list of certificates that have been revoked by the issuing certificate authority (CA). IAM Roles Anywhere validates against the CRL before issuing credentials.
*
* **Required permissions: **`rolesanywhere:UpdateCrl`.
*/
override suspend fun updateCrl(input: UpdateCrlRequest): UpdateCrlResponse {
val op = SdkHttpOperation.build {
serializer = UpdateCrlOperationSerializer()
deserializer = UpdateCrlOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "UpdateCrl"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Updates a *profile*, a list of the roles that IAM Roles Anywhere service is trusted to assume. You use profiles to intersect permissions with IAM managed policies.
*
* **Required permissions: **`rolesanywhere:UpdateProfile`.
*/
override suspend fun updateProfile(input: UpdateProfileRequest): UpdateProfileResponse {
val op = SdkHttpOperation.build {
serializer = UpdateProfileOperationSerializer()
deserializer = UpdateProfileOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "UpdateProfile"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
/**
* Updates a trust anchor. You establish trust between IAM Roles Anywhere and your certificate authority (CA) by configuring a trust anchor. You can define a trust anchor as a reference to an Private Certificate Authority (Private CA) or by uploading a CA certificate. Your Amazon Web Services workloads can authenticate with the trust anchor using certificates issued by the CA in exchange for temporary Amazon Web Services credentials.
*
* **Required permissions: **`rolesanywhere:UpdateTrustAnchor`.
*/
override suspend fun updateTrustAnchor(input: UpdateTrustAnchorRequest): UpdateTrustAnchorResponse {
val op = SdkHttpOperation.build {
serializer = UpdateTrustAnchorOperationSerializer()
deserializer = UpdateTrustAnchorOperationDeserializer()
context {
expectedHttpStatus = 200
operationName = "UpdateTrustAnchor"
serviceName = ServiceId
}
telemetry {
provider = config.telemetryProvider
scope = telemetryScope
metrics = opMetrics
attributes = attributesOf {
"rpc.system" to "aws-api"
}
}
execution.auth = OperationAuthConfig(AuthSchemeProviderAdapter, configuredAuthSchemes, identityProviderConfig)
execution.endpointResolver = EndpointResolverAdapter(config)
execution.retryStrategy = config.retryStrategy
}
op.execution.retryPolicy = config.retryPolicy
mergeServiceDefaults(op.context)
op.interceptors.add(AwsSpanInterceptor)
op.install(AwsRetryHeaderMiddleware())
op.install(UserAgent(awsUserAgentMetadata))
op.install(RecursionDetection())
op.interceptors.addAll(config.interceptors)
return op.roundTrip(client, input)
}
override fun close() {
managedResources.unshareAll()
}
/**
* merge the defaults configured for the service into the execution context before firing off a request
*/
private fun mergeServiceDefaults(ctx: ExecutionContext) {
ctx.putIfAbsentNotNull(AwsClientOption.Region, config.region)
ctx.putIfAbsent(SdkClientOption.ClientName, config.clientName)
ctx.putIfAbsent(SdkClientOption.LogMode, config.logMode)
ctx.putIfAbsent(AwsSigningAttributes.SigningService, "rolesanywhere")
ctx.putIfAbsentNotNull(AwsSigningAttributes.SigningRegion, config.region)
ctx.putIfAbsent(AwsSigningAttributes.CredentialsProvider, config.credentialsProvider)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy