public async static void GetTextFromS3(IAmazonTextract textractClient, string bucketName, string keyName) { List <Block> result = null; DetectDocumentTextRequest detectTextRequest = new DetectDocumentTextRequest() { Document = new Document { S3Object = new S3Object { Bucket = bucketName, Name = keyName } } }; try { Task <DetectDocumentTextResponse> detectTask = textractClient.DetectDocumentTextAsync(detectTextRequest); DetectDocumentTextResponse detectTextResponse = await detectTask; result = detectTextResponse.Blocks; //PrintBlockDetails(result); } catch (AmazonTextractException textractException) { Console.WriteLine(textractException.Message, textractException.InnerException); } }
public async Task <List <Block> > GetTextFromStream(IAmazonTextract textractClient, MemoryStream stream) { List <Block> result = null; DetectDocumentTextRequest detectTextRequest = new DetectDocumentTextRequest() { Document = new Document { Bytes = stream } }; try { Task <DetectDocumentTextResponse> detectTask = textractClient.DetectDocumentTextAsync(detectTextRequest); DetectDocumentTextResponse detectTextResponse = await detectTask; result = detectTextResponse.Blocks; //PrintBlockDetails(result); } catch (AmazonTextractException textractException) { Console.WriteLine(textractException.Message, textractException.InnerException); } return(result); }
public StagesController(DataContext context, IAmazonS3 s3Client, IAmazonRekognition rekognitionClient, IAmazonTextract textractClient) { _context = context; this.S3Client = s3Client; this.RekognitionClient = rekognitionClient; this.TextractClient = textractClient; }
public TestController(DataContext context, IAmazonS3 s3Client, IAmazonRekognition rekognitionClient, IAmazonTextract textractClient, IAmazonPolly pollyClient, IAmazonTranscribeService transcribeClient) { _context = context; this.S3Client = s3Client; this.RekognitionClient = rekognitionClient; this.TextractClient = textractClient; this.PollyClient = pollyClient; this.TranscribeClient = transcribeClient; }
public AwsManagers(AwsConfig config) { var options = new AWSOptions { Credentials = new BasicAWSCredentials(config.AccessKey, config.SecretKey), Region = RegionEndpoint.GetBySystemName(config.Region) }; s3Client = options.CreateServiceClient <IAmazonS3>(); sqsCLient = options.CreateServiceClient <IAmazonSQS>(); textractClient = options.CreateServiceClient <IAmazonTextract>(); dbClient = new AmazonDynamoDBClient(config.AccessKey, config.SecretKey, RegionEndpoint.GetBySystemName(config.Region)); bucketName = config.Bucket; queueUrl = config.Queue; tableName = config.Table; }
private Amazon.Textract.Model.AnalyzeIDResponse CallAWSServiceOperation(IAmazonTextract client, Amazon.Textract.Model.AnalyzeIDRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Textract", "AnalyzeID"); try { #if DESKTOP return(client.AnalyzeID(request)); #elif CORECLR return(client.AnalyzeIDAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
protected override void ProcessRecord() { base.ProcessRecord(); Client = CreateClient(_CurrentCredentials, _RegionEndpoint); }
public TextractTextAnalysisService(IAmazonTextract textract) { this.textract = textract; }
public TextractTextDetectionService(IAmazonTextract textract) { this.textract = textract; }
public AWSTextractService(IAmazonTextract amazonTextract) { this.amazonTextract = amazonTextract; }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _textractClient = new AmazonTextractClient(); _roleArn = config.ReadText("StartTextractAnalysisCompleteSnsRole"); _topicArn = config.ReadText("StartTextractAnalysisCompleteSns"); }
//--- Methods --- public override async Task InitializeAsync(LambdaConfig config) { _textractClient = new AmazonTextractClient(); _s3Client = new AmazonS3Client(); _bucketName = AwsConverters.ConvertBucketArnToName(config.ReadText("FileBucket")); }
public DocumentService(IAmazonTextract textract) { _textract = textract; }