Layout

google.cloud.automl.v1beta1.Document. Layout

Represents a Layout.

Constructor

new Layout(propertiesopt)

Constructs a new Layout.

Parameters:
Name Type Attributes Description
properties google.cloud.automl.v1beta1.Document.ILayout <optional>

Properties to set

Implements:
  • ILayout

Members

boundingPoly

Layout boundingPoly.

pageNumber

Layout pageNumber.

textSegment

Layout textSegment.

textSegmentType

Layout textSegmentType.

TextSegmentType

TextSegmentType enum.

Properties:
Name Type Description
TEXT_SEGMENT_TYPE_UNSPECIFIED number

TEXT_SEGMENT_TYPE_UNSPECIFIED value

TOKEN number

TOKEN value

PARAGRAPH number

PARAGRAPH value

FORM_FIELD number

FORM_FIELD value

FORM_FIELD_NAME number

FORM_FIELD_NAME value

FORM_FIELD_CONTENTS number

FORM_FIELD_CONTENTS value

TABLE number

TABLE value

TABLE_HEADER number

TABLE_HEADER value

TABLE_ROW number

TABLE_ROW value

TABLE_CELL number

TABLE_CELL value

Methods

toJSON() → {Object.<string, *>}

Converts this Layout to JSON.

Returns:
Type Description
Object.<string, *>

JSON object

(static) create(propertiesopt) → {google.cloud.automl.v1beta1.Document.Layout}

Creates a new Layout instance using the specified properties.

Parameters:
Name Type Attributes Description
properties google.cloud.automl.v1beta1.Document.ILayout <optional>

Properties to set

Returns:
Type Description
google.cloud.automl.v1beta1.Document.Layout

Layout instance

(static) decode(reader, lengthopt) → {google.cloud.automl.v1beta1.Document.Layout}

Decodes a Layout message from the specified reader or buffer.

Parameters:
Name Type Attributes Description
reader $protobuf.Reader | Uint8Array

Reader or buffer to decode from

length number <optional>

Message length if known beforehand

Returns:
Type Description
google.cloud.automl.v1beta1.Document.Layout

Layout

Throws:
  • If the payload is not a reader or valid buffer

    Type
    Error
  • If required fields are missing

    Type
    $protobuf.util.ProtocolError

(static) decodeDelimited(reader) → {google.cloud.automl.v1beta1.Document.Layout}

Decodes a Layout message from the specified reader or buffer, length delimited.

Parameters:
Name Type Description
reader $protobuf.Reader | Uint8Array

Reader or buffer to decode from

Returns:
Type Description
google.cloud.automl.v1beta1.Document.Layout

Layout

Throws:
  • If the payload is not a reader or valid buffer

    Type
    Error
  • If required fields are missing

    Type
    $protobuf.util.ProtocolError

(static) encode(message, writeropt) → {$protobuf.Writer}

Encodes the specified Layout message. Does not implicitly verify messages.

Parameters:
Name Type Attributes Description
message google.cloud.automl.v1beta1.Document.ILayout

Layout message or plain object to encode

writer $protobuf.Writer <optional>

Writer to encode to

Returns:
Type Description
$protobuf.Writer

Writer

(static) encodeDelimited(message, writeropt) → {$protobuf.Writer}

Encodes the specified Layout message, length delimited. Does not implicitly verify messages.

Parameters:
Name Type Attributes Description
message google.cloud.automl.v1beta1.Document.ILayout

Layout message or plain object to encode

writer $protobuf.Writer <optional>

Writer to encode to

Returns:
Type Description
$protobuf.Writer

Writer

(static) fromObject(object) → {google.cloud.automl.v1beta1.Document.Layout}

Creates a Layout message from a plain object. Also converts values to their respective internal types.

Parameters:
Name Type Description
object Object.<string, *>

Plain object

Returns:
Type Description
google.cloud.automl.v1beta1.Document.Layout

Layout

(static) getTypeUrl(typeUrlPrefixopt) → {string}

Gets the default type url for Layout

Parameters:
Name Type Attributes Description
typeUrlPrefix string <optional>

your custom typeUrlPrefix(default "type.googleapis.com")

Returns:
Type Description
string

The default type url

(static) toObject(message, optionsopt) → {Object.<string, *>}

Creates a plain object from a Layout message. Also converts values to other types if specified.

Parameters:
Name Type Attributes Description
message google.cloud.automl.v1beta1.Document.Layout

Layout

options $protobuf.IConversionOptions <optional>

Conversion options

Returns:
Type Description
Object.<string, *>

Plain object

(static) verify(message) → {string|null}

Verifies a Layout message.

Parameters:
Name Type Description
message Object.<string, *>

Plain object to verify

Returns:
Type Description
string | null

null if valid, otherwise the reason why it is not