Class: Google::Apis::DatastoreV1beta3::Entity

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

Overview

A Datastore data object. Must not exceed 1 MiB - 4 bytes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Entity

Returns a new instance of Entity.



435
436
437
# File 'lib/google/apis/datastore_v1beta3/classes.rb', line 435

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

Instance Attribute Details

#keyGoogle::Apis::DatastoreV1beta3::Key

A unique identifier for an entity. If a key's partition ID or any of its path kinds or names are reserved/read-only, the key is reserved/read-only. A reserved/read-only key is forbidden in certain documented contexts. Corresponds to the JSON property key



425
426
427
# File 'lib/google/apis/datastore_v1beta3/classes.rb', line 425

def key
  @key
end

#propertiesHash<String,Google::Apis::DatastoreV1beta3::Value>

The entity's properties. The map's keys are property names. A property name matching regex __.*__ is reserved. A reserved property name is forbidden in certain documented contexts. The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Corresponds to the JSON property properties

Returns:



433
434
435
# File 'lib/google/apis/datastore_v1beta3/classes.rb', line 433

def properties
  @properties
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



440
441
442
443
# File 'lib/google/apis/datastore_v1beta3/classes.rb', line 440

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