| 1 |
# Copyright 2025 Google LLC |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
# you may not use this file except in compliance with the License. |
| 5 |
# You may obtain a copy of the License at |
| 6 |
# |
| 7 |
# https://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
# See the License for the specific language governing permissions and |
| 13 |
# limitations under the License. |
| 14 |
|
| 15 |
name: "context-env" |
| 16 |
container: "google.expr" |
| 17 |
imports: |
| 18 |
- name: "google.expr.proto3.test.TestAllTypes" |
| 19 |
stdlib: |
| 20 |
include_macros: |
| 21 |
- has |
| 22 |
include_functions: |
| 23 |
- name: "_==_" |
| 24 |
- name: "_!=_" |
| 25 |
- name: "!_" |
| 26 |
- name: "_<_" |
| 27 |
- name: "_<=_" |
| 28 |
- name: "_>_" |
| 29 |
- name: "_>=_" |
| 30 |
extensions: |
| 31 |
- name: "optional" |
| 32 |
version: "latest" |
| 33 |
- name: "strings" |
| 34 |
version: 1 |
| 35 |
context_variable: |
| 36 |
type_name: "google.expr.proto3.test.TestAllTypes" |
| 37 |
functions: |
| 38 |
- name: "coalesce" |
| 39 |
description: "Converts a potentially null wrapper-type to a default value." |
| 40 |
overloads: |
| 41 |
- id: "coalesce_wrapped_int" |
| 42 |
examples: |
| 43 |
- "coalesce(null, 1) // 1" |
| 44 |
- "coalesce(2, 1) // 2" |
| 45 |
args: |
| 46 |
- type_name: "google.protobuf.Int64Value" |
| 47 |
- type_name: "int" |
| 48 |
return: |
| 49 |
type_name: "int" |
| 50 |
- id: "coalesce_wrapped_double" |
| 51 |
examples: |
| 52 |
- "coalesce(null, 1.3) // 1.3" |
| 53 |
args: |
| 54 |
- type_name: "google.protobuf.DoubleValue" |
| 55 |
- type_name: "double" |
| 56 |
return: |
| 57 |
type_name: "double" |
| 58 |
- id: "coalesce_wrapped_uint" |
| 59 |
examples: |
| 60 |
- "coalesce(null, 14u) // 14u" |
| 61 |
args: |
| 62 |
- type_name: "google.protobuf.UInt64Value" |
| 63 |
- type_name: "uint" |
| 64 |
return: |
| 65 |
type_name: "uint" |