Reference documentation and code samples for the Cloud Data Loss Prevention (DLP) V2 API class Google::Cloud::Dlp::V2::Key.
A unique identifier for a Datastore 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.
(::Google::Cloud::Dlp::V2::PartitionId) — Entities are partitioned into subsets, currently identified by a project
ID and namespace ID.
Queries are scoped to a single partition.
value(::Google::Cloud::Dlp::V2::PartitionId) — Entities are partitioned into subsets, currently identified by a project
ID and namespace ID.
Queries are scoped to a single partition.
Returns
(::Google::Cloud::Dlp::V2::PartitionId) — Entities are partitioned into subsets, currently identified by a project
ID and namespace ID.
Queries are scoped to a single partition.
(::Array<::Google::Cloud::Dlp::V2::Key::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 aroot entity, the second element identifies
achildof 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'sancestors.
A path can never be empty, and a path can have at most 100 elements.
value(::Array<::Google::Cloud::Dlp::V2::Key::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 aroot entity, the second element identifies
achildof 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'sancestors.
A path can never be empty, and a path can have at most 100 elements.
Returns
(::Array<::Google::Cloud::Dlp::V2::Key::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 aroot entity, the second element identifies
achildof 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'sancestors.
A path can never be empty, and a path can have at most 100 elements.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Data Loss Prevention (DLP) V2 API - Class Google::Cloud::Dlp::V2::Key (v1.12.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.12.1 (latest)](/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-Key)\n- [1.12.0](/ruby/docs/reference/google-cloud-dlp-v2/1.12.0/Google-Cloud-Dlp-V2-Key)\n- [1.11.0](/ruby/docs/reference/google-cloud-dlp-v2/1.11.0/Google-Cloud-Dlp-V2-Key)\n- [1.10.0](/ruby/docs/reference/google-cloud-dlp-v2/1.10.0/Google-Cloud-Dlp-V2-Key)\n- [1.9.1](/ruby/docs/reference/google-cloud-dlp-v2/1.9.1/Google-Cloud-Dlp-V2-Key)\n- [1.8.0](/ruby/docs/reference/google-cloud-dlp-v2/1.8.0/Google-Cloud-Dlp-V2-Key)\n- [1.7.0](/ruby/docs/reference/google-cloud-dlp-v2/1.7.0/Google-Cloud-Dlp-V2-Key)\n- [1.6.0](/ruby/docs/reference/google-cloud-dlp-v2/1.6.0/Google-Cloud-Dlp-V2-Key)\n- [1.5.0](/ruby/docs/reference/google-cloud-dlp-v2/1.5.0/Google-Cloud-Dlp-V2-Key)\n- [1.4.0](/ruby/docs/reference/google-cloud-dlp-v2/1.4.0/Google-Cloud-Dlp-V2-Key)\n- [1.3.1](/ruby/docs/reference/google-cloud-dlp-v2/1.3.1/Google-Cloud-Dlp-V2-Key)\n- [1.2.0](/ruby/docs/reference/google-cloud-dlp-v2/1.2.0/Google-Cloud-Dlp-V2-Key)\n- [1.1.0](/ruby/docs/reference/google-cloud-dlp-v2/1.1.0/Google-Cloud-Dlp-V2-Key)\n- [1.0.0](/ruby/docs/reference/google-cloud-dlp-v2/1.0.0/Google-Cloud-Dlp-V2-Key)\n- [0.24.0](/ruby/docs/reference/google-cloud-dlp-v2/0.24.0/Google-Cloud-Dlp-V2-Key)\n- [0.23.0](/ruby/docs/reference/google-cloud-dlp-v2/0.23.0/Google-Cloud-Dlp-V2-Key)\n- [0.22.0](/ruby/docs/reference/google-cloud-dlp-v2/0.22.0/Google-Cloud-Dlp-V2-Key)\n- [0.21.0](/ruby/docs/reference/google-cloud-dlp-v2/0.21.0/Google-Cloud-Dlp-V2-Key)\n- [0.20.2](/ruby/docs/reference/google-cloud-dlp-v2/0.20.2/Google-Cloud-Dlp-V2-Key)\n- [0.19.0](/ruby/docs/reference/google-cloud-dlp-v2/0.19.0/Google-Cloud-Dlp-V2-Key)\n- [0.18.0](/ruby/docs/reference/google-cloud-dlp-v2/0.18.0/Google-Cloud-Dlp-V2-Key)\n- [0.17.0](/ruby/docs/reference/google-cloud-dlp-v2/0.17.0/Google-Cloud-Dlp-V2-Key)\n- [0.16.0](/ruby/docs/reference/google-cloud-dlp-v2/0.16.0/Google-Cloud-Dlp-V2-Key)\n- [0.15.0](/ruby/docs/reference/google-cloud-dlp-v2/0.15.0/Google-Cloud-Dlp-V2-Key)\n- [0.14.0](/ruby/docs/reference/google-cloud-dlp-v2/0.14.0/Google-Cloud-Dlp-V2-Key)\n- [0.13.1](/ruby/docs/reference/google-cloud-dlp-v2/0.13.1/Google-Cloud-Dlp-V2-Key)\n- [0.12.0](/ruby/docs/reference/google-cloud-dlp-v2/0.12.0/Google-Cloud-Dlp-V2-Key)\n- [0.11.0](/ruby/docs/reference/google-cloud-dlp-v2/0.11.0/Google-Cloud-Dlp-V2-Key)\n- [0.10.0](/ruby/docs/reference/google-cloud-dlp-v2/0.10.0/Google-Cloud-Dlp-V2-Key)\n- [0.9.0](/ruby/docs/reference/google-cloud-dlp-v2/0.9.0/Google-Cloud-Dlp-V2-Key)\n- [0.8.1](/ruby/docs/reference/google-cloud-dlp-v2/0.8.1/Google-Cloud-Dlp-V2-Key) \nReference documentation and code samples for the Cloud Data Loss Prevention (DLP) V2 API class Google::Cloud::Dlp::V2::Key.\n\nA unique identifier for a Datastore entity.\nIf a key's partition ID or any of its path kinds or names are\nreserved/read-only, the key is reserved/read-only.\nA reserved/read-only key is forbidden in certain documented contexts. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #partition_id\n\n def partition_id() -\u003e ::Google::Cloud::Dlp::V2::PartitionId\n\n**Returns**\n\n- ([::Google::Cloud::Dlp::V2::PartitionId](./Google-Cloud-Dlp-V2-PartitionId)) --- Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.\n\n### #partition_id=\n\n def partition_id=(value) -\u003e ::Google::Cloud::Dlp::V2::PartitionId\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Dlp::V2::PartitionId](./Google-Cloud-Dlp-V2-PartitionId)) --- Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition. \n**Returns**\n\n- ([::Google::Cloud::Dlp::V2::PartitionId](./Google-Cloud-Dlp-V2-PartitionId)) --- Entities are partitioned into subsets, currently identified by a project ID and namespace ID. Queries are scoped to a single partition.\n\n### #path\n\n def path() -\u003e ::Array\u003c::Google::Cloud::Dlp::V2::Key::PathElement\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Dlp::V2::Key::PathElement](./Google-Cloud-Dlp-V2-Key-PathElement)\\\u003e) --- 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* .\n\n\n A path can never be empty, and a path can have at most 100 elements.\n\n### #path=\n\n def path=(value) -\u003e ::Array\u003c::Google::Cloud::Dlp::V2::Key::PathElement\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::Dlp::V2::Key::PathElement](./Google-Cloud-Dlp-V2-Key-PathElement)\\\u003e) --- 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* .\n\n\nA path can never be empty, and a path can have at most 100 elements. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Dlp::V2::Key::PathElement](./Google-Cloud-Dlp-V2-Key-PathElement)\\\u003e) --- 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* .\n\n\n A path can never be empty, and a path can have at most 100 elements."]]