AWS SDK

AWS SDK

rev. b9ccf3dabc550b0fbe85e785b19c58a2472f505e..96418c2288c67c1dde0d5d93cadadbf52fc820f4 (ignoring whitespace)

Files changed:

tmp-codegen-diff/services/ec2/generated-src/main/kotlin/aws/sdk/kotlin/services/ec2/serde/RouteTableAssociationDocumentDeserializer.kt

@@ -3,3 +41,44 @@
   23     23   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   24     24   
            // RouteTableId com.amazonaws.ec2#RouteTableAssociation$RouteTableId
   25     25   
            "routeTableId" -> builder.routeTableId = curr.tryData()
   26     26   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   27     27   
            // SubnetId com.amazonaws.ec2#RouteTableAssociation$SubnetId
   28     28   
            "subnetId" -> builder.subnetId = curr.tryData()
   29     29   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   30     30   
            // GatewayId com.amazonaws.ec2#RouteTableAssociation$GatewayId
   31     31   
            "gatewayId" -> builder.gatewayId = curr.tryData()
   32     32   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
          33  +
            // PublicIpv4Pool com.amazonaws.ec2#RouteTableAssociation$PublicIpv4Pool
          34  +
            "publicIpv4Pool" -> builder.publicIpv4Pool = curr.tryData()
          35  +
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   33     36   
            // AssociationState com.amazonaws.ec2#RouteTableAssociation$AssociationState
   34     37   
            "associationState" -> builder.associationState = deserializeRouteTableAssociationStateDocument(curr)
   35     38   
            else -> {}
   36     39   
        }
   37     40   
        curr.drop()
   38     41   
    }
   39     42   
    builder.correctErrors()
   40     43   
    return builder.build()
   41     44   
}

tmp-codegen-diff/services/ec2/generated-src/main/kotlin/aws/sdk/kotlin/services/ec2/serde/ServiceConfigurationDocumentDeserializer.kt

@@ -2,2 +61,63 @@
   22     22   
            // ServiceId com.amazonaws.ec2#ServiceConfiguration$ServiceId
   23     23   
            "serviceId" -> builder.serviceId = curr.tryData()
   24     24   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   25     25   
            // ServiceName com.amazonaws.ec2#ServiceConfiguration$ServiceName
   26     26   
            "serviceName" -> builder.serviceName = curr.tryData()
   27     27   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   28     28   
            // ServiceState com.amazonaws.ec2#ServiceConfiguration$ServiceState
   29     29   
            "serviceState" -> builder.serviceState = curr.tryData()
   30     30   
                .parse { ServiceState.fromValue(it) }
   31     31   
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.ec2#ServiceState`)" }
          32  +
            // AvailabilityZoneIds com.amazonaws.ec2#ServiceConfiguration$AvailabilityZoneIds
          33  +
            "availabilityZoneIdSet" -> builder.availabilityZoneIds = deserializeValueStringListShape(curr)
   32     34   
            // AvailabilityZones com.amazonaws.ec2#ServiceConfiguration$AvailabilityZones
   33     35   
            "availabilityZoneSet" -> builder.availabilityZones = deserializeValueStringListShape(curr)
   34     36   
            // AcceptanceRequired com.amazonaws.ec2#ServiceConfiguration$AcceptanceRequired
   35     37   
            "acceptanceRequired" -> builder.acceptanceRequired = curr.tryData()
   36     38   
                .parseBoolean()
   37     39   
                .getOrDeserializeErr { "expected (boolean: `com.amazonaws.ec2#Boolean`)" }
   38     40   
            // ManagesVpcEndpoints com.amazonaws.ec2#ServiceConfiguration$ManagesVpcEndpoints
   39     41   
            "managesVpcEndpoints" -> builder.managesVpcEndpoints = curr.tryData()
   40     42   
                .parseBoolean()
   41     43   
                .getOrDeserializeErr { "expected (boolean: `com.amazonaws.ec2#Boolean`)" }

tmp-codegen-diff/services/ec2/generated-src/main/kotlin/aws/sdk/kotlin/services/ec2/serde/ServiceDetailDocumentDeserializer.kt

@@ -1,1 +60,62 @@
   21     21   
            "serviceName" -> builder.serviceName = curr.tryData()
   22     22   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   23     23   
            // ServiceId com.amazonaws.ec2#ServiceDetail$ServiceId
   24     24   
            "serviceId" -> builder.serviceId = curr.tryData()
   25     25   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   26     26   
            // ServiceType com.amazonaws.ec2#ServiceDetail$ServiceType
   27     27   
            "serviceType" -> builder.serviceType = deserializeServiceTypeDetailSetShape(curr)
   28     28   
            // ServiceRegion com.amazonaws.ec2#ServiceDetail$ServiceRegion
   29     29   
            "serviceRegion" -> builder.serviceRegion = curr.tryData()
   30     30   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
          31  +
            // AvailabilityZoneIds com.amazonaws.ec2#ServiceDetail$AvailabilityZoneIds
          32  +
            "availabilityZoneIdSet" -> builder.availabilityZoneIds = deserializeValueStringListShape(curr)
   31     33   
            // AvailabilityZones com.amazonaws.ec2#ServiceDetail$AvailabilityZones
   32     34   
            "availabilityZoneSet" -> builder.availabilityZones = deserializeValueStringListShape(curr)
   33     35   
            // Owner com.amazonaws.ec2#ServiceDetail$Owner
   34     36   
            "owner" -> builder.owner = curr.tryData()
   35     37   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   36     38   
            // BaseEndpointDnsNames com.amazonaws.ec2#ServiceDetail$BaseEndpointDnsNames
   37     39   
            "baseEndpointDnsNameSet" -> builder.baseEndpointDnsNames = deserializeValueStringListShape(curr)
   38     40   
            // PrivateDnsName com.amazonaws.ec2#ServiceDetail$PrivateDnsName
   39     41   
            "privateDnsName" -> builder.privateDnsName = curr.tryData()
   40     42   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }

tmp-codegen-diff/services/ec2/generated-src/main/kotlin/aws/sdk/kotlin/services/ec2/serde/SpotInstanceRequestDocumentDeserializer.kt

@@ -21,21 +80,83 @@
   41     41   
            "instanceId" -> builder.instanceId = curr.tryData()
   42     42   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#InstanceId`)" }
   43     43   
            // LaunchGroup com.amazonaws.ec2#SpotInstanceRequest$LaunchGroup
   44     44   
            "launchGroup" -> builder.launchGroup = curr.tryData()
   45     45   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   46     46   
            // LaunchSpecification com.amazonaws.ec2#SpotInstanceRequest$LaunchSpecification
   47     47   
            "launchSpecification" -> builder.launchSpecification = deserializeLaunchSpecificationDocument(curr)
   48     48   
            // LaunchedAvailabilityZone com.amazonaws.ec2#SpotInstanceRequest$LaunchedAvailabilityZone
   49     49   
            "launchedAvailabilityZone" -> builder.launchedAvailabilityZone = curr.tryData()
   50     50   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
          51  +
            // LaunchedAvailabilityZoneId com.amazonaws.ec2#SpotInstanceRequest$LaunchedAvailabilityZoneId
          52  +
            "launchedAvailabilityZoneId" -> builder.launchedAvailabilityZoneId = curr.tryData()
          53  +
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   51     54   
            // ProductDescription com.amazonaws.ec2#SpotInstanceRequest$ProductDescription
   52     55   
            "productDescription" -> builder.productDescription = curr.tryData()
   53     56   
                .parse { RiProductDescription.fromValue(it) }
   54     57   
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.ec2#RIProductDescription`)" }
   55     58   
            // SpotInstanceRequestId com.amazonaws.ec2#SpotInstanceRequest$SpotInstanceRequestId
   56     59   
            "spotInstanceRequestId" -> builder.spotInstanceRequestId = curr.tryData()
   57     60   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   58     61   
            // SpotPrice com.amazonaws.ec2#SpotInstanceRequest$SpotPrice
   59     62   
            "spotPrice" -> builder.spotPrice = curr.tryData()
   60     63   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }

