Class: Google::Apis::DatastoreV1::PathElement

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

Overview

A (kind, ID/name) pair used to construct a key path. If either name or ID is set, the element is complete. If neither is set, the element is incomplete.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ PathElement

Returns a new instance of PathElement.



2086
2087
2088
# File 'lib/google/apis/datastore_v1/classes.rb', line 2086

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

Instance Attribute Details

#idFixnum

The auto-allocated ID of the entity. Never equal to zero. Values less than zero are discouraged and may not be supported in the future. Corresponds to the JSON property id

Returns:

  • (Fixnum)


2068
2069
2070
# File 'lib/google/apis/datastore_v1/classes.rb', line 2068

def id
  @id
end

#kindString

The kind of the entity. A kind matching regex __.*__ is reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 encoded. Cannot be "" . Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as __bytes__ where `is the base-64 encoding of the bytes. Corresponds to the JSON propertykind`

Returns:

  • (String)


2076
2077
2078
# File 'lib/google/apis/datastore_v1/classes.rb', line 2076

def kind
  @kind
end

#nameString

The name of the entity. A name matching regex __.*__ is reserved/read-only. A name must not be more than 1500 bytes when UTF-8 encoded. Cannot be "". Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as __bytes__ where `is the base-64 encoding of the bytes. Corresponds to the JSON propertyname`

Returns:

  • (String)


2084
2085
2086
# File 'lib/google/apis/datastore_v1/classes.rb', line 2084

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2091
2092
2093
2094
2095
# File 'lib/google/apis/datastore_v1/classes.rb', line 2091

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