Class: Google::Apis::ArtifactregistryV1::GoogleDevtoolsArtifactregistryV1Rule

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/artifactregistry_v1/classes.rb,
lib/google/apis/artifactregistry_v1/representations.rb,
lib/google/apis/artifactregistry_v1/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleDevtoolsArtifactregistryV1Rule

Returns a new instance of GoogleDevtoolsArtifactregistryV1Rule.



1191
1192
1193
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 1191

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#actionString

The action this rule takes. Corresponds to the JSON property action

Returns:

  • (String)


1153
1154
1155
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 1153

def action
  @action
end

#conditionGoogle::Apis::ArtifactregistryV1::Expr

Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: " Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example ( Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. Corresponds to the JSON property condition



1172
1173
1174
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 1172

def condition
  @condition
end

#nameString

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

Returns:

  • (String)


1178
1179
1180
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 1178

def name
  @name
end

#operationString

Corresponds to the JSON property operation

Returns:

  • (String)


1183
1184
1185
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 1183

def operation
  @operation
end

#package_idString

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

Returns:

  • (String)


1189
1190
1191
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 1189

def package_id
  @package_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1196
1197
1198
1199
1200
1201
1202
# File 'lib/google/apis/artifactregistry_v1/classes.rb', line 1196

def update!(**args)
  @action = args[:action] if args.key?(:action)
  @condition = args[:condition] if args.key?(:condition)
  @name = args[:name] if args.key?(:name)
  @operation = args[:operation] if args.key?(:operation)
  @package_id = args[:package_id] if args.key?(:package_id)
end