Class: Google::Apis::DatastoreV1beta3::Key
- Inherits:
-
Object
- Object
- Google::Apis::DatastoreV1beta3::Key
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- generated/google/apis/datastore_v1beta3/classes.rb,
generated/google/apis/datastore_v1beta3/representations.rb,
generated/google/apis/datastore_v1beta3/representations.rb
Overview
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.
Instance Attribute Summary collapse
-
#partition_id ⇒ Google::Apis::DatastoreV1beta3::PartitionId
A partition ID identifies a grouping of entities.
-
#path ⇒ Array<Google::Apis::DatastoreV1beta3::PathElement>
The entity path.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Key
constructor
A new instance of Key.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ Key
Returns a new instance of Key
959 960 961 |
# File 'generated/google/apis/datastore_v1beta3/classes.rb', line 959 def initialize(**args) update!(**args) end |
Instance Attribute Details
#partition_id ⇒ Google::Apis::DatastoreV1beta3::PartitionId
A partition ID identifies a grouping of entities. The grouping is always by project and namespace, however the namespace ID may be empty. A partition ID contains several dimensions: project ID and namespace ID. Partition dimensions:
- May be
""
. - Must be valid UTF-8 bytes.
- Must have values that match regex
[A-Za-z\d\.\-_]
1,100`If the value of any dimension matches regex
.*, the partition is reserved/read-only. A reserved/read-only partition ID is forbidden in certain documented contexts. Foreign partition IDs (in which the project ID does not match the context project ID ) are discouraged. Reads and writes of foreign partition IDs may fail if the project is not in an active state. Corresponds to the JSON property
partitionId`
939 940 941 |
# File 'generated/google/apis/datastore_v1beta3/classes.rb', line 939 def partition_id @partition_id end |
#path ⇒ Array<Google::Apis::DatastoreV1beta3::PathElement>
The entity path.
An entity path consists of one or more elements composed of a kind and a
string or numerical identifier, which identify entities. The first
element identifies a root entity, the second element identifies
a child of the root entity, the third element identifies a child of the
second entity, and so forth. The entities identified by all prefixes of
the path are called the element's ancestors.
An entity path is always fully complete: all of the entity's ancestors
are required to be in the path along with the entity identifier itself.
The only exception is that in some documented cases, the identifier in the
last path element (for the entity) itself may be omitted. For example,
the last path element of the key of Mutation.insert
may have no
identifier.
A path can never be empty, and a path can have at most 100 elements.
Corresponds to the JSON property path
957 958 959 |
# File 'generated/google/apis/datastore_v1beta3/classes.rb', line 957 def path @path end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
964 965 966 967 |
# File 'generated/google/apis/datastore_v1beta3/classes.rb', line 964 def update!(**args) @partition_id = args[:partition_id] if args.key?(:partition_id) @path = args[:path] if args.key?(:path) end |