Reference documentation and code samples for the Data Loss Prevention V2 Client class Tag.
A tag associated with a resource.
Generated from protobuf messagegoogle.privacy.dlp.v2.Tag
Namespace
Google \ Cloud \ Dlp \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ namespaced_tag_value
string
The namespaced name for the tag value to attach to Google Cloud resources. Must be in the format{parent_id}/{tag_key_short_name}/{short_name}, for example, "123456/environment/prod". This is only set for Google Cloud resources.
↳ key
string
The key of a tag key-value pair. For Google Cloud resources, this is the resource name of the key, for example, "tagKeys/123456".
↳ value
string
The value of a tag key-value pair. For Google Cloud resources, this is the resource name of the value, for example, "tagValues/123456".
getNamespacedTagValue
The namespaced name for the tag value to attach to Google Cloud resources.
Must be in the format{parent_id}/{tag_key_short_name}/{short_name}, for
example, "123456/environment/prod". This is only set for Google Cloud
resources.
Returns
Type
Description
string
setNamespacedTagValue
The namespaced name for the tag value to attach to Google Cloud resources.
Must be in the format{parent_id}/{tag_key_short_name}/{short_name}, for
example, "123456/environment/prod". This is only set for Google Cloud
resources.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getKey
The key of a tag key-value pair. For Google Cloud resources, this is the
resource name of the key, for example, "tagKeys/123456".
Returns
Type
Description
string
setKey
The key of a tag key-value pair. For Google Cloud resources, this is the
resource name of the key, for example, "tagKeys/123456".
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getValue
The value of a tag key-value pair. For Google Cloud resources, this is the
resource name of the value, for example, "tagValues/123456".
Returns
Type
Description
string
setValue
The value of a tag key-value pair. For Google Cloud resources, this is the
resource name of the value, for example, "tagValues/123456".
[[["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-09 UTC."],[],[],null,["# Data Loss Prevention V2 Client - Class Tag (2.6.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.6.1 (latest)](/php/docs/reference/cloud-dlp/latest/V2.Tag)\n- [2.6.0](/php/docs/reference/cloud-dlp/2.6.0/V2.Tag)\n- [2.4.1](/php/docs/reference/cloud-dlp/2.4.1/V2.Tag)\n- [2.3.0](/php/docs/reference/cloud-dlp/2.3.0/V2.Tag)\n- [2.2.3](/php/docs/reference/cloud-dlp/2.2.3/V2.Tag)\n- [2.1.0](/php/docs/reference/cloud-dlp/2.1.0/V2.Tag)\n- [2.0.0](/php/docs/reference/cloud-dlp/2.0.0/V2.Tag)\n- [1.19.0](/php/docs/reference/cloud-dlp/1.19.0/V2.Tag)\n- [1.18.0](/php/docs/reference/cloud-dlp/1.18.0/V2.Tag)\n- [1.17.0](/php/docs/reference/cloud-dlp/1.17.0/V2.Tag)\n- [1.16.0](/php/docs/reference/cloud-dlp/1.16.0/V2.Tag)\n- [1.15.1](/php/docs/reference/cloud-dlp/1.15.1/V2.Tag)\n- [1.14.0](/php/docs/reference/cloud-dlp/1.14.0/V2.Tag)\n- [1.13.2](/php/docs/reference/cloud-dlp/1.13.2/V2.Tag)\n- [1.12.0](/php/docs/reference/cloud-dlp/1.12.0/V2.Tag)\n- [1.11.0](/php/docs/reference/cloud-dlp/1.11.0/V2.Tag)\n- [1.10.2](/php/docs/reference/cloud-dlp/1.10.2/V2.Tag)\n- [1.9.0](/php/docs/reference/cloud-dlp/1.9.0/V2.Tag)\n- [1.8.6](/php/docs/reference/cloud-dlp/1.8.6/V2.Tag) \nReference documentation and code samples for the Data Loss Prevention V2 Client class Tag.\n\nA tag associated with a resource.\n\nGenerated from protobuf message `google.privacy.dlp.v2.Tag`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Dlp \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getNamespacedTagValue\n\nThe namespaced name for the tag value to attach to Google Cloud resources.\n\nMust be in the format `{parent_id}/{tag_key_short_name}/{short_name}`, for\nexample, \"123456/environment/prod\". This is only set for Google Cloud\nresources.\n\n### setNamespacedTagValue\n\nThe namespaced name for the tag value to attach to Google Cloud resources.\n\nMust be in the format `{parent_id}/{tag_key_short_name}/{short_name}`, for\nexample, \"123456/environment/prod\". This is only set for Google Cloud\nresources.\n\n### getKey\n\nThe key of a tag key-value pair. For Google Cloud resources, this is the\nresource name of the key, for example, \"tagKeys/123456\".\n\n### setKey\n\nThe key of a tag key-value pair. For Google Cloud resources, this is the\nresource name of the key, for example, \"tagKeys/123456\".\n\n### getValue\n\nThe value of a tag key-value pair. For Google Cloud resources, this is the\nresource name of the value, for example, \"tagValues/123456\".\n\n### setValue\n\nThe value of a tag key-value pair. For Google Cloud resources, this is the\nresource name of the value, for example, \"tagValues/123456\"."]]