Google Cloud Artifact Registry V1 Client - Class Rule (1.2.1)

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 message google.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 .

↳ action
int

The action this rule takes.

↳ operation
int
↳ condition
Google\Type\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
string

The package ID the rule applies to. If empty, this rule applies to all packages inside the repository.

getName

The name of the rule, for example: projects/p1/locations/us-central1/repositories/repo1/rules/rule1 .

Returns
Type
Description
string

setName

The name of the rule, for example: projects/p1/locations/us-central1/repositories/repo1/rules/rule1 .

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getAction

The action this rule takes.

Returns
Type
Description
int

setAction

The action this rule takes.

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getOperation

Generated from protobuf field .google.devtools.artifactregistry.v1.Rule.Operation operation = 3;

Returns
Type
Description
int

setOperation

Generated from protobuf field .google.devtools.artifactregistry.v1.Rule.Operation operation = 3;

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getCondition

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.

Returns
Type
Description

hasCondition

clearCondition

setCondition

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.

Parameter
Name
Description
Returns
Type
Description
$this

getPackageId

The package ID the rule applies to.

If empty, this rule applies to all packages inside the repository.

Returns
Type
Description
string

setPackageId

The package ID the rule applies to.

If empty, this rule applies to all packages inside the repository.

Parameter
Name
Description
var
string
Returns
Type
Description
$this
Create a Mobile Website
View Site in Mobile | Classic
Share by: