private TranscriptionJob retrieveObjectWhenJobCompleted(String jobName) {
        GetTranscriptionJobRequest transcriptionJobRequest = GetTranscriptionJobRequest.builder().transcriptionJobName(jobName).build();
        while (true) {
            CompletableFuture<GetTranscriptionJobResponse> transcriptionJob = amazonTranscribeAsync.getTranscriptionJob(transcriptionJobRequest);
            GetTranscriptionJobResponse transcriptionJobResponse = transcriptionJob.join();
            TranscriptionJobStatus status = transcriptionJobResponse.transcriptionJob().transcriptionJobStatus();
            if (TranscriptionJobStatus.COMPLETED.equals(status) ||
                    TranscriptionJobStatus.FAILED.equals(status)) {
                return transcriptionJobResponse.transcriptionJob();
            }
            try
            {
                Thread.sleep(1000);
            }
            catch (InterruptedException ex)
            {
                LOG.warn("interrupted");
            }
        }
    }
Private helper function to get object from s3.

@param jobName The unique job name for each job(UUID).
@return TranscriptionJob object
tika-parsers/tika-parsers-ml/tika-transcribe-aws/src/main/java/org/apache/tika/parser/transcribe/aws/AmazonTranscribe.java