Skip to content

Commit b298270

Browse files
committed
Checkpoint
1 parent e7ac93f commit b298270

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

codegen/smithy-kotlin-codegen/src/main/kotlin/software/amazon/smithy/kotlin/codegen/rendering/smoketests/SmokeTestsRunnerGenerator.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package software.amazon.smithy.kotlin.codegen.rendering.smoketests
22

33
import software.amazon.smithy.codegen.core.Symbol
4+
import software.amazon.smithy.codegen.core.SymbolProvider
45
import software.amazon.smithy.kotlin.codegen.core.*
56
import software.amazon.smithy.kotlin.codegen.integration.SectionId
67
import software.amazon.smithy.kotlin.codegen.integration.SectionKey
@@ -11,6 +12,7 @@ import software.amazon.smithy.kotlin.codegen.rendering.endpoints.EndpointProvide
1112
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.Param.ParamName
1213
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.Param.ParamShape
1314
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.Param.Parameter
15+
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.Param.SymbolProvider
1416
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestUriValue.EndpointParameters
1517
import software.amazon.smithy.kotlin.codegen.rendering.smoketests.SmokeTestUriValue.EndpointProvider
1618
import software.amazon.smithy.kotlin.codegen.rendering.util.format
@@ -50,6 +52,7 @@ object Param : SectionId {
5052
val ParamShape: SectionKey<Shape?> = SectionKey("SmokeTestsOperationParamKey2") // TODO: Rename section keys
5153
val Parameter: SectionKey<Node> = SectionKey("SmokeTestsOperationParamKey3")
5254
val ParamName: SectionKey<String> = SectionKey("SmokeTestsOperationParamKey4")
55+
val SymbolProvider: SectionKey<SymbolProvider> = SectionKey("SmokeTestsOperationParamKey5")
5356
}
5457

5558
const val SKIP_TAGS = "AWS_SMOKE_TEST_SKIP_TAGS"
@@ -242,13 +245,15 @@ class SmokeTestsRunnerGenerator(
242245
val name = param.key.value.toCamelCase()
243246
val value = param.value.format()
244247

245-
writer.writeInline("#S = ", name)
246-
writer.declareSection(
248+
writer.writeInline("#L = ", name)
249+
250+
writer.declareSection( // TODO: Finish this
247251
Param,
248252
mapOf(
249253
ParamName to name,
250254
ParamShape to paramsToShapes[name],
251255
Parameter to param.value,
256+
SymbolProvider to symbolProvider,
252257
),
253258
) {
254259
writer.write("#L", value )
@@ -306,7 +311,7 @@ class SmokeTestsRunnerGenerator(
306311
}
307312

308313
/**
309-
* TODO:
314+
* Maps an operations parameters to their shapes
310315
*/
311316
private fun mapOperationParametersToModeledShapes(operation: OperationShape): Map<String, Shape> =
312317
model.getShape(operation.inputShape).get().allMembers.map { (key, value) ->
@@ -319,15 +324,9 @@ class SmokeTestsRunnerGenerator(
319324
private val SmokeTestCase.functionName: String
320325
get() = this.id.toCamelCase()
321326

322-
/**
323-
* TODO:
324-
*/
325327
private val SmokeTestCase.operationParameters: Map<StringNode, Node>
326328
get() = this.params.get().members
327329

328-
/**
329-
* TODO:
330-
*/
331330
private val SmokeTestCase.operationParametersArePresent: Boolean
332331
get() = this.params.isPresent
333332
}

0 commit comments

Comments
 (0)