@ -151,7 +151,7 @@ func NewSQLExpression() *SQLExpression {
}
type QueryEditorFunctionExpression struct {
Type string ` json:"type" `
Type QueryEditorExpressionType ` json:"type" `
Name * string ` json:"name,omitempty" `
Parameters [ ] QueryEditorFunctionParameterExpression ` json:"parameters,omitempty" `
}
@ -159,63 +159,81 @@ type QueryEditorFunctionExpression struct {
// NewQueryEditorFunctionExpression creates a new QueryEditorFunctionExpression object.
func NewQueryEditorFunctionExpression ( ) * QueryEditorFunctionExpression {
return & QueryEditorFunctionExpression {
Type : "function" ,
Type : QueryEditorExpressionTypeFunction ,
}
}
type QueryEditorExpressionType string
const (
QueryEditorExpressionTypeProperty QueryEditorExpressionType = "property"
QueryEditorExpressionTypeOperator QueryEditorExpressionType = "operator"
QueryEditorExpressionTypeOr QueryEditorExpressionType = "or"
QueryEditorExpressionTypeAnd QueryEditorExpressionType = "and"
QueryEditorExpressionTypeGroupBy QueryEditorExpressionType = "groupBy"
QueryEditorExpressionTypeFunction QueryEditorExpressionType = "function"
QueryEditorExpressionTypeFunctionParameter QueryEditorExpressionType = "functionParameter"
)
type QueryEditorFunctionParameterExpression struct {
Type string ` json:"type" `
Name * string ` json:"name,omitempty" `
Type QueryEditorExpressionType ` json:"type" `
Name * string ` json:"name,omitempty" `
}
// NewQueryEditorFunctionParameterExpression creates a new QueryEditorFunctionParameterExpression object.
func NewQueryEditorFunctionParameterExpression ( ) * QueryEditorFunctionParameterExpression {
return & QueryEditorFunctionParameterExpression {
Type : "functionParameter" ,
Type : QueryEditorExpressionTypeFunctionParameter ,
}
}
type QueryEditorPropertyExpression struct {
Type string ` json:"type" `
Property QueryEditorProperty ` json:"property" `
Type QueryEditorExpressionType ` json:"type" `
Property QueryEditorProperty ` json:"property" `
}
// NewQueryEditorPropertyExpression creates a new QueryEditorPropertyExpression object.
func NewQueryEditorPropertyExpression ( ) * QueryEditorPropertyExpression {
return & QueryEditorPropertyExpression {
Type : "property" ,
Type : QueryEditorExpressionTypeProperty ,
Property : * NewQueryEditorProperty ( ) ,
}
}
type QueryEditorProperty struct {
Type QueryEditorPropertyType ` json:"type" `
Name * string ` json:"name,omitempty" `
}
// NewQueryEditorProperty creates a new QueryEditorProperty object.
func NewQueryEditorProperty ( ) * QueryEditorProperty {
return & QueryEditorProperty { }
}
type QueryEditorPropertyType string
const (
QueryEditorPropertyTypeString QueryEditorPropertyType = "string"
)
type QueryEditorArrayExpression struct {
Type QueryEditorArrayExpressionType ` json:"type" `
Expressions ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ` json:"expressions" `
}
// NewQueryEditorArrayExpression creates a new QueryEditorArrayExpression object.
func NewQueryEditorArrayExpression ( ) * QueryEditorArrayExpression {
return & QueryEditorArrayExpression {
Expressions : * NewArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ( ) ,
}
}
type QueryEditorExpression any
type QueryEditorGroupByExpression struct {
Type string ` json:"type" `
Property QueryEditorProperty ` json:"property" `
Type QueryEditorExpressionType ` json:"type" `
Property QueryEditorProperty ` json:"property" `
}
// NewQueryEditorGroupByExpression creates a new QueryEditorGroupByExpression object.
func NewQueryEditorGroupByExpression ( ) * QueryEditorGroupByExpression {
return & QueryEditorGroupByExpression {
Type : "groupBy" ,
Type : QueryEditorExpressionTypeGroupBy ,
Property : * NewQueryEditorProperty ( ) ,
}
}
type QueryEditorOperatorExpression struct {
Type string ` json:"type" `
Property QueryEditorProperty ` json:"property" `
Type QueryEditorExpressionType ` json:"type" `
Property QueryEditorProperty ` json:"property" `
// TS type is operator: QueryEditorOperator<QueryEditorOperatorValueType>, extended in veneer
Operator QueryEditorOperator ` json:"operator" `
}
@ -223,7 +241,7 @@ type QueryEditorOperatorExpression struct {
// NewQueryEditorOperatorExpression creates a new QueryEditorOperatorExpression object.
func NewQueryEditorOperatorExpression ( ) * QueryEditorOperatorExpression {
return & QueryEditorOperatorExpression {
Type : "operator" ,
Type : QueryEditorExpressionTypeOperator ,
Property : * NewQueryEditorProperty ( ) ,
Operator : * NewQueryEditorOperator ( ) ,
}
@ -240,13 +258,6 @@ func NewQueryEditorOperator() *QueryEditorOperator {
return & QueryEditorOperator { }
}
type QueryEditorOperatorValueType = StringOrBoolOrInt64OrArrayOfQueryEditorOperatorType
// NewQueryEditorOperatorValueType creates a new QueryEditorOperatorValueType object.
func NewQueryEditorOperatorValueType ( ) * QueryEditorOperatorValueType {
return NewStringOrBoolOrInt64OrArrayOfQueryEditorOperatorType ( )
}
type QueryEditorOperatorType = StringOrBoolOrInt64
// NewQueryEditorOperatorType creates a new QueryEditorOperatorType object.
@ -254,36 +265,25 @@ func NewQueryEditorOperatorType() *QueryEditorOperatorType {
return NewStringOrBoolOrInt64 ( )
}
type QueryEditorProperty struct {
Type QueryEditorPropertyType ` json:"type" `
Name * string ` json:"name,omitempty" `
}
// NewQueryEditorProperty creates a new QueryEditorProperty object.
func NewQueryEditorProperty ( ) * QueryEditorProperty {
return & QueryEditorProperty { }
}
type QueryEditorPropertyType string
type QueryEditorExpressionType string
const (
QueryEditorPropertyTypeString QueryEditorPropertyType = "string"
QueryEditorExpressionTypeProperty QueryEditorExpressionType = "property"
QueryEditorExpressionTypeOperator QueryEditorExpressionType = "operator"
QueryEditorExpressionTypeOr QueryEditorExpressionType = "or"
QueryEditorExpressionTypeAnd QueryEditorExpressionType = "and"
QueryEditorExpressionTypeGroupBy QueryEditorExpressionType = "groupBy"
QueryEditorExpressionTypeFunction QueryEditorExpressionType = "function"
QueryEditorExpressionTypeFunctionParameter QueryEditorExpressionType = "functionParameter"
)
type QueryEditorArrayExpression struct {
Type QueryEditorArrayExpressionType ` json:"type" `
Expressions ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ` json:"expressions" `
}
type QueryEditorOperatorValueType = StringOrBoolOrInt64OrArrayOfQueryEditorOperatorType
// NewQueryEditorArrayExpression creates a new QueryEditorArrayExpression object.
func NewQueryEditorArrayExpression ( ) * QueryEditorArrayExpression {
return & QueryEditorArrayExpression {
Expressions : * NewArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ( ) ,
}
// NewQueryEditorOperatorValueType creates a new QueryEditorOperatorValueType object.
func NewQueryEditorOperatorValueType ( ) * QueryEditorOperatorValueType {
return NewStringOrBoolOrInt64OrArrayOfQueryEditorOperatorType ( )
}
type QueryEditorExpression any
type LogsQueryLanguage string
const (
@ -525,6 +525,60 @@ func (resource *QueryEditorPropertyExpressionOrQueryEditorFunctionExpression) Un
return fmt . Errorf ( "could not unmarshal resource with `type = %v`" , discriminator )
}
type ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression struct {
ArrayOfQueryEditorExpression [ ] QueryEditorExpression ` json:"ArrayOfQueryEditorExpression,omitempty" `
ArrayOfQueryEditorArrayExpression [ ] QueryEditorArrayExpression ` json:"ArrayOfQueryEditorArrayExpression,omitempty" `
}
// NewArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression creates a new ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression object.
func NewArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ( ) * ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression {
return & ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression { }
}
// MarshalJSON implements a custom JSON marshalling logic to encode `ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression` as JSON.
func ( resource ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ) MarshalJSON ( ) ( [ ] byte , error ) {
if resource . ArrayOfQueryEditorExpression != nil {
return json . Marshal ( resource . ArrayOfQueryEditorExpression )
}
if resource . ArrayOfQueryEditorArrayExpression != nil {
return json . Marshal ( resource . ArrayOfQueryEditorArrayExpression )
}
return nil , fmt . Errorf ( "no value for disjunction of scalars" )
}
// UnmarshalJSON implements a custom JSON unmarshalling logic to decode `ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression` from JSON.
func ( resource * ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ) UnmarshalJSON ( raw [ ] byte ) error {
if raw == nil {
return nil
}
var errList [ ] error
// ArrayOfQueryEditorExpression
var ArrayOfQueryEditorExpression [ ] QueryEditorExpression
if err := json . Unmarshal ( raw , & ArrayOfQueryEditorExpression ) ; err != nil {
errList = append ( errList , err )
resource . ArrayOfQueryEditorExpression = nil
} else {
resource . ArrayOfQueryEditorExpression = ArrayOfQueryEditorExpression
return nil
}
// ArrayOfQueryEditorArrayExpression
var ArrayOfQueryEditorArrayExpression [ ] QueryEditorArrayExpression
if err := json . Unmarshal ( raw , & ArrayOfQueryEditorArrayExpression ) ; err != nil {
errList = append ( errList , err )
resource . ArrayOfQueryEditorArrayExpression = nil
} else {
resource . ArrayOfQueryEditorArrayExpression = ArrayOfQueryEditorArrayExpression
return nil
}
return errors . Join ( errList ... )
}
type StringOrBoolOrInt64OrArrayOfQueryEditorOperatorType struct {
String * string ` json:"String,omitempty" `
Bool * bool ` json:"Bool,omitempty" `
@ -677,57 +731,3 @@ func (resource *StringOrBoolOrInt64) UnmarshalJSON(raw []byte) error {
return errors . Join ( errList ... )
}
type ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression struct {
ArrayOfQueryEditorExpression [ ] QueryEditorExpression ` json:"ArrayOfQueryEditorExpression,omitempty" `
ArrayOfQueryEditorArrayExpression [ ] QueryEditorArrayExpression ` json:"ArrayOfQueryEditorArrayExpression,omitempty" `
}
// NewArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression creates a new ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression object.
func NewArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ( ) * ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression {
return & ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression { }
}
// MarshalJSON implements a custom JSON marshalling logic to encode `ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression` as JSON.
func ( resource ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ) MarshalJSON ( ) ( [ ] byte , error ) {
if resource . ArrayOfQueryEditorExpression != nil {
return json . Marshal ( resource . ArrayOfQueryEditorExpression )
}
if resource . ArrayOfQueryEditorArrayExpression != nil {
return json . Marshal ( resource . ArrayOfQueryEditorArrayExpression )
}
return nil , fmt . Errorf ( "no value for disjunction of scalars" )
}
// UnmarshalJSON implements a custom JSON unmarshalling logic to decode `ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression` from JSON.
func ( resource * ArrayOfQueryEditorExpressionOrArrayOfQueryEditorArrayExpression ) UnmarshalJSON ( raw [ ] byte ) error {
if raw == nil {
return nil
}
var errList [ ] error
// ArrayOfQueryEditorExpression
var ArrayOfQueryEditorExpression [ ] QueryEditorExpression
if err := json . Unmarshal ( raw , & ArrayOfQueryEditorExpression ) ; err != nil {
errList = append ( errList , err )
resource . ArrayOfQueryEditorExpression = nil
} else {
resource . ArrayOfQueryEditorExpression = ArrayOfQueryEditorExpression
return nil
}
// ArrayOfQueryEditorArrayExpression
var ArrayOfQueryEditorArrayExpression [ ] QueryEditorArrayExpression
if err := json . Unmarshal ( raw , & ArrayOfQueryEditorArrayExpression ) ; err != nil {
errList = append ( errList , err )
resource . ArrayOfQueryEditorArrayExpression = nil
} else {
resource . ArrayOfQueryEditorArrayExpression = ArrayOfQueryEditorArrayExpression
return nil
}
return errors . Join ( errList ... )
}