Expression🔗
Definition🔗
class Expression implements \JsonSerializable
{
/**
* The type of query if this is a query expression
*/
public ?string $queryType;
public ?\Grafana\Foundation\Alertingv0alpha1\RelativeTimeRange $relativeTimeRange;
/**
* The UID of the datasource to run this expression against. If omitted, the expression will be run against the `__expr__` datasource
*/
public string $datasourceUID;
/**
* @var mixed
*/
public $model;
/**
* Used to mark the expression to be used as the final source for the rule evaluation
* Only one expression in a rule can be marked as the source
* For AlertRules, this is the expression that will be evaluated against the alerting condition
* For RecordingRules, this is the expression that will be recorded
*/
public ?bool $source;
}
Methods🔗
fromArray🔗
Builds this object from an array.
This function is meant to be used with the return value of json_decode($json, true).
jsonSerialize🔗
Returns the data representing this object, preparing it for JSON serialization with json_encode().