@@ -48,7 +48,6 @@ import software.aws.toolkits.jetbrains.services.amazonq.SERVER_SIDE_ENCRYPTION_A
4848import software.aws.toolkits.jetbrains.services.amazonq.clients.AmazonQStreamingClient
4949import software.aws.toolkits.jetbrains.services.codemodernizer.model.JobId
5050import software.aws.toolkits.jetbrains.services.codemodernizer.utils.calculateTotalLatency
51- import software.aws.toolkits.telemetry.CodeTransformApiNames
5251import java.io.File
5352import java.net.HttpURLConnection
5453import 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