Skip to content

Commit 893562b

Browse files
enkr1onno-vos-dev
authored andcommitted
📝 [doc] Added example for s3 textract
1 parent dd8bf8c commit 893562b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

lib/aws/generated/textract.ex

+27
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,34 @@ defmodule AWS.Textract do
7171
`AnalyzeDocument` is a synchronous operation. To analyze documents
7272
asynchronously, use `StartDocumentAnalysis`.
7373
74+
## Examples
75+
case AWS.Client.create("ACCESS_KEY", "SECRET_KEY", "REGION")
76+
|> AWS.Textract.analyze_document(%{
77+
"Document" => %{
78+
"Bytes" =>
79+
"/folder/file"
80+
|> File.read!()
81+
|> Base.encode64()
82+
},
83+
"FeatureTypes" => ["TABLES"]
84+
}) do
85+
{
86+
:ok,
87+
%{
88+
"AnalyzeDocumentModelVersion" => _,
89+
"Blocks" => blocks,
90+
"DocumentMetadata" => _
91+
} = _results,
92+
_response
93+
} ->
94+
# Process the results
95+
96+
error -> error
97+
end
98+
99+
74100
For more information, see [Document Text Analysis](https://docs.aws.amazon.com/textract/latest/dg/how-it-works-analyzing.html).
101+
75102
"""
76103
def analyze_document(%Client{} = client, input, options \\ []) do
77104
meta = metadata()

0 commit comments

Comments
 (0)