Defines the structure for content warehouse document proto.
JSON representation |
---|
{ "name" : string , "referenceId" : string , "displayName" : string , "title" : string , "displayUri" : string , "documentSchemaName" : string , "properties" : [ { object ( |
name
string
The resource name of the document. Format: projects/{projectNumber}/locations/{location}/documents/{documentId}.
The name is ignored when creating a document.
referenceId
string
The reference id set by customers. Must be unique per project and location.
displayName
string
Required. Display name of the document given by the user. This name will be displayed in the UI. Customer can populate this field with the name of the document. This differs from the 'title' field as 'title' is optional and stores the top heading in the document.
title
string
title that describes the document. This can be the top heading or text that describes the document.
displayUri
string
Uri to display the document, for example, in the UI.
documentSchemaName
string
The Document schema name. Format: projects/{projectNumber}/locations/{location}/documentSchemas/{document_schema_id}.
properties[]
object (
Property
)
List of values that are user supplied metadata.
updateTime
string (
Timestamp
format)
Output only. The time when the document is last updated.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z"
and "2014-10-02T15:01:23.045123456Z"
.
createTime
string (
Timestamp
format)
Output only. The time when the document is created.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z"
and "2014-10-02T15:01:23.045123456Z"
.
rawDocumentFileType
enum (
RawDocumentFileType
)
This is used when DocAI was not used to load the document and parsing/ extracting is needed for the inlineRawDocument. For example, if inlineRawDocument is the byte representation of a PDF file, then this should be set to: RAW_DOCUMENT_FILE_TYPE_PDF.
contentCategory
enum (
ContentCategory
)
Indicates the category (image, audio, video etc.) of the original content.
textExtractionDisabled
(deprecated)
boolean
If true, text extraction will not be performed.
textExtractionEnabled
boolean
If true, text extraction will be performed.
creator
string
The user who creates the document.
updater
string
The user who lastly updates the document.
dispositionTime
string (
Timestamp
format)
Output only. If linked to a Collection with RetentionPolicy, the date when the document becomes mutable.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z"
and "2014-10-02T15:01:23.045123456Z"
.
legalHold
boolean
Output only. Indicates if the document has a legal hold on it.
Union field structured_content
.
structured_content
can be only one of the following:
plainText
string
Other document format, such as PPTX, XLXS
cloudAiDocument
object (
Document
)
Document AI format to save the structured content, including OCR.
raw_document
. Raw document file. raw_document
can be only one of the following:rawDocumentPath
string
Raw document file in Cloud Storage path.
inlineRawDocument
Document
Document represents the canonical document resource in Document AI. It is an interchange format that provides insights into documents and allows for collaboration between users and Document AI to iterate and optimize for quality.
JSON representation |
---|
{ "mimeType" : string , "text" : string , "textStyles" : [ { object ( |
mimeType
string
An IANA published media type (MIME type) .
text
string
Optional. UTF-8 encoded text in reading order from the document.
textStyles[]
(deprecated)
object (
Style
)
Styles for the Document.text
.
entities[]
object (
Entity
)
A list of entities detected on Document.text
. For document shards, entities in this list may cross shard boundaries.
entityRelations[]
object (
EntityRelation
)
Placeholder. Relationship among Document.entities
.
textChanges[]
object (
TextChange
)
Placeholder. A list of text corrections made to Document.text
. This is usually used for annotating corrections to OCR mistakes. text changes for a given revision may not overlap with each other.
shardInfo
object (
ShardInfo
)
Information about the sharding if this document is sharded part of a larger document. If the document is not sharded, this message is not specified.
error
object (
Status
)
Any error that occurred while processing this document.
revisions[]
object (
Revision
)
Placeholder. Revision history of this document.
source
. Original source document from the user. source
can be only one of the following:uri
string
Optional. Currently supports Google Cloud Storage URI of the form gs://bucketName/objectName
. Object versioning is not supported. For more information, refer to Google Cloud Storage Request URIs
.
content
string ( bytes
format)
Optional. Inline document content, represented as a stream of bytes. note: As with all bytes
fields, protobuffers use a pure binary representation, whereas JSON representations use base64.
A base64-encoded string.
Style
Annotation for common text style attributes. This adheres to CSS conventions as much as possible.
JSON representation |
---|
{ "textAnchor" : { object ( |
Fields | |
---|---|
textAnchor
|
text anchor indexing into the |
color
|
text color. |
backgroundColor
|
text background color. |
fontWeight
|
Font weight
. Possible values are |
textStyle
|
text style
. Possible values are |
textDecoration
|
text decoration . Follows CSS standard. |
fontSize
|
Font size. |
fontFamily
|
Font family such as |
TextAnchor
text reference indexing into the Document.text
.
JSON representation |
---|
{
"textSegments"
:
[
{
object (
|
Fields | |
---|---|
textSegments[]
|
The text segments from the |
content
|
Contains the content of the text span so that users do not have to look it up in the textSegments. It is always populated for formFields. |
TextSegment
A text segment in the Document.text
. The indices may be out of bounds which indicate that the text extends into another document shard for large sharded documents. See ShardInfo.text_offset
JSON representation |
---|
{ "startIndex" : string , "endIndex" : string } |
Fields | |
---|---|
startIndex
|
|
endIndex
|
|
Color
Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to and from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of java.awt.Color
in Java; it can also be trivially provided to UIColor's +colorWithRed:green:blue:alpha
method in iOS; and, with just a little work, it can be easily formatted into a CSS rgba()
string in JavaScript.
This reference page doesn't have information about the absolute color space that should be used to interpret the RGB value—for example, sRGB, Adobe RGB, DCI-P3, and BT.2020. By default, applications should assume the sRGB color space.
When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5
.
Example (Java):
import com.google.type.Color;
// ...
public static java.awt.Color fromProto(color protocolor) {
float alpha = protocolor.hasAlpha()
? protocolor.getAlpha().getValue()
: 1.0;
return new java.awt.Color(
protocolor.getRed(),
protocolor.getGreen(),
protocolor.getBlue(),
alpha);
}
public static color toProto(java.awt.Color color) {
float red = (float) color.getRed();
float green = (float) color.getGreen();
float blue = (float) color.getBlue();
float denominator = 255.0;
color.Builder resultBuilder =
color
.newBuilder()
.setRed(red / denominator)
.setGreen(green / denominator)
.setBlue(blue / denominator);
int alpha = color.getAlpha();
if (alpha != 255) {
result.setAlpha(
FloatValue
.newBuilder()
.setValue(((float) alpha) / denominator)
.build());
}
return resultBuilder.build();
}
// ...
Example (iOS / Obj-C):
// ...
static UIColor* fromProto(color* protocolor) {
float red = [protocolor red];
float green = [protocolor green];
float blue = [protocolor blue];
FloatValue* alpha_wrapper = [protocolor alpha];
float alpha = 1.0;
if (alpha_wrapper != nil) {
alpha = [alpha_wrapper value];
}
return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
}
static color* toProto(UIColor* color) {
CGFloat red, green, blue, alpha;
if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) {
return nil;
}
color* result = [[color alloc] init];
[result setRed:red];
[result setGreen:green];
[result setBlue:blue];
if (alpha <= 0.9999) {
[result setAlpha:floatWrapperWithValue(alpha)];
}
[result autorelease];
return result;
}
// ...
Example (JavaScript):
// ...
var protoToCssColor = function(rgb_color) {
var redFrac = rgb_color.red || 0.0;
var greenFrac = rgb_color.green || 0.0;
var blueFrac = rgb_color.blue || 0.0;
var red = Math.floor(redFrac * 255);
var green = Math.floor(greenFrac * 255);
var blue = Math.floor(blueFrac * 255);
if (!('alpha' in rgb_color)) {
return rgbToCssColor(red, green, blue);
}
var alphaFrac = rgb_color.alpha.value || 0.0;
var rgbParams = [red, green, blue].join(',');
return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
};
var rgbToCssColor = function(red, green, blue) {
var rgbNumber = new number((red << 16) | (green << 8) | blue);
var hexString = rgbNumber.toString(16);
var missingZeros = 6 - hexString.length;
var resultBuilder = ['#'];
for (var i = 0; i < missingZeros; i++) {
resultBuilder.push('0');
}
resultBuilder.push(hexString);
return resultBuilder.join('');
};
// ...
JSON representation |
---|
{ "red" : number , "green" : number , "blue" : number , "alpha" : number } |
Fields | |
---|---|
red
|
The amount of red in the color as a value in the interval [0, 1]. |
green
|
The amount of green in the color as a value in the interval [0, 1]. |
blue
|
The amount of blue in the color as a value in the interval [0, 1]. |
alpha
|
The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0). |
FontSize
Font size with unit.
JSON representation |
---|
{ "size" : number , "unit" : string } |
Fields | |
---|---|
size
|
Font size for the text. |
unit
|
Unit for the font size. Follows CSS naming (such as |
Page
A page in a Document
.
JSON representation |
---|
{ "pageNumber" : integer , "image" : { object ( |
Fields | |
---|---|
pageNumber
|
1-based index for current |
image
|
Rendered image for this page. This image is preprocessed to remove any skew, rotation, and distortions such that the annotation bounding boxes can be upright and axis-aligned. |
transforms[]
|
Transformation matrices that were applied to the original document image to produce |
dimension
|
Physical dimension of the page. |
layout
|
|
detectedLanguages[]
|
A list of detected languages together with confidence. |
blocks[]
|
A list of visually detected text blocks on the page. A block has a set of lines (collected into paragraphs) that have a common line-spacing and orientation. |
paragraphs[]
|
A list of visually detected text paragraphs on the page. A collection of lines that a human would perceive as a paragraph. |
lines[]
|
A list of visually detected text lines on the page. A collection of tokens that a human would perceive as a line. |
tokens[]
|
A list of visually detected tokens on the page. |
visualElements[]
|
A list of detected non-text visual elements e.g. checkbox, signature etc. on the page. |
tables[]
|
A list of visually detected tables on the page. |
formFields[]
|
A list of visually detected form fields on the page. |
symbols[]
|
A list of visually detected symbols on the page. |
detectedBarcodes[]
|
A list of detected barcodes. |
imageQualityScores
|
Image quality scores. |
provenance
|
The history of this page. |
Image
Rendered image contents for this page.
JSON representation |
---|
{ "content" : string , "mimeType" : string , "width" : integer , "height" : integer } |
Fields | |
---|---|
content
|
Raw byte content of the image. A base64-encoded string. |
mimeType
|
encoding media type (MIME type) for the image. |
width
|
width of the image in pixels. |
height
|
height of the image in pixels. |
Matrix
representation for transformation matrix, intended to be compatible and used with OpenCV format for image manipulation.
JSON representation |
---|
{ "rows" : integer , "cols" : integer , "type" : integer , "data" : string } |
Fields | |
---|---|
rows
|
number of rows in the matrix. |
cols
|
number of columns in the matrix. |
type
|
This encodes information about what data type the matrix uses. For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list of OpenCV primitive data types, please refer to https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html |
data
|
The matrix data. A base64-encoded string. |
Dimension
Dimension for the page.
JSON representation |
---|
{ "width" : number , "height" : number , "unit" : string } |
Fields | |
---|---|
width
|
page width. |
height
|
page height. |
unit
|
Dimension unit. |
Layout
Visual element describing a layout unit on a page.
JSON representation |
---|
{ "textAnchor" : { object ( |
Fields | |
---|---|
textAnchor
|
text anchor indexing into the |
confidence
|
confidence of the current |
boundingPoly
|
The bounding polygon for the |
orientation
|
Detected orientation for the |
BoundingPoly
A bounding polygon for the detected image annotation.
JSON representation |
---|
{ "vertices" : [ { object ( |
Fields | |
---|---|
vertices[]
|
The bounding polygon vertices. |
normalizedVertices[]
|
The bounding polygon normalized vertices. |
Vertex
A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
JSON representation |
---|
{ "x" : integer , "y" : integer } |
Fields | |
---|---|
x
|
X coordinate. |
y
|
Y coordinate (starts from the top of the image). |
NormalizedVertex
A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
JSON representation |
---|
{ "x" : number , "y" : number } |
Fields | |
---|---|
x
|
X coordinate. |
y
|
Y coordinate (starts from the top of the image). |
Orientation
Detected human reading orientation.
Enums | |
---|---|
ORIENTATION_UNSPECIFIED
|
Unspecified orientation. |
PAGE_UP
|
Orientation is aligned with page up. |
PAGE_RIGHT
|
Orientation is aligned with page right. Turn the head 90 degrees clockwise from upright to read. |
PAGE_DOWN
|
Orientation is aligned with page down. Turn the head 180 degrees from upright to read. |
PAGE_LEFT
|
Orientation is aligned with page left. Turn the head 90 degrees counterclockwise from upright to read. |
DetectedLanguage
Detected language for a structural component.
JSON representation |
---|
{ "languageCode" : string , "confidence" : number } |
Fields | |
---|---|
languageCode
|
The BCP-47 language code
, such as |
confidence
|
confidence of detected language. Range |
Block
A block has a set of lines (collected into paragraphs) that have a common line-spacing and orientation.
JSON representation |
---|
{ "layout" : { object ( |
Fields | |
---|---|
layout
|
|
detectedLanguages[]
|
A list of detected languages together with confidence. |
provenance
|
The history of this annotation. |
Provenance
Structure to identify provenance relationships between annotations in different revisions.
JSON representation |
---|
{ "revision" : integer , "id" : integer , "parents" : [ { object ( |
Fields | |
---|---|
revision
|
The index of the revision that produced this element. |
id
|
The Id of this operation. Needs to be unique within the scope of the revision. |
parents[]
|
References to the original elements that are replaced. |
type
|
The type of provenance operation. |
Parent
The parent element the current element is based on. Used for referencing/aligning, removal and replacement operations.
JSON representation |
---|
{ "revision" : integer , "index" : integer , "id" : integer } |
Fields | |
---|---|
revision
|
The index of the index into current revision's parentIds list. |
index
|
The index of the parent item in the corresponding item list (eg. list of entities, properties within entities, etc.) in the parent revision. |
id
|
The id of the parent provenance. |
OperationType
If a processor or agent does an explicit operation on existing elements.
Enums | |
---|---|
OPERATION_TYPE_UNSPECIFIED
|
Operation type unspecified. If no operation is specified a provenance entry is simply used to match against a parent
. |
ADD
|
Add an element. |
REMOVE
|
Remove an element identified by parent
. |
UPDATE
|
Updates any fields within the given provenance scope of the message. It overwrites the fields rather than replacing them. Use this when you want to update a field value of an entity without also updating all the child properties. |
REPLACE
|
Currently unused. Replace an element identified by parent
. |
EVAL_REQUESTED
|
Deprecated. Request human review for the element identified by |
EVAL_APPROVED
|
Deprecated. Element is reviewed and approved at human review, confidence will be set to 1.0. |
EVAL_SKIPPED
|
Deprecated. Element is skipped in the validation process. |
Paragraph
A collection of lines that a human would perceive as a paragraph.
JSON representation |
---|
{ "layout" : { object ( |
Fields | |
---|---|
layout
|
|
detectedLanguages[]
|
A list of detected languages together with confidence. |
provenance
|
The history of this annotation. |
Line
A collection of tokens that a human would perceive as a line. Does not cross column boundaries, can be horizontal, vertical, etc.
JSON representation |
---|
{ "layout" : { object ( |
Fields | |
---|---|
layout
|
|
detectedLanguages[]
|
A list of detected languages together with confidence. |
provenance
|
The history of this annotation. |
Token
A detected token.
JSON representation |
---|
{ "layout" : { object ( |
Fields | |
---|---|
layout
|
|
detectedBreak
|
Detected break at the end of a |
detectedLanguages[]
|
A list of detected languages together with confidence. |
provenance
|
The history of this annotation. |
styleInfo
|
text style attributes. |
DetectedBreak
Detected break at the end of a token
.
JSON representation |
---|
{
"type"
:
enum (
|
Fields | |
---|---|
type
|
Detected break type. |
Type
Enum to denote the type of break found.
Enums | |
---|---|
TYPE_UNSPECIFIED
|
Unspecified break type. |
SPACE
|
A single whitespace. |
WIDE_SPACE
|
A wider whitespace. |
HYPHEN
|
A hyphen that indicates that a token has been split across lines. |
StyleInfo
Font and other text style attributes.
JSON representation |
---|
{ "fontSize" : integer , "pixelFontSize" : number , "letterSpacing" : number , "fontType" : string , "bold" : boolean , "italic" : boolean , "underlined" : boolean , "strikeout" : boolean , "subscript" : boolean , "superscript" : boolean , "smallcaps" : boolean , "fontWeight" : integer , "handwritten" : boolean , "textColor" : { object ( |
Fields | |
---|---|
fontSize
|
Font size in points ( |
pixelFontSize
|
Font size in pixels, equal to unrounded |
letterSpacing
|
Letter spacing in points. |
fontType
|
name or style of the font. |
bold
|
Whether the text is bold (equivalent to |
italic
|
Whether the text is italic. |
underlined
|
Whether the text is underlined. |
strikeout
|
Whether the text is strikethrough. |
subscript
|
Whether the text is a subscript. |
superscript
|
Whether the text is a superscript. |
smallcaps
|
Whether the text is in small caps. |
fontWeight
|
TrueType weight on a scale |
handwritten
|
Whether the text is handwritten. |
textColor
|
color of the text. |
backgroundColor
|
color of the background. |
VisualElement
Detected non-text visual elements e.g. checkbox, signature etc. on the page.
JSON representation |
---|
{ "layout" : { object ( |
Fields | |
---|---|
layout
|
|
type
|
type of the |
detectedLanguages[]
|
A list of detected languages together with confidence. |
Table
A table representation similar to HTML table structure.
JSON representation |
---|
{ "layout" : { object ( |
Fields | |
---|---|
layout
|
|
headerRows[]
|
Header rows of the table. |
bodyRows[]
|
body rows of the table. |
detectedLanguages[]
|
A list of detected languages together with confidence. |
provenance
|
The history of this table. |
TableRow
A row of table cells.
JSON representation |
---|
{
"cells"
:
[
{
object (
|
Fields | |
---|---|
cells[]
|
Cells that make up this row. |
TableCell
A cell representation inside the table.
JSON representation |
---|
{ "layout" : { object ( |
Fields | |
---|---|
layout
|
|
rowSpan
|
How many rows this cell spans. |
colSpan
|
How many columns this cell spans. |
detectedLanguages[]
|
A list of detected languages together with confidence. |
FormField
A form field detected on the page.
JSON representation |
---|
{ "fieldName" : { object ( |
fieldName
nameDetectedLanguages[]
object (
DetectedLanguage
)
A list of detected languages for name together with confidence.
valueDetectedLanguages[]
object (
DetectedLanguage
)
A list of detected languages for value together with confidence.
valueType
string
If the value is non-textual, this field represents the type. Current valid values are:
- blank (this indicates the
fieldValue
is normal text) -
unfilled_checkbox
-
filled_checkbox
correctedKeyText
string
Created for Labeling UI to export key text. If corrections were made to the text identified by the fieldName.text_anchor
, this field will contain the correction.
correctedValueText
string
Created for Labeling UI to export value text. If corrections were made to the text identified by the fieldValue.text_anchor
, this field will contain the correction.
provenance
object (
Provenance
)
The history of this annotation.
Symbol
A detected symbol.
JSON representation |
---|
{ "layout" : { object ( |
Fields | |
---|---|
layout
|
|
detectedLanguages[]
|
A list of detected languages together with confidence. |
DetectedBarcode
A detected barcode.
JSON representation |
---|
{ "layout" : { object ( |
Fields | |
---|---|
layout
|
|
barcode
|
Detailed barcode information of the |
Barcode
Encodes the detailed information of a barcode.
JSON representation |
---|
{ "format" : string , "valueFormat" : string , "rawValue" : string } |
format
string
Format of a barcode. The supported formats are:
-
CODE_128
: code 128 type. -
CODE_39
: code 39 type. -
CODE_93
: code 93 type. -
CODABAR
: Codabar type. -
DATA_MATRIX
: 2D data Matrix type. -
ITF
: ITF type. -
EAN_13
: EAN-13 type. -
EAN_8
: EAN-8 type. -
QR_CODE
: 2D QR code type. -
UPC_A
: UPC-A type. -
UPC_E
: UPC-E type. -
PDF417
: PDF417 type. -
AZTEC
: 2D Aztec code type. -
DATABAR
: GS1 DataBar code type.
valueFormat
string
value format describes the format of the value that a barcode encodes. The supported formats are:
-
CONTACT_INFO
: Contact information. -
EMAIL
: email address. -
isbn
: isbn identifier. -
PHONE
: Phone number. -
PRODUCT
: Product. -
SMS
: SMS message. -
TEXT
: text string. -
url
: url address. -
WIFI
: Wifi information. -
GEO
: Geo-localization. -
CALENDAR_EVENT
: Calendar event. -
DRIVER_LICENSE
: Driver's license.
rawValue
string
Raw value encoded in the barcode. For example: 'MEBKM:TITLE:Google;url:https://www.google.com;;'
.
ImageQualityScores
Image quality scores for the page image.
JSON representation |
---|
{
"qualityScore"
:
number
,
"detectedDefects"
:
[
{
object (
|
Fields | |
---|---|
qualityScore
|
The overall quality score. Range |
detectedDefects[]
|
A list of detected defects. |
DetectedDefect
Image Quality Defects
JSON representation |
---|
{ "type" : string , "confidence" : number } |
type
string
name of the defect type. Supported values are:
-
quality/defect_blurry
-
quality/defect_noisy
-
quality/defect_dark
-
quality/defect_faint
-
quality/defect_text_too_small
-
quality/defect_document_cutoff
-
quality/defect_text_cutoff
-
quality/defect_glare
confidence
number
confidence of detected defect. Range [0, 1]
where 1
indicates strong confidence that the defect exists.
Entity
An entity that could be a phrase in the text or a property that belongs to the document. It is a known entity type, such as a person, an organization, or location.
JSON representation |
---|
{ "textAnchor" : { object ( |
Fields | |
---|---|
textAnchor
|
Optional. Provenance of the entity. text anchor indexing into the |
type
|
Required. Entity type from a schema e.g. |
mentionText
|
Optional. text value of the entity e.g. |
mentionId
|
Optional. Deprecated. Use |
confidence
|
Optional. confidence of detected Schema entity. Range |
pageAnchor
|
Optional. Represents the provenance of this entity wrt. the location on the page where it was found. |
id
|
Optional. Canonical id. This will be a unique value in the entity list for this document. |
normalizedValue
|
Optional. normalized entity value. Absent if the extracted value could not be converted or the type (e.g. address) is not supported for certain parsers. This field is also only populated for certain supported document types. |
properties[]
|
Optional. Entities can be nested to form a hierarchical data structure representing the content in the document. |
provenance
|
Optional. The history of this annotation. |
redacted
|
Optional. Whether the entity will be redacted for de-identification purposes. |
PageAnchor
Referencing the visual context of the entity in the Document.pages
. page anchors can be cross-page, consist of multiple bounding polygons and optionally reference specific layout element types.
JSON representation |
---|
{
"pageRefs"
:
[
{
object (
|
Fields | |
---|---|
pageRefs[]
|
One or more references to visual page elements |
PageRef
Represents a weak reference to a page element within a document.
JSON representation |
---|
{ "page" : string , "layoutType" : enum ( |
Fields | |
---|---|
page
|
Required. Index into the |
layoutType
|
Optional. The type of the layout element that is being referenced if any. |
layoutId
|
Optional. Deprecated. Use |
boundingPoly
|
Optional. Identifies the bounding polygon of a layout element on the page. |
confidence
|
Optional. confidence of detected page element, if applicable. Range |
LayoutType
The type of layout that is being referenced.
Enums | |
---|---|
LAYOUT_TYPE_UNSPECIFIED
|
Layout Unspecified. |
BLOCK
|
References a page.blocks
element. |
PARAGRAPH
|
References a page.paragraphs
element. |
LINE
|
References a page.lines
element. |
TOKEN
|
References a page.tokens
element. |
VISUAL_ELEMENT
|
References a page.visual_elements
element. |
TABLE
|
Refrrences a page.tables
element. |
FORM_FIELD
|
References a page.form_fields
element. |
NormalizedValue
Parsed and normalized entity value.
JSON representation |
---|
{ "text" : string , // Union field |
text
string
Optional. An optional field to store a normalized string. For some entity types, one of respective structured_value
fields may also be populated. Also not all the types of structured_value
will be normalized. For example, some processors may not generate float
or integer
normalized text by default.
Below are sample formats mapped to structured values.
- Money/currency type (
moneyValue
) is in the ISO 4217 text format. - date type (
dateValue
) is in the ISO 8601 text format. - Datetime type (
datetimeValue
) is in the ISO 8601 text format.
structured_value
. An optional structured entity value. Must match entity type defined in schema if known. If this field is present, the text
field could also be populated. structured_value
can be only one of the following:moneyValue
object (
Money
)
Money value. See also: https://github.com/googleapis/googleapis/blob/master/google/type/money.proto
dateValue
object (
Date
)
date value. Includes year, month, day. See also: https://github.com/googleapis/googleapis/blob/master/google/type/date.proto
datetimeValue
object (
DateTime
)
DateTime value. Includes date, time, and timezone. See also: https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto
addressValue
object (
PostalAddress
)
Postal address. See also: https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto
booleanValue
boolean
Boolean value. Can be used for entities with binary values, or for checkboxes.
integerValue
integer
Integer value.
floatValue
number
Float value.
Money
Represents an amount of money with its currency type.
JSON representation |
---|
{ "currencyCode" : string , "units" : string , "nanos" : integer } |
Fields | |
---|---|
currencyCode
|
The three-letter currency code defined in ISO 4217. |
units
|
The whole units of the amount. For example if |
nanos
|
number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If |
Date
Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:
- A full date, with non-zero year, month, and day values.
- A month and day, with a zero year (for example, an anniversary).
- A year on its own, with a zero month and a zero day.
- A year and month, with a zero day (for example, a credit card expiration date).
Related types:
-
google.type.TimeOfDay
-
google.type.DateTime
-
google.protobuf.Timestamp
JSON representation |
---|
{ "year" : integer , "month" : integer , "day" : integer } |
Fields | |
---|---|
year
|
year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. |
month
|
month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. |
day
|
day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. |
DateTime
Represents civil time (or occasionally physical time).
This type can represent a civil time in one of a few possible ways:
- When utcOffset is set and timeZone is unset: a civil time on a calendar day with a particular offset from UTC.
- When timeZone is set and utcOffset is unset: a civil time on a calendar day in a particular time zone.
- When neither timeZone nor utcOffset is set: a civil time on a calendar day in local time.
The date is relative to the Proleptic Gregorian Calendar.
If year, month, or day are 0, the DateTime is considered not to have a specific year, month, or day respectively.
This type may also be used to represent a physical time if all the date and time fields are set and either case of the time_offset
oneof is set. Consider using timestamp
message for physical time instead. If your use case also would like to store the user's timezone, that can be done in another field.
This type is more flexible than some applications may want. Make sure to document and validate your application's limitations.
JSON representation |
---|
{ "year" : integer , "month" : integer , "day" : integer , "hours" : integer , "minutes" : integer , "seconds" : integer , "nanos" : integer , // Union field |
year
integer
Optional. year of date. Must be from 1 to 9999, or 0 if specifying a datetime without a year.
month
integer
Optional. month of year. Must be from 1 to 12, or 0 if specifying a datetime without a month.
day
integer
Optional. day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a datetime without a day.
hours
integer
Optional. Hours of day in 24 hour format. Should be from 0 to 23, defaults to 0 (midnight). An API may choose to allow the value "24:00:00" for scenarios like business closing time.
minutes
integer
Optional. Minutes of hour of day. Must be from 0 to 59, defaults to 0.
seconds
integer
Optional. Seconds of minutes of the time. Must normally be from 0 to 59, defaults to 0. An API may allow the value 60 if it allows leap-seconds.
nanos
integer
Optional. Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999, defaults to 0.
time_offset
. Optional. Specifies either the UTC offset or the time zone of the DateTime. Choose carefully between them, considering that time zone data may change in the future (for example, a country modifies their DST start/end dates, and future DateTimes in the affected range had already been stored). If omitted, the DateTime is considered to be in local time. time_offset
can be only one of the following:utcOffset
string (
Duration
format)
UTC offset. Must be whole seconds, between -18 hours and +18 hours. For example, a UTC offset of -4:00 would be represented as { seconds: -14400 }.
A duration in seconds with up to nine fractional digits, ending with ' s
'. Example: "3.5s"
.
timeZone
object (
TimeZone
)
time zone.
TimeZone
Represents a time zone from the IANA time Zone Database .
JSON representation |
---|
{ "id" : string , "version" : string } |
Fields | |
---|---|
id
|
IANA time Zone Database time zone, e.g. "America/New_York". |
version
|
Optional. IANA time Zone Database version number, e.g. "2019a". |
PostalAddress
Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. box or similar. It is not intended to model geographical locations (roads, towns, mountains).
In typical usage an address would be created via user input or from importing existing data, depending on the type of process.
Advice on address input / editing: - Use an internationalization-ready address widget such as https://github.com/google/libaddressinput ) - Users should not be presented with UI elements for input or editing of fields outside countries where that field is used.
For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478
JSON representation |
---|
{ "revision" : integer , "regionCode" : string , "languageCode" : string , "postalCode" : string , "sortingCode" : string , "administrativeArea" : string , "locality" : string , "sublocality" : string , "addressLines" : [ string ] , "recipients" : [ string ] , "organization" : string } |
Fields | |
---|---|
revision
|
The schema revision of the All new revisions mustbe backward compatible with old revisions. |
regionCode
|
Required. CLDR region code of the country/region of the address. This is never inferred and it is up to the user to ensure the value is correct. See https://cldr.unicode.org/ and https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH" for Switzerland. |
languageCode
|
Optional. BCP-47 language code of the contents of this address (if known). This is often the UI language of the input form or is expected to match one of the languages used in the address' country/region, or their transliterated equivalents. This can affect formatting in certain countries, but is not critical to the correctness of the data and will never affect any validation or other non-formatting related operations. If this value is not known, it should be omitted (rather than specifying a possibly incorrect default). Examples: "zh-Hant", "ja", "ja-Latn", "en". |
postalCode
|
Optional. Postal code of the address. Not all countries use or require postal codes to be present, but where they are used, they may trigger additional validation with other parts of the address (e.g. state/zip validation in the U.S.A.). |
sortingCode
|
Optional. Additional, country-specific, sorting code. This is not used in most regions. Where it is used, the value is either a string like "CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number alone, representing the "sector code" (Jamaica), "delivery area indicator" (Malawi) or "post office indicator" (e.g. Côte d'Ivoire). |
administrativeArea
|
Optional. Highest administrative subdivision which is used for postal addresses of a country or region. For example, this can be a state, a province, an oblast, or a prefecture. Specifically, for Spain this is the province and not the autonomous community (e.g. "Barcelona" and not "Catalonia"). Many countries don't use an administrative area in postal addresses. E.g. in Switzerland this should be left unpopulated. |
locality
|
Optional. Generally refers to the city/town portion of the address. Examples: US city, IT comune, UK post town. In regions of the world where localities are not well defined or do not fit into this structure well, leave locality empty and use addressLines. |
sublocality
|
Optional. Sublocality of the address. For example, this can be neighborhoods, boroughs, districts. |
addressLines[]
|
Unstructured address lines describing the lower levels of an address. Because values in addressLines do not have type information and may sometimes contain multiple values in a single field (e.g. "Austin, TX"), it is important that the line order is clear. The order of address lines should be "envelope order" for the country/region of the address. In places where this can vary (e.g. Japan), address_language is used to make it explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" for small-to-large). This way, the most specific line of an address can be selected based on the language. The minimum permitted structural representation of an address consists of a regionCode with all remaining information placed in the addressLines. It would be possible to format such an address very approximately without geocoding, but no semantic reasoning could be made about any of the address components until it was at least partially resolved. Creating an address only containing a regionCode and addressLines, and then geocoding is the recommended way to handle completely unstructured addresses (as opposed to guessing which parts of the address should be localities or administrative areas). |
recipients[]
|
Optional. The recipient at the address. This field may, under certain circumstances, contain multiline information. For example, it might contain "care of" information. |
organization
|
Optional. The name of the organization at the address. |
EntityRelation
Relationship between Entities
.
JSON representation |
---|
{ "subjectId" : string , "objectId" : string , "relation" : string } |
Fields | |
---|---|
subjectId
|
subject entity id. |
objectId
|
Object entity id. |
relation
|
Relationship description. |
TextChange
This message is used for text changes aka. OCR corrections.
JSON representation |
---|
{ "textAnchor" : { object ( |
Fields | |
---|---|
textAnchor
|
Provenance of the correction. text anchor indexing into the |
changedText
|
The text that replaces the text identified in the |
provenance[]
|
The history of this annotation. |
ShardInfo
For a large document, sharding may be performed to produce several document shards. Each document shard contains this field to detail which shard it is.
JSON representation |
---|
{ "shardIndex" : string , "shardCount" : string , "textOffset" : string } |
Fields | |
---|---|
shardIndex
|
The 0-based index of this shard. |
shardCount
|
Total number of shards. |
textOffset
|
The index of the first character in |
Revision
Contains past or forward revisions of this document.
JSON representation |
---|
{ "id" : string , "parent" : [ integer ] , "parentIds" : [ string ] , "createTime" : string , "humanReview" : { object ( |
id
string
Id of the revision, internally generated by doc proto storage. Unique within the context of the document.
parent[]
(deprecated)
integer
The revisions that this revision is based on. This can include one or more parent (when documents are merged.) This field represents the index into the revisions
field.
parentIds[]
string
The revisions that this revision is based on. Must include all the ids that have anything to do with this revision - eg. there are provenance.parent.revision
fields that index into this field.
createTime
string (
Timestamp
format)
The time that the revision was created, internally generated by doc proto storage at the time of create.
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z"
and "2014-10-02T15:01:23.045123456Z"
.
humanReview
object (
HumanReview
)
Human Review information of this revision.
source
. Who/what made the change source
can be only one of the following:agent
string
If the change was made by a person specify the name or id of that person.
processor
string
If the annotation was made by processor identify the processor by its resource name.
HumanReview
Human Review information of the document.
JSON representation |
---|
{ "state" : string , "stateMessage" : string } |
Fields | |
---|---|
state
|
Human review state. e.g. |
Property
Property of a document.
JSON representation |
---|
{ "name" : string , // Union field |
name
string
Required. Must match the name of a PropertyDefinition in the DocumentSchema.
values
. Type of the property. Must match the property_options type of the matching PropertyDefinition. Value of the Property parsed into a specific data type. Specific type value(s) obtained from Document AIs Property.mention_text field. values
can be only one of the following:integerValues
object (
IntegerArray
)
Integer property values.
floatValues
object (
FloatArray
)
Float property values.
textValues
object (
TextArray
)
String/text property values.
enumValues
object (
EnumArray
)
Enum property values.
propertyValues
object (
PropertyArray
)
Nested structured data property values.
dateTimeValues
object (
DateTimeArray
)
date time property values. It is not supported by CMEK compliant deployment.
mapProperty
object (
MapProperty
)
Map property values.
IntegerArray
Integer values.
JSON representation |
---|
{ "values" : [ integer ] } |
Fields | |
---|---|
values[]
|
List of integer values. |
FloatArray
Float values.
JSON representation |
---|
{ "values" : [ number ] } |
Fields | |
---|---|
values[]
|
List of float values. |
TextArray
String/text values.
JSON representation |
---|
{ "values" : [ string ] } |
Fields | |
---|---|
values[]
|
List of text values. |
EnumArray
Enum values.
JSON representation |
---|
{ "values" : [ string ] } |
Fields | |
---|---|
values[]
|
List of enum values. |
PropertyArray
Property values.
JSON representation |
---|
{
"properties"
:
[
{
object (
|
Fields | |
---|---|
properties[]
|
List of property values. |
DateTimeArray
DateTime values.
JSON representation |
---|
{
"values"
:
[
{
object (
|
Fields | |
---|---|
values[]
|
List of datetime values. Both OffsetDateTime and ZonedDateTime are supported. |
MapProperty
Map property value. Represents a structured entries of key value pairs, consisting of field names which map to dynamically typed values.
JSON representation |
---|
{
"fields"
:
{
string
:
{
object (
|
Fields | |
---|---|
fields
|
Unordered map of dynamically typed values. An object containing a list of |
Value
value
represents a dynamically typed value which can be either be a float, a integer, a string, or a datetime value. A producer of value is expected to set one of these variants. Absence of any variant indicates an error.
JSON representation |
---|
{ // Union field |
kind
. The kind of value. kind
can be only one of the following:floatValue
number
Represents a float value.
intValue
integer
Represents a integer value.
stringValue
string
Represents a string value.
enumValue
object (
EnumValue
)
Represents an enum value.
datetimeValue
object (
DateTime
)
Represents a datetime value.
booleanValue
boolean
Represents a boolean value.
EnumValue
Represents the string value of the enum field.
JSON representation |
---|
{ "value" : string } |
Fields | |
---|---|
value
|
String value of the enum field. This must match defined set of enums in document schema using EnumTypeOptions. |
TimestampValue
timestamp value type.
JSON representation |
---|
{ // Union field |
Union field value
.
value
can be only one of the following:
textValue
string
The string must represent a valid instant in UTC and is parsed using java.time.format.DateTimeFormatter.ISO_INSTANT. e.g. "2013-09-29T18:46:19Z"
TimestampArray
timestamp values.
JSON representation |
---|
{
"values"
:
[
{
object (
|
Fields | |
---|---|
values[]
|
List of timestamp values. |
RawDocumentFileType
When a raw document is supplied, this indicates the file format
Enums | |
---|---|
RAW_DOCUMENT_FILE_TYPE_UNSPECIFIED
|
No raw document specified or it is non-parsable |
RAW_DOCUMENT_FILE_TYPE_PDF
|
Adobe PDF format |
RAW_DOCUMENT_FILE_TYPE_DOCX
|
Microsoft word format |
RAW_DOCUMENT_FILE_TYPE_XLSX
|
Microsoft Excel format |
RAW_DOCUMENT_FILE_TYPE_PPTX
|
Microsoft Powerpoint format |
RAW_DOCUMENT_FILE_TYPE_TEXT
|
UTF-8 encoded text format |
RAW_DOCUMENT_FILE_TYPE_TIFF
|
TIFF or TIF image file format |
ContentCategory
When a raw document or structured content is supplied, this stores the content category.
Enums | |
---|---|
CONTENT_CATEGORY_UNSPECIFIED
|
No category is specified. |
CONTENT_CATEGORY_IMAGE
|
Content is of image type. |
CONTENT_CATEGORY_AUDIO
|
Content is of audio type. |
CONTENT_CATEGORY_VIDEO
|
Content is of video type. |