Skip to content

Commit

Permalink
Add job id as response
Browse files Browse the repository at this point in the history
  • Loading branch information
atir-naveed-geeksltd committed May 30, 2023
1 parent 0ea62f7 commit 85306b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Olive.Aws.Textract/AmazonTextract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public static async Task<TextDetectionTextResults> GetJobResultText(string jobId
/// Starts the text extraction job based on the location in the s3 bucket configured AWS:Textract:S3Bucket.
/// Gives back the job id that you can use with GetJobResultBlocks() or GetJobResultText() to get the results of a job.
/// </summary>
public static Task<StartDocumentAnalysisResponse> StartAnalyzeDocument(string documentKey, string prefix)
public static Task<string> StartAnalyzeDocument(string documentKey, string prefix)
{
if (BucketName == null)
{
Expand All @@ -241,7 +241,7 @@ public static Task<StartDocumentAnalysisResponse> StartAnalyzeDocument(string do
/// Starts the text extraction job.
/// Gives back the job id that you can use with GetJobResults() to get the results of a job.
/// </summary>
public static Task<StartDocumentAnalysisResponse> StartAnalyzeDocument(string documentKey, string bucketName, string prefix, List<string> featureTypes)
public static async Task<string> StartAnalyzeDocument(string documentKey, string bucketName, string prefix, List<string> featureTypes)
{
var outputBucket = OutputBucketName.HasValue() ? OutputBucketName : bucketName;
var detectTextRequest = new StartDocumentAnalysisRequest()
Expand All @@ -265,7 +265,8 @@ public static Task<StartDocumentAnalysisResponse> StartAnalyzeDocument(string do
};
try
{
return Client.StartDocumentAnalysisAsync(detectTextRequest);
var detectTextResponse = await Client.StartDocumentAnalysisAsync(detectTextRequest);
return detectTextResponse.JobId;
}
catch (Exception e)
{
Expand Down
2 changes: 1 addition & 1 deletion Olive.Aws.Textract/Olive.Aws.Textract.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>1.0.8</Version>
<Version>1.0.9</Version>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 85306b3

Please sign in to comment.