Skip to content

Commit b15f49e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cwspr-inline-lang
2 parents 0b8404b + bbbe5ec commit b15f49e

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mockitoKotlin = "5.4.0"
2525
mockk = "1.13.10"
2626
nimbus-jose-jwt = "9.40"
2727
node-gradle = "7.0.2"
28-
telemetryGenerator = "1.0.258"
28+
telemetryGenerator = "1.0.259"
2929
testLogger = "4.0.0"
3030
testRetry = "1.5.10"
3131
# test-only; platform provides slf4j transitively at runtime

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/client/GumbyClient.kt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import software.aws.toolkits.jetbrains.services.amazonq.SERVER_SIDE_ENCRYPTION_A
4848
import software.aws.toolkits.jetbrains.services.amazonq.clients.AmazonQStreamingClient
4949
import software.aws.toolkits.jetbrains.services.codemodernizer.model.JobId
5050
import software.aws.toolkits.jetbrains.services.codemodernizer.utils.calculateTotalLatency
51-
import software.aws.toolkits.telemetry.CodeTransformApiNames
5251
import java.io.File
5352
import java.net.HttpURLConnection
5453
import java.time.Instant
@@ -69,7 +68,7 @@ class GumbyClient(private val project: Project) {
6968
.contentChecksum(sha256Checksum)
7069
.uploadIntent(UploadIntent.TRANSFORMATION)
7170
.build()
72-
return callApi({ bearerClient().createUploadUrl(request) }, apiName = CodeTransformApiNames.CreateUploadUrl)
71+
return callApi({ bearerClient().createUploadUrl(request) }, apiName = "CreateUploadUrl")
7372
}
7473

7574
fun createHilUploadUrl(sha256Checksum: String, jobId: JobId): CreateUploadUrlResponse {
@@ -90,12 +89,12 @@ class GumbyClient(private val project: Project) {
9089
.build()
9190
)
9291
.build()
93-
return callApi({ bearerClient().createUploadUrl(request) }, apiName = CodeTransformApiNames.CreateUploadUrl)
92+
return callApi({ bearerClient().createUploadUrl(request) }, apiName = "CreateUploadUrl")
9493
}
9594

9695
fun getCodeModernizationJob(jobId: String): GetTransformationResponse {
9796
val request = GetTransformationRequest.builder().transformationJobId(jobId).build()
98-
return callApi({ bearerClient().getTransformation(request) }, apiName = CodeTransformApiNames.GetTransformation)
97+
return callApi({ bearerClient().getTransformation(request) }, apiName = "GetTransformation")
9998
}
10099

101100
fun startCodeModernization(
@@ -114,7 +113,7 @@ class GumbyClient(private val project: Project) {
114113
.target { it.language(targetLanguage) }
115114
}
116115
.build()
117-
return callApi({ bearerClient().startTransformation(request) }, apiName = CodeTransformApiNames.StartTransformation)
116+
return callApi({ bearerClient().startTransformation(request) }, apiName = "StartTransformation")
118117
}
119118

120119
fun resumeCodeTransformation(
@@ -125,22 +124,22 @@ class GumbyClient(private val project: Project) {
125124
.transformationJobId(jobId.id)
126125
.userActionStatus(userActionStatus)
127126
.build()
128-
return callApi({ bearerClient().resumeTransformation(request) }, apiName = CodeTransformApiNames.ResumeTransformation)
127+
return callApi({ bearerClient().resumeTransformation(request) }, apiName = "ResumeTransformation")
129128
}
130129

131130
fun getCodeModernizationPlan(jobId: JobId): GetTransformationPlanResponse {
132131
val request = GetTransformationPlanRequest.builder().transformationJobId(jobId.id).build()
133-
return callApi({ bearerClient().getTransformationPlan(request) }, apiName = CodeTransformApiNames.GetTransformationPlan)
132+
return callApi({ bearerClient().getTransformationPlan(request) }, apiName = "GetTransformationPlan")
134133
}
135134

136135
fun stopTransformation(transformationJobId: String): StopTransformationResponse {
137136
val request = StopTransformationRequest.builder().transformationJobId(transformationJobId).build()
138-
return callApi({ bearerClient().stopTransformation(request) }, apiName = CodeTransformApiNames.StopTransformation)
137+
return callApi({ bearerClient().stopTransformation(request) }, apiName = "StopTransformation")
139138
}
140139

141140
private fun <T : CodeWhispererRuntimeResponse> callApi(
142141
apiCall: () -> T,
143-
apiName: CodeTransformApiNames,
142+
apiName: String,
144143
): T {
145144
var result: CodeWhispererRuntimeResponse? = null
146145
try {
@@ -174,10 +173,10 @@ class GumbyClient(private val project: Project) {
174173
.build()
175174
},
176175
{ e ->
177-
LOG.error(e) { "${CodeTransformApiNames.ExportResultArchive} failed: ${e.message}" }
176+
LOG.error(e) { "ExportResultArchive failed: ${e.message}" }
178177
},
179178
{ startTime ->
180-
LOG.info { "${CodeTransformApiNames.ExportResultArchive} latency: ${calculateTotalLatency(startTime, Instant.now())}" }
179+
LOG.info { "ExportResultArchive latency: ${calculateTotalLatency(startTime, Instant.now())}" }
181180
}
182181
)
183182

0 commit comments

Comments
 (0)