in codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/PresignerGenerator.kt [32:50]
override fun writeAdditionalFiles(ctx: CodegenContext, delegator: SwiftDelegator) {
val service = ctx.model.expectShape<ServiceShape>(ctx.settings.service)
if (!AWSSigningMiddleware.isSupportedAuthentication(ctx.model, service)) return
val presignOperations = service.allOperations
.map { ctx.model.expectShape<OperationShape>(it) }
.filter { operationShape -> operationShape.hasTrait(Presignable.ID) }
.map { operationShape ->
check(AWSSigningMiddleware.hasSigV4AuthScheme(ctx.model, service, operationShape)) { "Operation does not have valid auth trait" }
PresignableOperation(service.id.toString(), operationShape.id.toString())
}
presignOperations.forEach { presignableOperation ->
val op = ctx.model.expectShape<OperationShape>(presignableOperation.operationId)
val inputType = op.input.get().getName()
delegator.useFileWriter("${ctx.settings.moduleName}/models/$inputType+Presigner.swift") { writer ->
renderPresigner(writer, ctx, delegator, op, inputType)
}
}
}