Reference documentation and code samples for the Google Cloud Artifact Registry V1 Client class Rule.
A rule defines the deny or allow action of the operation it applies to and
the conditions required for the rule to apply. You can set one rule for an
entire repository and one rule for each package within.
Generated from protobuf messagegoogle.devtools.artifactregistry.v1.Rule
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 rule, for example:projects/p1/locations/us-central1/repositories/repo1/rules/rule1.
[[["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 Rule (1.2.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.2.1 (latest)](/php/docs/reference/cloud-artifact-registry/latest/V1.Rule)\n- [1.2.0](/php/docs/reference/cloud-artifact-registry/1.2.0/V1.Rule)\n- [1.1.3](/php/docs/reference/cloud-artifact-registry/1.1.3/V1.Rule)\n- [1.0.0](/php/docs/reference/cloud-artifact-registry/1.0.0/V1.Rule)\n- [0.6.5](/php/docs/reference/cloud-artifact-registry/0.6.5/V1.Rule)\n- [0.5.1](/php/docs/reference/cloud-artifact-registry/0.5.1/V1.Rule)\n- [0.4.4](/php/docs/reference/cloud-artifact-registry/0.4.4/V1.Rule)\n- [0.3.13](/php/docs/reference/cloud-artifact-registry/0.3.13/V1.Rule) \nReference documentation and code samples for the Google Cloud Artifact Registry V1 Client class Rule.\n\nA rule defines the deny or allow action of the operation it applies to and\nthe conditions required for the rule to apply. You can set one rule for an\nentire repository and one rule for each package within.\n\nGenerated from protobuf message `google.devtools.artifactregistry.v1.Rule`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ ArtifactRegistry \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getName\n\nThe name of the rule, for example:\n`projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.\n\n### setName\n\nThe name of the rule, for example:\n`projects/p1/locations/us-central1/repositories/repo1/rules/rule1`.\n\n### getAction\n\nThe action this rule takes.\n\n### setAction\n\nThe action this rule takes.\n\n### getOperation\n\nGenerated from protobuf field `.google.devtools.artifactregistry.v1.Rule.Operation operation = 3;`\n\n### setOperation\n\nGenerated from protobuf field `.google.devtools.artifactregistry.v1.Rule.Operation operation = 3;`\n\n### getCondition\n\nOptional. A CEL expression for conditions that must be met in order for the\nrule to apply. If not provided, the rule matches all objects.\n\n### hasCondition\n\n### clearCondition\n\n### setCondition\n\nOptional. A CEL expression for conditions that must be met in order for the\nrule to apply. If not provided, the rule matches all objects.\n\n### getPackageId\n\nThe package ID the rule applies to.\n\nIf empty, this rule applies to all packages inside the repository.\n\n### setPackageId\n\nThe package ID the rule applies to.\n\nIf empty, this rule applies to all packages inside the repository."]]