tmp-codegen-diff/services/ec2/generated-src/main/kotlin/aws/sdk/kotlin/services/ec2/serde/SpotPriceDocumentDeserializer.kt

@@ -1,1 +45,48 @@
   14     14   
   15     15   
internal fun deserializeSpotPriceDocument(reader: XmlTagReader): SpotPrice {
   16     16   
    val builder = SpotPrice.Builder()
   17     17   
   18     18   
    loop@while (true) {
   19     19   
        val curr = reader.nextTag() ?: break@loop
   20     20   
        when (curr.tagName) {
   21     21   
            // AvailabilityZone com.amazonaws.ec2#SpotPrice$AvailabilityZone
   22     22   
            "availabilityZone" -> builder.availabilityZone = curr.tryData()
   23     23   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
          24  +
            // AvailabilityZoneId com.amazonaws.ec2#SpotPrice$AvailabilityZoneId
          25  +
            "availabilityZoneId" -> builder.availabilityZoneId = curr.tryData()
          26  +
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   24     27   
            // InstanceType com.amazonaws.ec2#SpotPrice$InstanceType
   25     28   
            "instanceType" -> builder.instanceType = curr.tryData()
   26     29   
                .parse { InstanceType.fromValue(it) }
   27     30   
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.ec2#InstanceType`)" }
   28     31   
            // ProductDescription com.amazonaws.ec2#SpotPrice$ProductDescription
   29     32   
            "productDescription" -> builder.productDescription = curr.tryData()
   30     33   
                .parse { RiProductDescription.fromValue(it) }
   31     34   
                .getOrDeserializeErr { "expected (enum: `com.amazonaws.ec2#RIProductDescription`)" }
   32     35   
            // SpotPrice com.amazonaws.ec2#SpotPrice$SpotPrice
   33     36   
            "spotPrice" -> builder.spotPrice = curr.tryData()

tmp-codegen-diff/services/ec2/generated-src/main/kotlin/aws/sdk/kotlin/services/ec2/serde/VolumeDocumentDeserializer.kt

@@ -1,1 +53,56 @@
   14     14   
import aws.smithy.kotlin.runtime.serde.xml.XmlTagReader
   15     15   
import aws.smithy.kotlin.runtime.serde.xml.tryData
   16     16   
import aws.smithy.kotlin.runtime.time.TimestampFormat
   17     17   
   18     18   
internal fun deserializeVolumeDocument(reader: XmlTagReader): Volume {
   19     19   
    val builder = Volume.Builder()
   20     20   
   21     21   
    loop@while (true) {
   22     22   
        val curr = reader.nextTag() ?: break@loop
   23     23   
        when (curr.tagName) {
          24  +
            // AvailabilityZoneId com.amazonaws.ec2#Volume$AvailabilityZoneId
          25  +
            "availabilityZoneId" -> builder.availabilityZoneId = curr.tryData()
          26  +
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   24     27   
            // OutpostArn com.amazonaws.ec2#Volume$OutpostArn
   25     28   
            "outpostArn" -> builder.outpostArn = curr.tryData()
   26     29   
                .getOrDeserializeErr { "expected (string: `com.amazonaws.ec2#String`)" }
   27     30   
            // Iops com.amazonaws.ec2#Volume$Iops
   28     31   
            "iops" -> builder.iops = curr.tryData()
   29     32   
                .parseInt()
   30     33   
                .getOrDeserializeErr { "expected (integer: `com.amazonaws.ec2#Integer`)" }
   31     34   
            // Tags com.amazonaws.ec2#Volume$Tags
   32     35   
            "tagSet" -> builder.tags = deserializeTagListShape(curr)
   33     36   
            // VolumeType com.amazonaws.ec2#Volume$VolumeType

tmp-codegen-diff/services/ec2/generated-src/main/kotlin/aws/sdk/kotlin/services/ec2/waiters/Waiters.kt

@@ -1,1 +43,45 @@
    4      4   
    5      5   
import aws.sdk.kotlin.services.ec2.Ec2Client
    6      6   
import aws.sdk.kotlin.services.ec2.model.DescribeBundleTasksRequest
    7      7   
import aws.sdk.kotlin.services.ec2.model.DescribeBundleTasksResponse
    8      8   
import aws.sdk.kotlin.services.ec2.model.DescribeConversionTasksRequest
    9      9   
import aws.sdk.kotlin.services.ec2.model.DescribeConversionTasksResponse
   10     10   
import aws.sdk.kotlin.services.ec2.model.DescribeCustomerGatewaysRequest
   11     11   
import aws.sdk.kotlin.services.ec2.model.DescribeCustomerGatewaysResponse
   12     12   
import aws.sdk.kotlin.services.ec2.model.DescribeExportTasksRequest
   13     13   
import aws.sdk.kotlin.services.ec2.model.DescribeExportTasksResponse
          14  +
import aws.sdk.kotlin.services.ec2.model.DescribeImageUsageReportsRequest
          15  +
import aws.sdk.kotlin.services.ec2.model.DescribeImageUsageReportsResponse
   14     16   
import aws.sdk.kotlin.services.ec2.model.DescribeImagesRequest
   15     17   
import aws.sdk.kotlin.services.ec2.model.DescribeImagesResponse
   16     18   
import aws.sdk.kotlin.services.ec2.model.DescribeImportSnapshotTasksRequest
   17     19   
import aws.sdk.kotlin.services.ec2.model.DescribeImportSnapshotTasksResponse
   18     20   
import aws.sdk.kotlin.services.ec2.model.DescribeInstanceStatusRequest
   19     21   
import aws.sdk.kotlin.services.ec2.model.DescribeInstanceStatusResponse
   20     22   
import aws.sdk.kotlin.services.ec2.model.DescribeInstancesRequest
   21     23   
import aws.sdk.kotlin.services.ec2.model.DescribeInstancesResponse
   22     24   
import aws.sdk.kotlin.services.ec2.model.DescribeInternetGatewaysRequest
   23     25   
import aws.sdk.kotlin.services.ec2.model.DescribeInternetGatewaysResponse
@@ -371,373 +430,472 @@
  391    393   
        ErrorTypeAcceptor(RetryDirective.RetryError(RetryErrorType.ServerSide), "InvalidAMIID.NotFound"),
  392    394   
    )
  393    395   
  394    396   
    val policy = AcceptorRetryPolicy(request, acceptors)
  395    397   
    return strategy.retry(policy) { describeImages(request) }
  396    398   
}
  397    399   
  398    400   
public suspend fun Ec2Client.waitUntilImageExists(block: DescribeImagesRequest.Builder.() -> Unit): Outcome<DescribeImagesResponse> =
  399    401   
    waitUntilImageExists(DescribeImagesRequest.Builder().apply(block).build())
  400    402   
         403  +
public suspend fun Ec2Client.waitUntilImageUsageReportAvailable(request: DescribeImageUsageReportsRequest = DescribeImageUsageReportsRequest { }, retryStrategy: RetryStrategy? = null): Outcome<DescribeImageUsageReportsResponse> {
         404  +
    val strategy = retryStrategy ?: StandardRetryStrategy {
         405  +
        maxAttempts = 20
         406  +
        tokenBucket = InfiniteTokenBucket
         407  +
        delayProvider {
         408  +
            initialDelay = 15_000.milliseconds
         409  +
            scaleFactor = 1.5
         410  +
            jitter = 1.0
         411  +
            maxBackoff = 120_000.milliseconds
         412  +
        }
         413  +
    }
         414  +
         415  +
    val acceptors = listOf<Acceptor<DescribeImageUsageReportsRequest, DescribeImageUsageReportsResponse>>(
         416  +
        OutputAcceptor(RetryDirective.TerminateAndSucceed) {
         417  +
            val imageUsageReports = it.imageUsageReports
         418  +
            val imageUsageReportsOrEmpty = imageUsageReports?.flattenIfPossible()
         419  +
            val projection = imageUsageReportsOrEmpty?.flatMap {
         420  +
                val state = it?.state
         421  +
                listOfNotNull(state)
         422  +
            }
         423  +
            !(projection as List<String?>).isNullOrEmpty() && projection.all { it == "available" }
         424  +
        },
         425  +
        OutputAcceptor(RetryDirective.TerminateAndFail) {
         426  +
            val imageUsageReports = it.imageUsageReports
         427  +
            val imageUsageReportsOrEmpty = imageUsageReports?.flattenIfPossible()
         428  +
            val projection = imageUsageReportsOrEmpty?.flatMap {
         429  +
                val state = it?.state
         430  +
                listOfNotNull(state)
         431  +
            }
         432  +
            (projection as List<String?>?)?.any { it == "failed" } ?: false
         433  +
        },
         434  +
    )
         435  +
         436  +
    val policy = AcceptorRetryPolicy(request, acceptors)
         437  +
    return strategy.retry(policy) { describeImageUsageReports(request) }
         438  +
}
         439  +
         440  +
public suspend fun Ec2Client.waitUntilImageUsageReportAvailable(block: DescribeImageUsageReportsRequest.Builder.() -> Unit): Outcome<DescribeImageUsageReportsResponse> =
         441  +
    waitUntilImageUsageReportAvailable(DescribeImageUsageReportsRequest.Builder().apply(block).build())
         442  +
  401    443   
public suspend fun Ec2Client.waitUntilSnapshotImported(request: DescribeImportSnapshotTasksRequest = DescribeImportSnapshotTasksRequest { }, retryStrategy: RetryStrategy? = null): Outcome<DescribeImportSnapshotTasksResponse> {
  402    444   
    val strategy = retryStrategy ?: StandardRetryStrategy {
  403    445   
        maxAttempts = 20
  404    446   
        tokenBucket = InfiniteTokenBucket
  405    447   
        delayProvider {
  406    448   
            initialDelay = 15_000.milliseconds
  407    449   
            scaleFactor = 1.5
  408    450   
            jitter = 1.0
  409    451   
            maxBackoff = 120_000.milliseconds
  410    452   
        }

tmp-codegen-diff/services/ec2/generated-src/test/kotlin/aws/sdk/kotlin/services/ec2/endpoints/DefaultEndpointProviderTest.kt

@@ -685,685 +888,832 @@
  705    705   
            useFips = false
  706    706   
            useDualStack = false
  707    707   
        }
  708    708   
        val expected = Endpoint(
  709    709   
            uri = Url.parse("https://ec2.us-iso-west-1.c2s.ic.gov"),
  710    710   
        )
  711    711   
        val actual = DefaultEc2EndpointProvider().resolveEndpoint(params)
  712    712   
        expectEqualEndpoints(expected, actual)
  713    713   
    }
  714    714   
  715         -
    // For region us-iso-east-1 with FIPS enabled and DualStack enabled
  716         -
    @Test
  717         -
    fun test46() = runTest {
  718         -
        val params = Ec2EndpointParameters {
  719         -
            region = "us-iso-east-1"
  720         -
            useFips = true
  721         -
            useDualStack = true
  722         -
        }
  723         -
        val ex = assertFailsWith<EndpointProviderException> {
  724         -
            DefaultEc2EndpointProvider().resolveEndpoint(params)
  725         -
        }
  726         -
        assertEquals("FIPS and DualStack are enabled, but this partition does not support one or both", ex.message)
  727         -
    }
  728         -
  729    715   
    // For region us-iso-east-1 with FIPS enabled and DualStack disabled
  730    716   
    @Test
  731         -
    fun test47() = runTest {
         717  +
    fun test46() = runTest {
  732    718   
        val params = Ec2EndpointParameters {
  733    719   
            region = "us-iso-east-1"
  734    720   
            useFips = true
  735    721   
            useDualStack = false
  736    722   
        }
  737    723   
        val expected = Endpoint(
  738    724   
            uri = Url.parse("https://ec2-fips.us-iso-east-1.c2s.ic.gov"),
  739    725   
        )
  740    726   
        val actual = DefaultEc2EndpointProvider().resolveEndpoint(params)
  741    727   
        expectEqualEndpoints(expected, actual)
  742    728   
    }
  743    729   
  744         -
    // For region us-iso-east-1 with FIPS disabled and DualStack enabled
  745         -
    @Test
  746         -
    fun test48() = runTest {
  747         -
        val params = Ec2EndpointParameters {
  748         -
            region = "us-iso-east-1"
  749         -
            useFips = false
  750         -
            useDualStack = true
  751         -
        }
  752         -
        val ex = assertFailsWith<EndpointProviderException> {
  753         -
            DefaultEc2EndpointProvider().resolveEndpoint(params)
  754         -
        }
  755         -
        assertEquals("DualStack is enabled but this partition does not support DualStack", ex.message)
  756         -
    }
  757         -
  758    730   
    // For region us-isob-east-1 with FIPS disabled and DualStack disabled
  759    731   
    @Test
  760         -
    fun test49() = runTest {
         732  +
    fun test47() = runTest {
  761    733   
        val params = Ec2EndpointParameters {
  762    734   
            region = "us-isob-east-1"
  763    735   
            useFips = false
  764    736   
            useDualStack = false
  765    737   
        }
  766    738   
        val expected = Endpoint(
  767    739   
            uri = Url.parse("https://ec2.us-isob-east-1.sc2s.sgov.gov"),
  768    740   
        )
  769    741   
        val actual = DefaultEc2EndpointProvider().resolveEndpoint(params)
  770    742   
        expectEqualEndpoints(expected, actual)
  771    743   
    }
  772    744   
  773         -
    // For region us-isob-east-1 with FIPS enabled and DualStack enabled
  774         -
    @Test
  775         -
    fun test50() = runTest {
  776         -
        val params = Ec2EndpointParameters {
  777         -
            region = "us-isob-east-1"
  778         -
            useFips = true
  779         -
            useDualStack = true
  780         -
        }
  781         -
        val ex = assertFailsWith<EndpointProviderException> {
  782         -
            DefaultEc2EndpointProvider().resolveEndpoint(params)
  783         -
        }
  784         -
        assertEquals("FIPS and DualStack are enabled, but this partition does not support one or both", ex.message)
  785         -
    }
  786         -
  787    745   
    // For region us-isob-east-1 with FIPS enabled and DualStack disabled
  788    746   
    @Test
  789         -
    fun test51() = runTest {
         747  +
    fun test48() = runTest {
  790    748   
        val params = Ec2EndpointParameters {
  791    749   
            region = "us-isob-east-1"
  792    750   
            useFips = true
  793    751   
            useDualStack = false
  794    752   
        }
  795    753   
        val expected = Endpoint(
  796    754   
            uri = Url.parse("https://ec2-fips.us-isob-east-1.sc2s.sgov.gov"),
  797    755   
        )
  798    756   
        val actual = DefaultEc2EndpointProvider().resolveEndpoint(params)
  799    757   
        expectEqualEndpoints(expected, actual)
  800    758   
    }
  801    759   
  802         -
    // For region us-isob-east-1 with FIPS disabled and DualStack enabled
  803         -
    @Test
  804         -
    fun test52() = runTest {
  805         -
        val params = Ec2EndpointParameters {
  806         -
            region = "us-isob-east-1"
  807         -
            useFips = false
  808         -
            useDualStack = true
  809         -
        }
  810         -
        val ex = assertFailsWith<EndpointProviderException> {
  811         -
            DefaultEc2EndpointProvider().resolveEndpoint(params)
  812         -
        }
  813         -
        assertEquals("DualStack is enabled but this partition does not support DualStack", ex.message)
  814         -
    }
  815         -
  816    760   
    // For custom endpoint with region set and fips disabled and dualstack disabled
  817    761   
    @Test
  818         -
    fun test53() = runTest {
         762  +
    fun test49() = runTest {
  819    763   
        val params = Ec2EndpointParameters {
  820    764   
            region = "us-east-1"
  821    765   
            useFips = false
  822    766   
            useDualStack = false
  823    767   
            endpoint = "https://example.com"
  824    768   
        }
  825    769   
        val expected = Endpoint(
  826    770   
            uri = Url.parse("https://example.com"),
  827    771   
        )
  828    772   
        val actual = DefaultEc2EndpointProvider().resolveEndpoint(params)
  829    773   
        expectEqualEndpoints(expected, actual)
  830    774   
    }
  831    775   
  832    776   
    // For custom endpoint with region not set and fips disabled and dualstack disabled
  833    777   
    @Test
  834         -
    fun test54() = runTest {
         778  +
    fun test50() = runTest {
  835    779   
        val params = Ec2EndpointParameters {
  836    780   
            useFips = false
  837    781   
            useDualStack = false
  838    782   
            endpoint = "https://example.com"
  839    783   
        }
  840    784   
        val expected = Endpoint(
  841    785   
            uri = Url.parse("https://example.com"),
  842    786   
        )
  843    787   
        val actual = DefaultEc2EndpointProvider().resolveEndpoint(params)
  844    788   
        expectEqualEndpoints(expected, actual)
  845    789   
    }
  846    790   
  847    791   
    // For custom endpoint with fips enabled and dualstack disabled
  848    792   
    @Test
  849         -
    fun test55() = runTest {
         793  +
    fun test51() = runTest {
  850    794   
        val params = Ec2EndpointParameters {
  851    795   
            region = "us-east-1"
  852    796   
            useFips = true
  853    797   
            useDualStack = false
  854    798   
            endpoint = "https://example.com"
  855    799   
        }
  856    800   
        val ex = assertFailsWith<EndpointProviderException> {
  857    801   
            DefaultEc2EndpointProvider().resolveEndpoint(params)
  858    802   
        }
  859    803   
        assertEquals("Invalid Configuration: FIPS and custom endpoint are not supported", ex.message)
  860    804   
    }
  861    805   
  862    806   
    // For custom endpoint with fips disabled and dualstack enabled
  863    807   
    @Test
  864         -
    fun test56() = runTest {
         808  +
    fun test52() = runTest {
  865    809   
        val params = Ec2EndpointParameters {
  866    810   
            region = "us-east-1"
  867    811   
            useFips = false
  868    812   
            useDualStack = true
  869    813   
            endpoint = "https://example.com"
  870    814   
        }
  871    815   
        val ex = assertFailsWith<EndpointProviderException> {
  872    816   
            DefaultEc2EndpointProvider().resolveEndpoint(params)
  873    817   
        }
  874    818   
        assertEquals("Invalid Configuration: Dualstack and custom endpoint are not supported", ex.message)
  875    819   
    }
  876    820   
  877    821   
    // Missing region
  878    822   
    @Test
  879         -
    fun test57() = runTest {
         823  +
    fun test53() = runTest {
  880    824   
        val params = Ec2EndpointParameters {
  881    825   
        }
  882    826   
        val ex = assertFailsWith<EndpointProviderException> {
  883    827   
            DefaultEc2EndpointProvider().resolveEndpoint(params)
  884    828   
        }
  885    829   
        assertEquals("Invalid Configuration: Missing Region", ex.message)
  886    830   
    }
  887    831   
  888    832   
}

tmp-codegen-diff/services/polly/generated-src/main/kotlin/aws/sdk/kotlin/services/polly/PollyClient.kt

@@ -43,43 +103,103 @@
   63     63   
import aws.smithy.kotlin.runtime.telemetry.TelemetryConfig
   64     64   
import aws.smithy.kotlin.runtime.telemetry.TelemetryProvider
   65     65   
import aws.smithy.kotlin.runtime.util.LazyAsyncValue
   66     66   
import kotlin.collections.List
   67     67   
import kotlin.jvm.JvmStatic
   68     68   
import kotlin.time.Duration
   69     69   
import kotlinx.coroutines.runBlocking
   70     70   
   71     71   
   72     72   
public const val ServiceId: String = "Polly"
   73         -
public const val SdkVersion: String = "1.5.12-SNAPSHOT"
          73  +
public const val SdkVersion: String = "1.5.53-SNAPSHOT"
   74     74   
public const val ServiceApiVersion: String = "2016-06-10"
   75     75   
   76     76   
/**
   77     77   
 * Amazon Polly is a web service that makes it easy to synthesize speech from text.
   78     78   
 *
   79     79   
 * The Amazon Polly service provides API operations for synthesizing high-quality speech from plain text and Speech Synthesis Markup Language (SSML), along with managing pronunciations lexicons that enable you to get the best results for your application domain.
   80     80   
 */
   81     81   
public interface PollyClient : SdkClient {
   82     82   
    /**
   83     83   
     * PollyClient's configuration

tmp-codegen-diff/services/polly/generated-src/main/kotlin/aws/sdk/kotlin/services/polly/endpoints/internal/Partitions.kt

@@ -14,14 +73,75 @@
   34     34   
            "ap-southeast-1" to PartitionConfig(
   35     35   
            ),
   36     36   
            "ap-southeast-2" to PartitionConfig(
   37     37   
            ),
   38     38   
            "ap-southeast-3" to PartitionConfig(
   39     39   
            ),
   40     40   
            "ap-southeast-4" to PartitionConfig(
   41     41   
            ),
   42     42   
            "ap-southeast-5" to PartitionConfig(
   43     43   
            ),
          44  +
            "ap-southeast-6" to PartitionConfig(
          45  +
            ),
   44     46   
            "ap-southeast-7" to PartitionConfig(
   45     47   
            ),
   46     48   
            "aws-global" to PartitionConfig(
   47     49   
            ),
   48     50   
            "ca-central-1" to PartitionConfig(
   49     51   
            ),
   50     52   
            "ca-west-1" to PartitionConfig(
   51     53   
            ),
   52     54   
            "eu-central-1" to PartitionConfig(
   53     55   
            ),
@@ -87,89 +228,230 @@
  107    109   
        baseConfig = PartitionConfig(
  108    110   
            name = "aws-cn",
  109    111   
            dnsSuffix = "amazonaws.com.cn",
  110    112   
            dualStackDnsSuffix = "api.amazonwebservices.com.cn",
  111    113   
            supportsFIPS = true,
  112    114   
            supportsDualStack = true,
  113    115   
            implicitGlobalRegion = "cn-northwest-1",
  114    116   
        ),
  115    117   
    ),
  116    118   
    Partition(
  117         -
        id = "aws-us-gov",
  118         -
        regionRegex = Regex("^us\\-gov\\-\\w+\\-\\d+$"),
         119  +
        id = "aws-eusc",
         120  +
        regionRegex = Regex("^eusc\\-(de)\\-\\w+\\-\\d+$"),
  119    121   
        regions = mapOf(
  120         -
            "aws-us-gov-global" to PartitionConfig(
  121         -
            ),
  122         -
            "us-gov-east-1" to PartitionConfig(
  123         -
            ),
  124         -
            "us-gov-west-1" to PartitionConfig(
         122  +
            "eusc-de-east-1" to PartitionConfig(
  125    123   
            ),
  126    124   
        ),
  127    125   
        baseConfig = PartitionConfig(
  128         -
            name = "aws-us-gov",
  129         -
            dnsSuffix = "amazonaws.com",
  130         -
            dualStackDnsSuffix = "api.aws",
         126  +
            name = "aws-eusc",
         127  +
            dnsSuffix = "amazonaws.eu",
         128  +
            dualStackDnsSuffix = "api.amazonwebservices.eu",
  131    129   
            supportsFIPS = true,
  132    130   
            supportsDualStack = true,
  133         -
            implicitGlobalRegion = "us-gov-west-1",
         131  +
            implicitGlobalRegion = "eusc-de-east-1",
  134    132   
        ),
  135    133   
    ),
  136    134   
    Partition(
  137    135   
        id = "aws-iso",
  138    136   
        regionRegex = Regex("^us\\-iso\\-\\w+\\-\\d+$"),
  139    137   
        regions = mapOf(
  140    138   
            "aws-iso-global" to PartitionConfig(
  141    139   
            ),
  142    140   
            "us-iso-east-1" to PartitionConfig(
  143    141   
            ),
  144    142   
            "us-iso-west-1" to PartitionConfig(
  145    143   
            ),
  146    144   
        ),
  147    145   
        baseConfig = PartitionConfig(
  148    146   
            name = "aws-iso",
  149    147   
            dnsSuffix = "c2s.ic.gov",
  150         -
            dualStackDnsSuffix = "c2s.ic.gov",
         148  +
            dualStackDnsSuffix = "api.aws.ic.gov",
  151    149   
            supportsFIPS = true,
  152         -
            supportsDualStack = false,
         150  +
            supportsDualStack = true,
  153    151   
            implicitGlobalRegion = "us-iso-east-1",
  154    152   
        ),
  155    153   
    ),
  156    154   
    Partition(
  157    155   
        id = "aws-iso-b",
  158    156   
        regionRegex = Regex("^us\\-isob\\-\\w+\\-\\d+$"),
  159    157   
        regions = mapOf(
  160    158   
            "aws-iso-b-global" to PartitionConfig(
  161    159   
            ),
  162    160   
            "us-isob-east-1" to PartitionConfig(
  163    161   
            ),
  164    162   
        ),
  165    163   
        baseConfig = PartitionConfig(
  166    164   
            name = "aws-iso-b",
  167    165   
            dnsSuffix = "sc2s.sgov.gov",
  168         -
            dualStackDnsSuffix = "sc2s.sgov.gov",
         166  +
            dualStackDnsSuffix = "api.aws.scloud",
  169    167   
            supportsFIPS = true,
  170         -
            supportsDualStack = false,
         168  +
            supportsDualStack = true,
  171    169   
            implicitGlobalRegion = "us-isob-east-1",
  172    170   
        ),
  173    171   
    ),
  174    172   
    Partition(
  175    173   
        id = "aws-iso-e",
  176    174   
        regionRegex = Regex("^eu\\-isoe\\-\\w+\\-\\d+$"),
  177    175   
        regions = mapOf(
  178    176   
            "aws-iso-e-global" to PartitionConfig(
  179    177   
            ),
  180    178   
            "eu-isoe-west-1" to PartitionConfig(
  181    179   
            ),
  182    180   
        ),
  183    181   
        baseConfig = PartitionConfig(
  184    182   
            name = "aws-iso-e",
  185    183   
            dnsSuffix = "cloud.adc-e.uk",
  186         -
            dualStackDnsSuffix = "cloud.adc-e.uk",
         184  +
            dualStackDnsSuffix = "api.cloud-aws.adc-e.uk",
  187    185   
            supportsFIPS = true,
  188         -
            supportsDualStack = false,
         186  +
            supportsDualStack = true,
  189    187   
            implicitGlobalRegion = "eu-isoe-west-1",
  190    188   
        ),
  191    189   
    ),
  192    190   
    Partition(
  193    191   
        id = "aws-iso-f",
  194    192   
        regionRegex = Regex("^us\\-isof\\-\\w+\\-\\d+$"),
  195    193   
        regions = mapOf(
  196    194   
            "aws-iso-f-global" to PartitionConfig(
  197    195   
            ),
  198    196   
            "us-isof-east-1" to PartitionConfig(
  199    197   
            ),
  200    198   
            "us-isof-south-1" to PartitionConfig(
  201    199   
            ),
  202    200   
        ),
  203    201   
        baseConfig = PartitionConfig(
  204    202   
            name = "aws-iso-f",
  205    203   
            dnsSuffix = "csp.hci.ic.gov",
  206         -
            dualStackDnsSuffix = "csp.hci.ic.gov",
         204  +
            dualStackDnsSuffix = "api.aws.hci.ic.gov",
  207    205   
            supportsFIPS = true,
  208         -
            supportsDualStack = false,
         206  +
            supportsDualStack = true,
  209    207   
            implicitGlobalRegion = "us-isof-south-1",
  210    208   
        ),
  211    209   
    ),
  212    210   
    Partition(
  213         -
        id = "aws-eusc",
  214         -
        regionRegex = Regex("^eusc\\-(de)\\-\\w+\\-\\d+$"),
         211  +
        id = "aws-us-gov",
         212  +
        regionRegex = Regex("^us\\-gov\\-\\w+\\-\\d+$"),
  215    213   
        regions = mapOf(
  216         -
            "eusc-de-east-1" to PartitionConfig(
         214  +
            "aws-us-gov-global" to PartitionConfig(
         215  +
            ),
         216  +
            "us-gov-east-1" to PartitionConfig(
         217  +
            ),
         218  +
            "us-gov-west-1" to PartitionConfig(
  217    219   
            ),
  218    220   
        ),
  219    221   
        baseConfig = PartitionConfig(
  220         -
            name = "aws-eusc",
  221         -
            dnsSuffix = "amazonaws.eu",
  222         -
            dualStackDnsSuffix = "amazonaws.eu",
         222  +
            name = "aws-us-gov",
         223  +
            dnsSuffix = "amazonaws.com",
         224  +
            dualStackDnsSuffix = "api.aws",
  223    225   
            supportsFIPS = true,
  224         -
            supportsDualStack = false,
  225         -
            implicitGlobalRegion = "eusc-de-east-1",
         226  +
            supportsDualStack = true,
         227  +
            implicitGlobalRegion = "us-gov-west-1",
  226    228   
        ),
  227    229   
    ),
  228    230   
)

tmp-codegen-diff/services/polly/generated-src/main/kotlin/aws/sdk/kotlin/services/polly/model/OutputFormat.kt

@@ -1,1 +58,65 @@
   10     10   
    public object Json : aws.sdk.kotlin.services.polly.model.OutputFormat() {
   11     11   
        override val value: kotlin.String = "json"
   12     12   
        override fun toString(): kotlin.String = "Json"
   13     13   
    }
   14     14   
   15     15   
    public object Mp3 : aws.sdk.kotlin.services.polly.model.OutputFormat() {
   16     16   
        override val value: kotlin.String = "mp3"
   17     17   
        override fun toString(): kotlin.String = "Mp3"
   18     18   
    }
   19     19   
          20  +
    public object OggOpus : aws.sdk.kotlin.services.polly.model.OutputFormat() {
          21  +
        override val value: kotlin.String = "ogg_opus"
          22  +
        override fun toString(): kotlin.String = "OggOpus"
          23  +
    }
          24  +
   20     25   
    public object OggVorbis : aws.sdk.kotlin.services.polly.model.OutputFormat() {
   21     26   
        override val value: kotlin.String = "ogg_vorbis"
   22     27   
        override fun toString(): kotlin.String = "OggVorbis"
   23     28   
    }
   24     29   
   25     30   
    public object Pcm : aws.sdk.kotlin.services.polly.model.OutputFormat() {
   26     31   
        override val value: kotlin.String = "pcm"
   27     32   
        override fun toString(): kotlin.String = "Pcm"
   28     33   
    }
   29     34   
   30     35   
    public data class SdkUnknown(override val value: kotlin.String) : aws.sdk.kotlin.services.polly.model.OutputFormat() {
   31     36   
        override fun toString(): kotlin.String = "SdkUnknown($value)"
   32     37   
    }
   33     38   
   34     39   
    public companion object {
   35     40   
        /**
   36     41   
         * Convert a raw value to one of the sealed variants or [SdkUnknown]
   37     42   
         */
   38     43   
        public fun fromValue(value: kotlin.String): aws.sdk.kotlin.services.polly.model.OutputFormat = when (value) {
   39     44   
            "json" -> Json
   40     45   
            "mp3" -> Mp3
          46  +
            "ogg_opus" -> OggOpus
   41     47   
            "ogg_vorbis" -> OggVorbis
   42     48   
            "pcm" -> Pcm
   43     49   
            else -> SdkUnknown(value)
   44     50   
        }
   45     51   
   46     52   
        /**
   47     53   
         * Get a list of all possible variants
   48     54   
         */
   49     55   
        public fun values(): kotlin.collections.List<aws.sdk.kotlin.services.polly.model.OutputFormat> = values
   50     56   
   51     57   
        private val values: kotlin.collections.List<aws.sdk.kotlin.services.polly.model.OutputFormat> = listOf(
   52     58   
            Json,
   53     59   
            Mp3,
          60  +
            OggOpus,
   54     61   
            OggVorbis,
   55     62   
            Pcm,
   56     63   
        )
   57     64   
    }
   58     65   
}

tmp-codegen-diff/services/polly/generated-src/main/kotlin/aws/sdk/kotlin/services/polly/model/SynthesizeSpeechRequest.kt

@@ -1,1 +67,61 @@
    1      1   
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
    2      2   
    3      3   
package aws.sdk.kotlin.services.polly.model
    4      4   
    5      5   
import aws.smithy.kotlin.runtime.SdkDsl
    6      6   
    7      7   
public class SynthesizeSpeechRequest private constructor(builder: Builder) {
    8      8   
    /**
    9      9   
     * Specifies the engine (`standard`, `neural`, `long-form`, or `generative`) for Amazon Polly to use when processing input text for speech synthesis. Provide an engine that is supported by the voice you select. If you don't provide an engine, the standard engine is selected by default. If a chosen voice isn't supported by the standard engine, this will result in an error. For information on Amazon Polly voices and which voices are available for each engine, see [Available Voices](https://docs.aws.amazon.com/polly/latest/dg/voicelist.html).
   10         -
     *
   11         -
     * Type: String
   12         -
     *
   13         -
     * Valid Values: `standard` | `neural` | `long-form` | `generative`
   14         -
     *
   15         -
     * Required: Yes
   16     10   
     */
   17     11   
    public val engine: aws.sdk.kotlin.services.polly.model.Engine? = builder.engine
   18     12   
    /**
   19     13   
     * Optional language code for the Synthesize Speech request. This is only necessary if using a bilingual voice, such as Aditi, which can be used for either Indian English (en-IN) or Hindi (hi-IN).
   20     14   
     *
   21     15   
     * If a bilingual voice is used and no language code is specified, Amazon Polly uses the default language of the bilingual voice. The default language for any voice is the one returned by the [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) operation for the `LanguageCode` parameter. For example, if no language code is specified, Aditi will use Indian English rather than Hindi.
   22     16   
     */
   23     17   
    public val languageCode: aws.sdk.kotlin.services.polly.model.LanguageCode? = builder.languageCode
   24     18   
    /**
   25     19   
     * List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. For information about storing lexicons, see [PutLexicon](https://docs.aws.amazon.com/polly/latest/dg/API_PutLexicon.html).
   26     20   
     */
   27     21   
    public val lexiconNames: List<String>? = builder.lexiconNames
   28     22   
    /**
   29     23   
     * The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json.
   30     24   
     *
   31     25   
     * When pcm is used, the content returned is audio/pcm in a signed 16-bit, 1 channel (mono), little-endian format.
   32     26   
     */
   33     27   
    public val outputFormat: aws.sdk.kotlin.services.polly.model.OutputFormat? = builder.outputFormat
   34     28   
    /**
   35     29   
     * The audio frequency specified in Hz.
   36     30   
     *
   37         -
     * The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", and "24000". The default value for standard voices is "22050". The default value for neural voices is "24000". The default value for long-form voices is "24000". The default value for generative voices is "24000".
          31  +
     * The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", "24000", "44100" and "48000". The default value for standard voices is "22050". The default value for neural voices is "24000". The default value for long-form voices is "24000". The default value for generative voices is "24000".
   38     32   
     *
   39     33   
     * Valid values for pcm are "8000" and "16000" The default value is "16000".
   40     34   
     */
   41     35   
    public val sampleRate: kotlin.String? = builder.sampleRate
   42     36   
    /**
   43     37   
     * The type of speech marks returned for the input text.
   44     38   
     */
   45     39   
    public val speechMarkTypes: List<SpeechMarkType>? = builder.speechMarkTypes
   46     40   
    /**
   47     41   
     * Input text to synthesize. If you specify `ssml` as the `TextType`, follow the SSML format for the input text.
@@ -85,79 +172,160 @@
  105     99   
  106    100   
        return true
  107    101   
    }
  108    102   
  109    103   
    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.polly.model.SynthesizeSpeechRequest = Builder(this).apply(block).build()
  110    104   
  111    105   
    @SdkDsl
  112    106   
    public class Builder {
  113    107   
        /**
  114    108   
         * Specifies the engine (`standard`, `neural`, `long-form`, or `generative`) for Amazon Polly to use when processing input text for speech synthesis. Provide an engine that is supported by the voice you select. If you don't provide an engine, the standard engine is selected by default. If a chosen voice isn't supported by the standard engine, this will result in an error. For information on Amazon Polly voices and which voices are available for each engine, see [Available Voices](https://docs.aws.amazon.com/polly/latest/dg/voicelist.html).
  115         -
         *
  116         -
         * Type: String
  117         -
         *
  118         -
         * Valid Values: `standard` | `neural` | `long-form` | `generative`
  119         -
         *
  120         -
         * Required: Yes
  121    109   
         */
  122    110   
        public var engine: aws.sdk.kotlin.services.polly.model.Engine? = null
  123    111   
        /**
  124    112   
         * Optional language code for the Synthesize Speech request. This is only necessary if using a bilingual voice, such as Aditi, which can be used for either Indian English (en-IN) or Hindi (hi-IN).
  125    113   
         *
  126    114   
         * If a bilingual voice is used and no language code is specified, Amazon Polly uses the default language of the bilingual voice. The default language for any voice is the one returned by the [DescribeVoices](https://docs.aws.amazon.com/polly/latest/dg/API_DescribeVoices.html) operation for the `LanguageCode` parameter. For example, if no language code is specified, Aditi will use Indian English rather than Hindi.
  127    115   
         */
  128    116   
        public var languageCode: aws.sdk.kotlin.services.polly.model.LanguageCode? = null
  129    117   
        /**
  130    118   
         * List of one or more pronunciation lexicon names you want the service to apply during synthesis. Lexicons are applied only if the language of the lexicon is the same as the language of the voice. For information about storing lexicons, see [PutLexicon](https://docs.aws.amazon.com/polly/latest/dg/API_PutLexicon.html).
  131    119   
         */
  132    120   
        public var lexiconNames: List<String>? = null
  133    121   
        /**
  134    122   
         * The format in which the returned output will be encoded. For audio stream, this will be mp3, ogg_vorbis, or pcm. For speech marks, this will be json.
  135    123   
         *
  136    124   
         * When pcm is used, the content returned is audio/pcm in a signed 16-bit, 1 channel (mono), little-endian format.
  137    125   
         */
  138    126   
        public var outputFormat: aws.sdk.kotlin.services.polly.model.OutputFormat? = null
  139    127   
        /**
  140    128   
         * The audio frequency specified in Hz.
  141    129   
         *
  142         -
         * The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", and "24000". The default value for standard voices is "22050". The default value for neural voices is "24000". The default value for long-form voices is "24000". The default value for generative voices is "24000".
         130  +
         * The valid values for mp3 and ogg_vorbis are "8000", "16000", "22050", "24000", "44100" and "48000". The default value for standard voices is "22050". The default value for neural voices is "24000". The default value for long-form voices is "24000". The default value for generative voices is "24000".
  143    131   
         *
  144    132   
         * Valid values for pcm are "8000" and "16000" The default value is "16000".
  145    133   
         */
  146    134   
        public var sampleRate: kotlin.String? = null
  147    135   
        /**
  148    136   
         * The type of speech marks returned for the input text.
  149    137   
         */
  150    138   
        public var speechMarkTypes: List<SpeechMarkType>? = null
  151    139   
        /**
  152    140   
         * Input text to synthesize. If you specify `ssml` as the `TextType`, follow the SSML format for the input text.

tmp-codegen-diff/services/polly/generated-src/test/kotlin/aws/sdk/kotlin/services/polly/endpoints/DefaultEndpointProviderTest.kt

@@ -535,535 +753,697 @@
  555    555   
            useFips = false
  556    556   
            useDualStack = false
  557    557   
        }
  558    558   
        val expected = Endpoint(
  559    559   
            uri = Url.parse("https://polly.us-gov-east-1.amazonaws.com"),
  560    560   
        )
  561    561   
        val actual = DefaultPollyEndpointProvider().resolveEndpoint(params)
  562    562   
        expectEqualEndpoints(expected, actual)
  563    563   
    }
  564    564   
  565         -
    // For region us-iso-east-1 with FIPS enabled and DualStack enabled
  566         -
    @Test
  567         -
    fun test36() = runTest {
  568         -
        val params = PollyEndpointParameters {
  569         -
            region = "us-iso-east-1"
  570         -
            useFips = true
  571         -
            useDualStack = true
  572         -
        }
  573         -
        val ex = assertFailsWith<EndpointProviderException> {
  574         -
            DefaultPollyEndpointProvider().resolveEndpoint(params)
  575         -
        }
  576         -
        assertEquals("FIPS and DualStack are enabled, but this partition does not support one or both", ex.message)
  577         -
    }
  578         -
  579    565   
    // For region us-iso-east-1 with FIPS enabled and DualStack disabled
  580    566   
    @Test
  581         -
    fun test37() = runTest {
         567  +
    fun test36() = runTest {
  582    568   
        val params = PollyEndpointParameters {
  583    569   
            region = "us-iso-east-1"
  584    570   
            useFips = true
  585    571   
            useDualStack = false
  586    572   
        }
  587    573   
        val expected = Endpoint(
  588    574   
            uri = Url.parse("https://polly-fips.us-iso-east-1.c2s.ic.gov"),
  589    575   
        )
  590    576   
        val actual = DefaultPollyEndpointProvider().resolveEndpoint(params)
  591    577   
        expectEqualEndpoints(expected, actual)
  592    578   
    }
  593    579   
  594         -
    // For region us-iso-east-1 with FIPS disabled and DualStack enabled
  595         -
    @Test
  596         -
    fun test38() = runTest {
  597         -
        val params = PollyEndpointParameters {
  598         -
            region = "us-iso-east-1"
  599         -
            useFips = false
  600         -
            useDualStack = true
  601         -
        }
  602         -
        val ex = assertFailsWith<EndpointProviderException> {
  603         -
            DefaultPollyEndpointProvider().resolveEndpoint(params)
  604         -
        }
  605         -
        assertEquals("DualStack is enabled but this partition does not support DualStack", ex.message)
  606         -
    }
  607         -
  608    580   
    // For region us-iso-east-1 with FIPS disabled and DualStack disabled
  609    581   
    @Test
  610         -
    fun test39() = runTest {
         582  +
    fun test37() = runTest {
  611    583   
        val params = PollyEndpointParameters {
  612    584   
            region = "us-iso-east-1"
  613    585   
            useFips = false
  614    586   
            useDualStack = false
  615    587   
        }
  616    588   
        val expected = Endpoint(
  617    589   
            uri = Url.parse("https://polly.us-iso-east-1.c2s.ic.gov"),
  618    590   
        )
  619    591   
        val actual = DefaultPollyEndpointProvider().resolveEndpoint(params)
  620    592   
        expectEqualEndpoints(expected, actual)
  621    593   
    }
  622    594   
  623         -
    // For region us-isob-east-1 with FIPS enabled and DualStack enabled
  624         -
    @Test
  625         -
    fun test40() = runTest {
  626         -
        val params = PollyEndpointParameters {
  627         -
            region = "us-isob-east-1"
  628         -
            useFips = true
  629         -
            useDualStack = true
  630         -
        }
  631         -
        val ex = assertFailsWith<EndpointProviderException> {
  632         -
            DefaultPollyEndpointProvider().resolveEndpoint(params)
  633         -
        }
  634         -
        assertEquals("FIPS and DualStack are enabled, but this partition does not support one or both", ex.message)
  635         -
    }
  636         -
  637    595   
    // For region us-isob-east-1 with FIPS enabled and DualStack disabled
  638    596   
    @Test
  639         -
    fun test41() = runTest {
         597  +
    fun test38() = runTest {
  640    598   
        val params = PollyEndpointParameters {
  641    599   
            region = "us-isob-east-1"
  642    600   
            useFips = true
  643    601   
            useDualStack = false
  644    602   
        }
  645    603   
        val expected = Endpoint(
  646    604   
            uri = Url.parse("https://polly-fips.us-isob-east-1.sc2s.sgov.gov"),
  647    605   
        )
  648    606   
        val actual = DefaultPollyEndpointProvider().resolveEndpoint(params)
  649    607   
        expectEqualEndpoints(expected, actual)
  650    608   
    }
  651    609   
  652         -
    // For region us-isob-east-1 with FIPS disabled and DualStack enabled
  653         -
    @Test
  654         -
    fun test42() = runTest {
  655         -
        val params = PollyEndpointParameters {
  656         -
            region = "us-isob-east-1"
  657         -
            useFips = false
  658         -
            useDualStack = true
  659         -
        }
  660         -
        val ex = assertFailsWith<EndpointProviderException> {
  661         -
            DefaultPollyEndpointProvider().resolveEndpoint(params)
  662         -
        }
  663         -
        assertEquals("DualStack is enabled but this partition does not support DualStack", ex.message)
  664         -
    }
  665         -
  666    610   
    // For region us-isob-east-1 with FIPS disabled and DualStack disabled
  667    611   
    @Test
  668         -
    fun test43() = runTest {
         612  +
    fun test39() = runTest {
  669    613   
        val params = PollyEndpointParameters {
  670    614   
            region = "us-isob-east-1"
  671    615   
            useFips = false
  672    616   
            useDualStack = false
  673    617   
        }
  674    618   
        val expected = Endpoint(
  675    619   
            uri = Url.parse("https://polly.us-isob-east-1.sc2s.sgov.gov"),
  676    620   
        )
  677    621   
        val actual = DefaultPollyEndpointProvider().resolveEndpoint(params)
  678    622   
        expectEqualEndpoints(expected, actual)
  679    623   
    }
  680    624   
  681    625   
    // For custom endpoint with region set and fips disabled and dualstack disabled
  682    626   
    @Test
  683         -
    fun test44() = runTest {
         627  +
    fun test40() = runTest {
  684    628   
        val params = PollyEndpointParameters {
  685    629   
            region = "us-east-1"
  686    630   
            useFips = false
  687    631   
            useDualStack = false
  688    632   
            endpoint = "https://example.com"
  689    633   
        }
  690    634   
        val expected = Endpoint(
  691    635   
            uri = Url.parse("https://example.com"),
  692    636   
        )
  693    637   
        val actual = DefaultPollyEndpointProvider().resolveEndpoint(params)
  694    638   
        expectEqualEndpoints(expected, actual)
  695    639   
    }
  696    640   
  697    641   
    // For custom endpoint with region not set and fips disabled and dualstack disabled
  698    642   
    @Test
  699         -
    fun test45() = runTest {
         643  +
    fun test41() = runTest {
  700    644   
        val params = PollyEndpointParameters {
  701    645   
            useFips = false
  702    646   
            useDualStack = false
  703    647   
            endpoint = "https://example.com"
  704    648   
        }
  705    649   
        val expected = Endpoint(
  706    650   
            uri = Url.parse("https://example.com"),
  707    651   
        )
  708    652   
        val actual = DefaultPollyEndpointProvider().resolveEndpoint(params)
  709    653   
        expectEqualEndpoints(expected, actual)
  710    654   
    }
  711    655   
  712    656   
    // For custom endpoint with fips enabled and dualstack disabled
  713    657   
    @Test
  714         -
    fun test46() = runTest {
         658  +
    fun test42() = runTest {
  715    659   
        val params = PollyEndpointParameters {
  716    660   
            region = "us-east-1"
  717    661   
            useFips = true
  718    662   
            useDualStack = false
  719    663   
            endpoint = "https://example.com"
  720    664   
        }
  721    665   
        val ex = assertFailsWith<EndpointProviderException> {
  722    666   
            DefaultPollyEndpointProvider().resolveEndpoint(params)
  723    667   
        }
  724    668   
        assertEquals("Invalid Configuration: FIPS and custom endpoint are not supported", ex.message)
  725    669   
    }
  726    670   
  727    671   
    // For custom endpoint with fips disabled and dualstack enabled
  728    672   
    @Test
  729         -
    fun test47() = runTest {
         673  +
    fun test43() = runTest {
  730    674   
        val params = PollyEndpointParameters {
  731    675   
            region = "us-east-1"
  732    676   
            useFips = false
  733    677   
            useDualStack = true
  734    678   
            endpoint = "https://example.com"
  735    679   
        }
  736    680   
        val ex = assertFailsWith<EndpointProviderException> {
  737    681   
            DefaultPollyEndpointProvider().resolveEndpoint(params)
  738    682   
        }
  739    683   
        assertEquals("Invalid Configuration: Dualstack and custom endpoint are not supported", ex.message)
  740    684   
    }
  741    685   
  742    686   
    // Missing region
  743    687   
    @Test
  744         -
    fun test48() = runTest {
         688  +
    fun test44() = runTest {
  745    689   
        val params = PollyEndpointParameters {
  746    690   
        }
  747    691   
        val ex = assertFailsWith<EndpointProviderException> {
  748    692   
            DefaultPollyEndpointProvider().resolveEndpoint(params)
  749    693   
        }
  750    694   
        assertEquals("Invalid Configuration: Missing Region", ex.message)
  751    695   
    }
  752    696   
  753    697   
}

tmp-codegen-diff/services/route53/e2eTest/src/Route53UriTest.kt

@@ -0,1 +30,35 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
    1      6   
package aws.sdk.kotlin.services.route53
    2      7   
    3      8   
import aws.sdk.kotlin.runtime.auth.credentials.StaticCredentialsProvider
    4      9   
import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials
    5     10   
import aws.smithy.kotlin.runtime.client.ProtocolRequestInterceptorContext
    6     11   
import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor
    7     12   
import aws.smithy.kotlin.runtime.http.request.HttpRequest
    8     13   
import aws.smithy.kotlin.runtime.httptest.TestEngine
    9     14   
import kotlinx.coroutines.test.runTest
   10     15   
import kotlin.test.Test

tmp-codegen-diff/services/s3/e2eTest/src/S3ChecksumTest.kt

@@ -0,1 +30,35 @@
           1  +
/*
           2  +
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
           3  +
 * SPDX-License-Identifier: Apache-2.0
           4  +
 */
           5  +
    1      6   
package aws.sdk.kotlin.e2etest
    2      7   
    3      8   
import aws.sdk.kotlin.e2etest.S3TestUtils.deleteBucketContents
    4      9   
import aws.sdk.kotlin.e2etest.S3TestUtils.deleteMultiPartUploads
    5     10   
import aws.sdk.kotlin.e2etest.S3TestUtils.getAccountId
    6     11   
import aws.sdk.kotlin.e2etest.S3TestUtils.getTestBucket
    7     12   
import aws.sdk.kotlin.e2etest.S3TestUtils.responseCodeFromPut
    8     13   
import aws.sdk.kotlin.services.s3.*
    9     14   
import aws.sdk.kotlin.services.s3.model.*
   10     15   
import aws.sdk.kotlin.services.s3.presigners.presignPutObject

tmp-codegen-diff/services/s3/e2eTest/src/S3IntegrationTest.kt

@@ -217,217 +330,276 @@
  237    237   
                key = objKey
  238    238   
            }
  239    239   
            val actualSha256 = s3.getObject(getRequest) { resp ->
  240    240   
                resp.body!!.toByteArray().sha256().encodeToHex()
  241    241   
            }
  242    242   
  243    243   
            assertEquals(expectedSha256, actualSha256)
  244    244   
        }
  245    245   
    }
  246    246   
  247         -
    @Test
  248         -
    fun testSelectObjectEventStream(): Unit = runBlocking {
  249         -
        // upload our content to select from
  250         -
        val objKey = "developers.csv"
  251         -
  252         -
        val content = """
  253         -
        Name,PhoneNumber,City,Occupation
  254         -
        Sam,(949) 555-6701,Irvine,Solutions Architect
  255         -
        Vinod,(949) 555-6702,Los Angeles,Solutions Architect
  256         -
        Jeff,(949) 555-6703,Seattle,AWS Evangelist
  257         -
        Jane,(949) 555-6704,Chicago,Developer
  258         -
        Sean,(949) 555-6705,Indianapolis,Developer
  259         -
        Mary,(949) 555-6706,Detroit,Developer
  260         -
        Kate,(949) 555-6707,Boston,Solutions Architect
  261         -
        """.trimIndent()
  262         -
  263         -
        client.putObject {
  264         -
            bucket = testBucket
  265         -
            key = objKey
  266         -
            body = ByteStream.fromString(content)
  267         -
        }
  268         -
  269         -
        // select content as an event stream
  270         -
        val req = SelectObjectContentRequest {
  271         -
            bucket = testBucket
  272         -
            key = objKey
  273         -
            expressionType = ExpressionType.Sql
  274         -
            expression = """SELECT * FROM s3object s where s."Name" = 'Jane'"""
  275         -
            inputSerialization {
  276         -
                csv {
  277         -
                    fileHeaderInfo = FileHeaderInfo.Use
  278         -
                }
  279         -
                compressionType = CompressionType.None
  280         -
            }
  281         -
            outputSerialization {
  282         -
                csv { }
  283         -
            }
  284         -
        }
  285         -
  286         -
        val events = client.selectObjectContent(req) { resp ->
  287         -
            // collect flow to list
  288         -
            resp.payload!!.toList()
  289         -
        }
  290         -
  291         -
        assertEquals(3, events.size)
  292         -
  293         -
        val records = assertIs<SelectObjectContentEventStream.Records>(events[0])
  294         -
        assertIs<SelectObjectContentEventStream.Stats>(events[1])
  295         -
        assertIs<SelectObjectContentEventStream.End>(events[2])
  296         -
  297         -
        val expectedRecord = "Jane,(949) 555-6704,Chicago,Developer\n"
  298         -
        assertEquals(expectedRecord, records.value.payload?.decodeToString())
  299         -
    }
  300         -
  301    247   
    @Test
  302    248   
    fun testPutObjectWithChecksum(): Unit = runBlocking {
  303    249   
        val contents = "AAAAAAAAAA"
  304    250   
        val keyName = "put-obj-with-checksum.txt"
  305    251   
  306    252   
        val resp = client.putObject {
  307    253   
            bucket = testBucket
  308    254   
            key = keyName
  309    255   
            body = ByteStream.fromString(contents)
  310    256   
            checksumAlgorithm = ChecksumAlgorithm.Sha256