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

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

Overview

The result of fetching an entity from Datastore.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ EntityResult

Returns a new instance of EntityResult.

[View source]

530
531
532
# File 'lib/google/apis/datastore_v1/classes.rb', line 530

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

Instance Attribute Details

#create_timeString

The time at which the entity was created. This field is set for FULL entity results. If this entity is missing, this field will not be set. Corresponds to the JSON property createTime

Returns:

  • (String)

501
502
503
# File 'lib/google/apis/datastore_v1/classes.rb', line 501

def create_time
  @create_time
end

#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 NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)

508
509
510
# File 'lib/google/apis/datastore_v1/classes.rb', line 508

def cursor
  @cursor
end

#entityGoogle::Apis::DatastoreV1::Entity

A Datastore data object. Must not exceed 1 MiB - 4 bytes. Corresponds to the JSON property entity


513
514
515
# File 'lib/google/apis/datastore_v1/classes.rb', line 513

def entity
  @entity
end

#update_timeString

The time at which the entity was last changed. This field is set for FULL entity results. If this entity is missing, this field will not be set. Corresponds to the JSON property updateTime

Returns:

  • (String)

519
520
521
# File 'lib/google/apis/datastore_v1/classes.rb', line 519

def update_time
  @update_time
end

#versionFixnum

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:

  • (Fixnum)

528
529
530
# File 'lib/google/apis/datastore_v1/classes.rb', line 528

def version
  @version
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object

[View source]

535
536
537
538
539
540
541
# File 'lib/google/apis/datastore_v1/classes.rb', line 535

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