Skip to content

Commit 16162f6

Browse files
pranav-firakePranav Firake
andauthored
fix: bug fix for exportResultsArchive to call with profileArn as parameter (#1300)
* fix: for exportResultsArchive to call with profileArn --------- Co-authored-by: Pranav Firake <[email protected]>
1 parent 6568811 commit 16162f6

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

server/aws-lsp-codewhisperer/src/language-server/netTransform/transformHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ export class TransformHandler {
379379
async downloadExportResultArchive(exportId: string, saveToDir: string) {
380380
let result
381381
try {
382-
result = await this.serviceManager.getStreamingClient().client.exportResultArchive({
382+
result = await this.serviceManager.getStreamingClient().exportResultArchive({
383383
exportId,
384384
exportIntent: ExportIntent.TRANSFORMATION,
385385
})

server/aws-lsp-codewhisperer/src/shared/streamingClientService.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import {
44
GenerateAssistantResponseCommandOutput as GenerateAssistantResponseCommandOutputCodeWhispererStreaming,
55
SendMessageCommandInput as SendMessageCommandInputCodeWhispererStreaming,
66
SendMessageCommandOutput as SendMessageCommandOutputCodeWhispererStreaming,
7+
ExportResultArchiveCommandInput as ExportResultArchiveCommandInputCodeWhispererStreaming,
8+
ExportResultArchiveCommandOutput as ExportResultArchiveCommandOutputCodeWhispererStreaming,
79
} from '@amzn/codewhisperer-streaming'
810
import {
911
QDeveloperStreaming,
@@ -122,6 +124,19 @@ export class StreamingClientServiceToken extends StreamingClientServiceBase {
122124

123125
return response
124126
}
127+
128+
public async exportResultArchive(
129+
request: ExportResultArchiveCommandInputCodeWhispererStreaming,
130+
abortController?: AbortController
131+
): Promise<ExportResultArchiveCommandOutputCodeWhispererStreaming> {
132+
const controller: AbortController = abortController ?? new AbortController()
133+
this.inflightRequests.add(controller)
134+
const response = await this.client.exportResultArchive(
135+
this.profileArn ? { ...request, profileArn: this.profileArn } : request
136+
)
137+
this.inflightRequests.delete(controller)
138+
return response
139+
}
125140
}
126141

127142
export class StreamingClientServiceIAM extends StreamingClientServiceBase {

0 commit comments

Comments
 (0)