From 52d9c8e8ecd1901722df682c889facc4d39f66a3 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Fri, 21 May 2021 17:12:55 -0500 Subject: [PATCH] [filtering] add "has_parent" query field (#84) --- go/v1beta1/storage/filtering/types.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/go/v1beta1/storage/filtering/types.go b/go/v1beta1/storage/filtering/types.go index e66b1a3..1d699c9 100644 --- a/go/v1beta1/storage/filtering/types.go +++ b/go/v1beta1/storage/filtering/types.go @@ -22,6 +22,7 @@ type Query struct { QueryString *QueryString `json:"query_string,omitempty"` Nested *Nested `json:"nested,omitempty"` Range *Range `json:"range,omitempty"` + HasParent *HasParent `json:"has_parent,omitempty"` } // Bool holds a general query that carries any number of @@ -58,6 +59,12 @@ type Nested struct { // Holds an operator that evaluates a range for comparisons type Range map[string]*RangeOperator +// HasParent is used to query for resources that use a join field and have a parent resource +type HasParent struct { + ParentType string `json:"parent_type"` + Query *Query `json:"query"` +} + type RangeOperator struct { Greater string `json:"gt,omitempty"` GreaterEquals string `json:"gte,omitempty"`