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
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")putscondition.description# => "Checks if summary is less than 100 chars"
#description=
defdescription=(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
defexpression()->String
Returns the textual representation of an expression in Common Expression Language syntax.
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
deflocation()->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.
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.
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.
[[["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-27 UTC."],[],[],null,["# BigQuery API - Class Google::Cloud::Bigquery::Condition (v1.55.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.55.0 (latest)](/ruby/docs/reference/google-cloud-bigquery/latest/Google-Cloud-Bigquery-Condition)\n- [1.54.0](/ruby/docs/reference/google-cloud-bigquery/1.54.0/Google-Cloud-Bigquery-Condition)\n- [1.53.0](/ruby/docs/reference/google-cloud-bigquery/1.53.0/Google-Cloud-Bigquery-Condition)\n- [1.52.1](/ruby/docs/reference/google-cloud-bigquery/1.52.1/Google-Cloud-Bigquery-Condition)\n- [1.51.1](/ruby/docs/reference/google-cloud-bigquery/1.51.1/Google-Cloud-Bigquery-Condition)\n- [1.50.0](/ruby/docs/reference/google-cloud-bigquery/1.50.0/Google-Cloud-Bigquery-Condition)\n- [1.49.1](/ruby/docs/reference/google-cloud-bigquery/1.49.1/Google-Cloud-Bigquery-Condition)\n- [1.48.1](/ruby/docs/reference/google-cloud-bigquery/1.48.1/Google-Cloud-Bigquery-Condition)\n- [1.47.0](/ruby/docs/reference/google-cloud-bigquery/1.47.0/Google-Cloud-Bigquery-Condition)\n- [1.46.1](/ruby/docs/reference/google-cloud-bigquery/1.46.1/Google-Cloud-Bigquery-Condition)\n- [1.45.0](/ruby/docs/reference/google-cloud-bigquery/1.45.0/Google-Cloud-Bigquery-Condition)\n- [1.44.2](/ruby/docs/reference/google-cloud-bigquery/1.44.2/Google-Cloud-Bigquery-Condition)\n- [1.43.1](/ruby/docs/reference/google-cloud-bigquery/1.43.1/Google-Cloud-Bigquery-Condition)\n- [1.42.0](/ruby/docs/reference/google-cloud-bigquery/1.42.0/Google-Cloud-Bigquery-Condition)\n- [1.41.0](/ruby/docs/reference/google-cloud-bigquery/1.41.0/Google-Cloud-Bigquery-Condition)\n- [1.40.0](/ruby/docs/reference/google-cloud-bigquery/1.40.0/Google-Cloud-Bigquery-Condition)\n- [1.39.0](/ruby/docs/reference/google-cloud-bigquery/1.39.0/Google-Cloud-Bigquery-Condition)\n- [1.38.1](/ruby/docs/reference/google-cloud-bigquery/1.38.1/Google-Cloud-Bigquery-Condition) \nReference documentation and code samples for the BigQuery API class Google::Cloud::Bigquery::Condition.\n\nCondition\n---------\n\nRepresents a textual expression in the Common Expression Language (CEL) syntax.\nCEL is a C-like expression language. The syntax and semantics of CEL are documented\nat \u003chttps://github.com/google/cel-spec\u003e\n\nUsed to define condition for [Dataset::Access](/ruby/docs/reference/google-cloud-bigquery/latest/Google-Cloud-Bigquery-Dataset-Access \"Google::Cloud::Bigquery::Dataset::Access (class)\") rules \n\nInherits\n--------\n\n- Object\n\nMethods\n-------\n\n### #description\n\n def description() -\u003e String, nil\n\nReturns the optional description of the expression. This is a longer text which describes\nthe expression, e.g. when hovered over it in a UI. \n**Returns**\n\n- (String, nil) --- The description of the condition. nil if not set.\n**Example** \n\n```ruby\ncondition = Google::Cloud::Bigquery::Condition.new(\n \"document.summary.size() \u003c 100\",\n description: \"Checks if summary is less than 100 chars\"\n)\nputs condition.description # =\u003e \"Checks if summary is less than 100 chars\"\n```\n\n### #description=\n\n def description=(val)\n\nSets the optional description of the expression. This is a longer text which describes\nthe expression, e.g. when hovered over it in a UI. \n**Parameter**\n\n- **val** (String, nil) --- The description to set. nil to unset.\n**Example** \n\n```ruby\ncondition = Google::Cloud::Bigquery::Condition.new(\n \"document.summary.size() \u003c 100\"\n)\ncondition.description = \"Checks if summary is less than 100 chars\"\n```\n\n### #expression\n\n def expression() -\u003e String\n\nReturns the textual representation of an expression in Common Expression Language syntax. \n**Returns**\n\n- (String) --- The expression of the condition.\n**Example** \n\n```ruby\ncondition = Google::Cloud::Bigquery::Condition.new(\n \"resource.name.startsWith('projects/my-project')\"\n)\nputs condition.expression # =\u003e \"resource.name.startsWith('projects/my-project')\"\n```\n\n### #expression=\n\n def expression=(val)\n\nSets the textual representation of an expression in Common Expression Language syntax. \n**Parameter**\n\n- **val** (String) --- The expression to set. \n**Raises**\n\n- (ArgumentError) --- if the expression is nil or empty.\n**Example** \n\n```ruby\ncondition = Google::Cloud::Bigquery::Condition.new(\n \"resource.name.startsWith('projects/my-project')\"\n)\ncondition.expression = \"document.summary.size() \u003c 100\"\n```\n\n### #initialize\n\n def initialize(expression, description: nil, location: nil, title: nil) -\u003e Condition\n\nCreate a new Condition object. \n**Parameters**\n\n- **expression** (String) --- The expression in CEL syntax.\n- **description** (String) *(defaults to: nil)* --- Optional description of the expression.\n- **location** (String) *(defaults to: nil)* --- Optional location of the expression for error reporting.\n- **title** (String) *(defaults to: nil)* --- Optional title for the expression. \n**Returns**\n\n- ([Condition](./Google-Cloud-Bigquery-Condition)) --- a new instance of Condition \n**Raises**\n\n- (ArgumentError) --- if expression is nil or empty.\n**Example** \n\n```ruby\ncondition = Google::Cloud::Bigquery::Condition.new(\n \"document.summary.size() \u003c 100\",\n description: \"Determines if a summary is less than 100 chars\",\n location: \"document/summary\",\n title: \"Summary size limit\"\n)\n```\n\n### #location\n\n def location() -\u003e String, nil\n\nReturns the optional string indicating the location of the expression for error reporting,\ne.g. a file name and a position in the file. \n**Returns**\n\n- (String, nil) --- The location of the condition. nil if not set.\n**Example** \n\n```ruby\ncondition = Google::Cloud::Bigquery::Condition.new(\n \"document.summary.size() \u003c 100\",\n location: \"document/summary\"\n)\nputs condition.location # =\u003e \"document/summary\"\n```\n\n### #location=\n\n def location=(val)\n\nSets the optional string indicating the location of the expression for error reporting,\ne.g. a file name and a position in the file. \n**Parameter**\n\n- **val** (String, nil) --- The location to set. nil to unset.\n**Example** \n\n```ruby\ncondition = Google::Cloud::Bigquery::Condition.new(\n \"document.summary.size() \u003c 100\"\n)\ncondition.location = \"document/summary\"\n```\n\n### #title\n\n def title() -\u003e String, nil\n\nReturns the optional title for the expression, i.e. a short string describing its purpose.\nThis can be used e.g. in UIs which allow to enter the expression. \n**Returns**\n\n- (String, nil) --- The title of the condition. nil if not set.\n**Example** \n\n```ruby\ncondition = Google::Cloud::Bigquery::Condition.new(\n \"document.summary.size() \u003c 100\",\n title: \"Summary size limit\"\n)\nputs condition.title # =\u003e \"Summary size limit\"\n```\n\n### #title=\n\n def title=(val)\n\nSets the optional title for the expression, i.e. a short string describing its purpose.\nThis can be used e.g. in UIs which allow to enter the expression. \n**Parameter**\n\n- **val** (String, nil) --- The title to set. nil to unset.\n**Example** \n\n```ruby\ncondition = Google::Cloud::Bigquery::Condition.new(\n \"document.summary.size() \u003c 100\"\n)\ncondition.title = \"Summary size limit\"\n```"]]