Class: Google::Apis::DatastoreV1::EntityResult

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

Overview

The result of fetching an entity from Datastore.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ EntityResult

Returns a new instance of EntityResult



394
395
396
# File 'generated/google/apis/datastore_v1/classes.rb', line 394

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

Instance Attribute Details

#cursorString

A cursor that points to the position after the result entity. Set only when the EntityResult is part of a QueryResultBatch message. Corresponds to the JSON property cursor

Returns:

  • (String)


373
374
375
# File 'generated/google/apis/datastore_v1/classes.rb', line 373

def cursor
  @cursor
end

#entityGoogle::Apis::DatastoreV1::Entity

A Datastore data object. An entity is limited to 1 megabyte when stored. That roughly corresponds to a limit of 1 megabyte for the serialized form of this message. Corresponds to the JSON property entity



381
382
383
# File 'generated/google/apis/datastore_v1/classes.rb', line 381

def entity
  @entity
end

#versionString

The version of the entity, a strictly positive number that monotonically increases with changes to the entity. This field is set for FULL entity results. For missing entities in LookupResponse, this is the version of the snapshot that was used to look up the entity, and it is always set except for eventually consistent reads. Corresponds to the JSON property version

Returns:

  • (String)


392
393
394
# File 'generated/google/apis/datastore_v1/classes.rb', line 392

def version
  @version
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



399
400
401
402
403
# File 'generated/google/apis/datastore_v1/classes.rb', line 399

def update!(**args)
  @cursor = args[:cursor] if args.key?(:cursor)
  @entity = args[:entity] if args.key?(:entity)
  @version = args[:version] if args.key?(:version)
end