BigQuery API - Class Google::Cloud::Bigquery::Condition (v1.55.0)

Reference documentation and code samples for the BigQuery API class Google::Cloud::Bigquery::Condition.

Condition

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

Used to define condition for Dataset::Access rules

Inherits

  • Object

Methods

#description

def description() -> String, nil

Returns the optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

Returns
  • (String, nil) — The description of the condition. nil if not set.
Example
condition = Google::Cloud::Bigquery::Condition.new(
  "document.summary.size() < 100",
  description: "Checks if summary is less than 100 chars"
)
puts condition.description # => "Checks if summary is less than 100 chars"

#description=

def description=(val)

Sets the optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.

Parameter
  • val (String, nil) — The description to set. nil to unset.
Example
condition = Google::Cloud::Bigquery::Condition.new(
  "document.summary.size() < 100"
)
condition.description = "Checks if summary is less than 100 chars"

#expression

def expression() -> String

Returns the textual representation of an expression in Common Expression Language syntax.

Returns
  • (String) — The expression of the condition.
Example
condition = Google::Cloud::Bigquery::Condition.new(
  "resource.name.startsWith('projects/my-project')"
)
puts condition.expression # => "resource.name.startsWith('projects/my-project')"

#expression=

def expression=(val)

Sets the textual representation of an expression in Common Expression Language syntax.

Parameter
  • val (String) — The expression to set.
Raises
  • (ArgumentError) — if the expression is nil or empty.
Example
condition = Google::Cloud::Bigquery::Condition.new(
  "resource.name.startsWith('projects/my-project')"
)
condition.expression = "document.summary.size() < 100"

#initialize

def initialize(expression, description: nil, location: nil, title: nil) -> Condition

Create a new Condition object.

Parameters
  • expression (String) — The expression in CEL syntax.
  • description (String) (defaults to: nil) — Optional description of the expression.
  • location (String) (defaults to: nil) — Optional location of the expression for error reporting.
  • title (String) (defaults to: nil) — Optional title for the expression.
Returns
  • (Condition) — a new instance of Condition
Raises
  • (ArgumentError) — if expression is nil or empty.
Example
condition = Google::Cloud::Bigquery::Condition.new(
  "document.summary.size() < 100",
  description: "Determines if a summary is less than 100 chars",
  location: "document/summary",
  title: "Summary size limit"
)

#location

def location() -> String, nil

Returns the optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.

Returns
  • (String, nil) — The location of the condition. nil if not set.
Example
condition = Google::Cloud::Bigquery::Condition.new(
  "document.summary.size() < 100",
  location: "document/summary"
)
puts condition.location # => "document/summary"

#location=

def location=(val)

Sets the optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file.

Parameter
  • val (String, nil) — The location to set. nil to unset.
Example
condition = Google::Cloud::Bigquery::Condition.new(
  "document.summary.size() < 100"
)
condition.location = "document/summary"

#title

def title() -> String, nil

Returns the optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.

Returns
  • (String, nil) — The title of the condition. nil if not set.
Example
condition = Google::Cloud::Bigquery::Condition.new(
  "document.summary.size() < 100",
  title: "Summary size limit"
)
puts condition.title # => "Summary size limit"

#title=

def title=(val)

Sets the optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.

Parameter
  • val (String, nil) — The title to set. nil to unset.
Example
condition = Google::Cloud::Bigquery::Condition.new(
  "document.summary.size() < 100"
)
condition.title = "Summary size limit"