commonMain.aws.sdk.kotlin.services.applicationsignals.endpoints.DefaultApplicationSignalsEndpointProvider.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.applicationsignals.endpoints
import aws.sdk.kotlin.services.applicationsignals.endpoints.internal.partition
import aws.smithy.kotlin.runtime.client.endpoints.Endpoint
import aws.smithy.kotlin.runtime.client.endpoints.EndpointProviderException
import aws.smithy.kotlin.runtime.net.url.Url
/**
* The default endpoint provider as specified by the service model.
*/
public class DefaultApplicationSignalsEndpointProvider: ApplicationSignalsEndpointProvider {
public override suspend fun resolveEndpoint(params: ApplicationSignalsEndpointParameters): Endpoint {
if (
params.endpoint != null
) {
if (
params.useFips == true
) {
throw EndpointProviderException("Invalid Configuration: FIPS and custom endpoint are not supported")
}
return Endpoint(
Url.parse(params.endpoint),
)
}
if (
params.region != null
) {
run {
val partitionResult = partition(params.region)
if (
partitionResult != null
) {
if (
params.useFips == true
) {
return Endpoint(
Url.parse("https://application-signals-fips.${params.region}.${partitionResult?.dualStackDnsSuffix}"),
)
}
return Endpoint(
Url.parse("https://application-signals.${params.region}.${partitionResult?.dualStackDnsSuffix}"),
)
}
}
}
throw EndpointProviderException("Invalid Configuration: Missing Region")
throw EndpointProviderException("endpoint rules were exhausted without a match")
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy