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.
Attributes
Name
Description
name
str
The name of the rule, for example:
projects/p1/locations/us-central1/repositories/repo1/rules/rule1.
google.type.expr_pb2.Expr
Optional. A CEL expression for conditions
that must be met in order for the rule to apply.
If not provided, the rule matches all objects.
package_id
str
The package ID the rule applies to.
If empty, this rule applies to all packages
inside the repository.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class Rule (1.16.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.16.1 (latest)](/python/docs/reference/artifactregistry/latest/google.cloud.artifactregistry_v1.types.Rule)\n- [1.16.0](/python/docs/reference/artifactregistry/1.16.0/google.cloud.artifactregistry_v1.types.Rule)\n- [1.15.2](/python/docs/reference/artifactregistry/1.15.2/google.cloud.artifactregistry_v1.types.Rule)\n- [1.14.0](/python/docs/reference/artifactregistry/1.14.0/google.cloud.artifactregistry_v1.types.Rule)\n- [1.13.1](/python/docs/reference/artifactregistry/1.13.1/google.cloud.artifactregistry_v1.types.Rule)\n- [1.12.0](/python/docs/reference/artifactregistry/1.12.0/google.cloud.artifactregistry_v1.types.Rule)\n- [1.11.5](/python/docs/reference/artifactregistry/1.11.5/google.cloud.artifactregistry_v1.types.Rule)\n- [1.10.0](/python/docs/reference/artifactregistry/1.10.0/google.cloud.artifactregistry_v1.types.Rule)\n- [1.9.0](/python/docs/reference/artifactregistry/1.9.0/google.cloud.artifactregistry_v1.types.Rule)\n- [1.8.4](/python/docs/reference/artifactregistry/1.8.4/google.cloud.artifactregistry_v1.types.Rule)\n- [1.7.0](/python/docs/reference/artifactregistry/1.7.0/google.cloud.artifactregistry_v1.types.Rule)\n- [1.6.1](/python/docs/reference/artifactregistry/1.6.1/google.cloud.artifactregistry_v1.types.Rule)\n- [1.5.0](/python/docs/reference/artifactregistry/1.5.0/google.cloud.artifactregistry_v1.types.Rule)\n- [1.4.1](/python/docs/reference/artifactregistry/1.4.1/google.cloud.artifactregistry_v1.types.Rule)\n- [1.3.3](/python/docs/reference/artifactregistry/1.3.3/google.cloud.artifactregistry_v1.types.Rule)\n- [1.2.1](/python/docs/reference/artifactregistry/1.2.1/google.cloud.artifactregistry_v1.types.Rule)\n- [1.1.2](/python/docs/reference/artifactregistry/1.1.2/google.cloud.artifactregistry_v1.types.Rule)\n- [1.0.2](/python/docs/reference/artifactregistry/1.0.2/google.cloud.artifactregistry_v1.types.Rule)\n- [0.5.0](/python/docs/reference/artifactregistry/0.5.0/google.cloud.artifactregistry_v1.types.Rule)\n- [0.4.1](/python/docs/reference/artifactregistry/0.4.1/google.cloud.artifactregistry_v1.types.Rule)\n- [0.3.3](/python/docs/reference/artifactregistry/0.3.3/google.cloud.artifactregistry_v1.types.Rule)\n- [0.2.2](/python/docs/reference/artifactregistry/0.2.2/google.cloud.artifactregistry_v1.types.Rule)\n- [0.1.0](/python/docs/reference/artifactregistry/0.1.0/google.cloud.artifactregistry_v1.types.Rule) \n\n Rule(mapping=None, *, ignore_unknown_fields=False, **kwargs)\n\nA rule defines the deny or allow action of the operation it\napplies to and the conditions required for the rule to apply.\nYou can set one rule for an entire repository and one rule for\neach package within.\n\nClasses\n-------\n\n### Action\n\n Action(value)\n\nDefines the action of the rule.\n\n### Operation\n\n Operation(value)\n\nThe operation the rule applies to."]]