Class: Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta3SchemaEntityType

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/documentai_v1beta3/classes.rb,
lib/google/apis/documentai_v1beta3/representations.rb,
lib/google/apis/documentai_v1beta3/representations.rb

Overview

EntityType is the wrapper of a label of the corresponding model with detailed attributes and limitations for entity-based processors. Multiple types can also compose a dependency tree to represent nested types.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDocumentaiV1beta3SchemaEntityType

Returns a new instance of GoogleCloudDocumentaiV1beta3SchemaEntityType.



7299
7300
7301
# File 'lib/google/apis/documentai_v1beta3/classes.rb', line 7299

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#base_typeString

Type of the entity. It must be one of the following: document - the entity represents a classification of a logical document. object - if the entity has properties it is likely an object (or or a document.) datetime - the entity is a date or time value. money - the entity represents a money value amount. number - the entity is a number - integer or floating point. string

  • the entity is a string value. boolean - the entity is a boolean value. address - the entity is a location address. duration - the entity is a duration. Corresponds to the JSON property baseType

Returns:

  • (String)


7250
7251
7252
# File 'lib/google/apis/documentai_v1beta3/classes.rb', line 7250

def base_type
  @base_type
end

#descriptionString

Description of the entity type. Corresponds to the JSON property description

Returns:

  • (String)


7255
7256
7257
# File 'lib/google/apis/documentai_v1beta3/classes.rb', line 7255

def description
  @description
end

#enum_valuesArray<String>

If specified, lists all the possible values for this entity. Corresponds to the JSON property enumValues

Returns:

  • (Array<String>)


7260
7261
7262
# File 'lib/google/apis/documentai_v1beta3/classes.rb', line 7260

def enum_values
  @enum_values
end

#occurrence_typeString

Occurrence type limits the number of times an entity type appears in the document. Corresponds to the JSON property occurrenceType

Returns:

  • (String)


7266
7267
7268
# File 'lib/google/apis/documentai_v1beta3/classes.rb', line 7266

def occurrence_type
  @occurrence_type
end

#propertiesArray<Google::Apis::DocumentaiV1beta3::GoogleCloudDocumentaiV1beta3SchemaEntityType>

Describing the nested structure of an entity. An EntityType may consist of several other EntityTypes. For example, in a document there can be an EntityType 'ID', which consists of EntityType 'name' and 'address', with corresponding attributes, such as TEXT for both types and ONCE for occurrence types. Corresponds to the JSON property properties



7275
7276
7277
# File 'lib/google/apis/documentai_v1beta3/classes.rb', line 7275

def properties
  @properties
end

#sourceString

Source of this entity type. Corresponds to the JSON property source

Returns:

  • (String)


7280
7281
7282
# File 'lib/google/apis/documentai_v1beta3/classes.rb', line 7280

def source
  @source
end

#typeString

Name of the type. It must satisfy the following constraints: 1. Must be unique within the set of same level types (with case-insensitive match). 2. Maximum 50 characters. 3. Must start with a letter. 4. Allowed characters: ASCII letters [a-zA-Z], ASCII digits [0-9], or one of the following punctuation characters: * underscore '_' (recommended) * hyphen '-' (allowed, not recommended) * colon ':' (allowed, not recommended) NOTE: Whitespace characters are not allowed. 5. Cannot end with a punctuation character. 6. Cannot contain the following restricted strings: "google", "DocumentAI" (case- insensitive match). 7. A slash character '/' is reserved as a separator in flattened representations of nested entity types (e.g., "line_item/amount") in which case each part (e.g., "line_item", "amount") must comply with the rules defined above. We recommend using the snake case ("snake_case") in entity type names. Corresponds to the JSON property type

Returns:

  • (String)


7297
7298
7299
# File 'lib/google/apis/documentai_v1beta3/classes.rb', line 7297

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



7304
7305
7306
7307
7308
7309
7310
7311
7312
# File 'lib/google/apis/documentai_v1beta3/classes.rb', line 7304

def update!(**args)
  @base_type = args[:base_type] if args.key?(:base_type)
  @description = args[:description] if args.key?(:description)
  @enum_values = args[:enum_values] if args.key?(:enum_values)
  @occurrence_type = args[:occurrence_type] if args.key?(:occurrence_type)
  @properties = args[:properties] if args.key?(:properties)
  @source = args[:source] if args.key?(:source)
  @type = args[:type] if args.key?(:type)
end