in src/main/kotlin/com/jetbrains/notary/NotaryClientV2.kt [140:161]
suspend fun getSubmissionLog(submissionId: String): Logs {
val response = httpClient.get("$baseUrl/notary/v2/submissions/$submissionId/logs") {
withAppleAuthentication(credentials)
accept(ContentType.Application.Json)
expectSuccess = true
}
val body = response.body<SubmissionLogURLResponse>()
val url = body.data?.attributes?.developerLogUrl
?: error("developerLogUrl is missing from response attribute")
val logReponse = httpClient.get(url) {
expectSuccess = true
}
// We consume the response as text other we are getting
// ```
// io.ktor.client.call.NoTransformationFoundException: No transformation found:
// class io.ktor.utils.io.ByteBufferChannel (Kotlin reflection is not available)
// -> class com.jetbrains.notary.models.Logs (Kotlin reflection is not available)
// ```
// Probably due to an invalid response Content-Type.
val logs = logReponse.bodyAsText()
return notaryClientJson.decodeFromString(logs)
}