| 1 |
# Copyright 2024 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: "limits" |
| 16 |
rule: |
| 17 |
variables: |
| 18 |
- name: "greeting" |
| 19 |
expression: "'hello'" |
| 20 |
- name: "farewell" |
| 21 |
expression: "'goodbye'" |
| 22 |
- name: "person" |
| 23 |
expression: "'me'" |
| 24 |
- name: "message_fmt" |
| 25 |
expression: "'%s, %s'" |
| 26 |
match: |
| 27 |
- condition: | |
| 28 |
now.getHours() >= 20 |
| 29 |
rule: |
| 30 |
id: "farewells" |
| 31 |
variables: |
| 32 |
- name: "message" |
| 33 |
expression: > |
| 34 |
variables.message_fmt.format([variables.farewell, |
| 35 |
variables.person]) |
| 36 |
match: |
| 37 |
- condition: > |
| 38 |
now.getHours() < 21 |
| 39 |
output: variables.message + "!" |
| 40 |
- condition: > |
| 41 |
now.getHours() < 22 |
| 42 |
output: variables.message + "!!" |
| 43 |
- condition: > |
| 44 |
now.getHours() < 24 |
| 45 |
output: variables.message + "!!!" |
| 46 |
- output: > |
| 47 |
variables.message_fmt.format([variables.greeting, variables.person]) |