Reference documentation and code samples for the Google Cloud Artifact Registry V1 Client class Tag.
Tags point to a version and represent an alternative name that can be used
to access the version.
Generated from protobuf messagegoogle.devtools.artifactregistry.v1.Tag
Namespace
Google \ Cloud \ ArtifactRegistry \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ name
string
The name of the tag, for example: "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". If the package part contains slashes, the slashes are escaped. The tag part can only have characters in [a-zA-Z0-9-._~:@], anything else must be URL encoded.
↳ version
string
The name of the version the tag refers to, for example:projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811If the package or version ID parts contain slashes, the slashes are escaped.
getName
The name of the tag, for example:
"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1".
If the package part contains slashes, the slashes are escaped.
The tag part can only have characters in [a-zA-Z0-9-._~:@], anything else
must be URL encoded.
Returns
Type
Description
string
setName
The name of the tag, for example:
"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1".
If the package part contains slashes, the slashes are escaped.
The tag part can only have characters in [a-zA-Z0-9-._~:@], anything else
must be URL encoded.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getVersion
The name of the version the tag refers to, for example:projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811If the package or version ID parts contain slashes, the slashes are
escaped.
Returns
Type
Description
string
setVersion
The name of the version the tag refers to, for example:projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811If the package or version ID parts contain slashes, the slashes are
escaped.
[[["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,["# Google Cloud Artifact Registry V1 Client - Class Tag (1.2.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.1 (latest)](/php/docs/reference/cloud-artifact-registry/latest/V1.Tag)\n- [1.2.0](/php/docs/reference/cloud-artifact-registry/1.2.0/V1.Tag)\n- [1.1.3](/php/docs/reference/cloud-artifact-registry/1.1.3/V1.Tag)\n- [1.0.0](/php/docs/reference/cloud-artifact-registry/1.0.0/V1.Tag)\n- [0.6.5](/php/docs/reference/cloud-artifact-registry/0.6.5/V1.Tag)\n- [0.5.1](/php/docs/reference/cloud-artifact-registry/0.5.1/V1.Tag)\n- [0.4.4](/php/docs/reference/cloud-artifact-registry/0.4.4/V1.Tag)\n- [0.3.13](/php/docs/reference/cloud-artifact-registry/0.3.13/V1.Tag) \nReference documentation and code samples for the Google Cloud Artifact Registry V1 Client class Tag.\n\nTags point to a version and represent an alternative name that can be used\nto access the version.\n\nGenerated from protobuf message `google.devtools.artifactregistry.v1.Tag`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ ArtifactRegistry \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nThe name of the tag, for example:\n\"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1\".\n\nIf the package part contains slashes, the slashes are escaped.\nThe tag part can only have characters in \\[a-zA-Z0-9-._\\~:@\\], anything else\nmust be URL encoded.\n\n### setName\n\nThe name of the tag, for example:\n\"projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1\".\n\nIf the package part contains slashes, the slashes are escaped.\nThe tag part can only have characters in \\[a-zA-Z0-9-._\\~:@\\], anything else\nmust be URL encoded.\n\n### getVersion\n\nThe name of the version the tag refers to, for example:\n`projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811`\nIf the package or version ID parts contain slashes, the slashes are\nescaped.\n\n### setVersion\n\nThe name of the version the tag refers to, for example:\n`projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811`\nIf the package or version ID parts contain slashes, the slashes are\nescaped."]]