in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/customization/glacier/GlacierAcccountIdDefault.kt [24:37]
override fun customizeMiddleware(
ctx: ProtocolGenerator.GenerationContext,
operationShape: OperationShape,
operationMiddleware: OperationMiddleware
) {
val input = operationShape.input.getOrNull()?.let { ctx.model.expectShape<StructureShape>(it) }
val needsAccountIdMiddleware = input?.memberNames?.any { it.lowercase() == "accountid" } ?: false
if (needsAccountIdMiddleware) {
operationMiddleware.prependMiddleware(
operationShape,
GlacierAccountIdMiddleware(ctx.model, ctx.symbolProvider)
)
}
}