Documentation
¶
Index ¶
- Constants
- Variables
- func GetRecursiveFilterAttrType(depth, maxDepth int) map[string]attr.Type
- func GetRecursiveFilterSchema(depth, maxDepth int) map[string]schema.Attribute
- func NestedModelToSDKFilter(ctx context.Context, model *NestedFilterModel) filterTypes.Filter
- func RootModelToSDKFilter(ctx context.Context, model *RootFilterModel) filterTypes.FilterRoot
- type FilterGreaterOrLessThanInt64Model
- type FilterRangeInt64Model
- type NestedFilterModel
- type RootFilterModel
Constants ¶
const (
MaxFilterDepth int = 10
)
Variables ¶
var ( RootFilterAttributes = map[string]schema.Attribute{ "and": schema.ListNestedAttribute{ Optional: true, Computed: true, NestedObject: schema.NestedAttributeObject{ Attributes: rootFilterSchema, }, Default: listdefault.StaticValue( types.ListNull( types.ObjectType{ AttrTypes: rootFilterAttrType, }, ), ), }, "or": schema.ListNestedAttribute{ Optional: true, Computed: true, NestedObject: schema.NestedAttributeObject{ Attributes: rootFilterSchema, }, Default: listdefault.StaticValue( types.ListNull( types.ObjectType{ AttrTypes: rootFilterAttrType, }, ), ), }, } RootFilterAttrTypeMap = map[string]attr.Type{ "and": types.ListType{ ElemType: types.ObjectType{ AttrTypes: rootFilterAttrType, }, }, "or": types.ListType{ ElemType: types.ObjectType{ AttrTypes: rootFilterAttrType, }, }, } RootFilterWithNullChildren = types.ObjectValueMust( RootFilterAttrTypeMap, map[string]attr.Value{ "and": types.ListValueMust( types.ObjectType{ AttrTypes: rootFilterAttrType, }, []attr.Value{}, ), "or": types.ListValueMust( types.ObjectType{ AttrTypes: rootFilterAttrType, }, []attr.Value{}, ), }, ) )
Functions ¶
func GetRecursiveFilterAttrType ¶ added in v1.0.4
func GetRecursiveFilterSchema ¶ added in v1.0.4
func NestedModelToSDKFilter ¶ added in v1.0.4
func NestedModelToSDKFilter(ctx context.Context, model *NestedFilterModel) filterTypes.Filter
func RootModelToSDKFilter ¶ added in v1.0.4
func RootModelToSDKFilter(ctx context.Context, model *RootFilterModel) filterTypes.FilterRoot
Types ¶
type FilterGreaterOrLessThanInt64Model ¶
type FilterGreaterOrLessThanInt64Model struct {
Condition types.String `tfsdk:"condition"`
Value types.Int64 `tfsdk:"value"`
}
func (FilterGreaterOrLessThanInt64Model) Equals ¶ added in v1.0.4
func (m FilterGreaterOrLessThanInt64Model) Equals(other FilterGreaterOrLessThanInt64Model) bool
Equals returns true if all fields of the receiver match the corresponding fields of other. The Condition string field is compared case-insensitively.
type FilterRangeInt64Model ¶
func (FilterRangeInt64Model) Equals ¶ added in v1.0.4
func (m FilterRangeInt64Model) Equals(other FilterRangeInt64Model) bool
Equals returns true if all fields of the receiver match the corresponding fields of other.
type NestedFilterModel ¶ added in v1.0.4
type NestedFilterModel struct {
And []NestedFilterModel `tfsdk:"and" json:"AND,omitempty"`
Or []NestedFilterModel `tfsdk:"or" json:"OR,omitempty"`
SearchField types.String `tfsdk:"search_field" json:"SEARCH_FIELD"`
SearchType types.String `tfsdk:"search_type" json:"SEARCH_TYPE"`
SearchValue types.String `tfsdk:"search_value" json:"SEARCH_VALUE"`
}
NestedFilterModel represents a nested filter condition.
func (NestedFilterModel) Equals ¶ added in v1.0.4
func (m NestedFilterModel) Equals(other NestedFilterModel) bool
Equals returns true if all non-nil fields of the receiver match the corresponding fields of other. String fields are compared case-insensitively. Nested And/Or slices are compared recursively.
func (*NestedFilterModel) UnmarshalJSON ¶ added in v1.0.4
func (m *NestedFilterModel) UnmarshalJSON(data []byte) error
type RootFilterModel ¶ added in v1.0.4
type RootFilterModel struct {
And []NestedFilterModel `tfsdk:"and" json:"AND,omitempty"`
Or []NestedFilterModel `tfsdk:"or" json:"OR,omitempty"`
}
RootFilterModel represents the root of the membership predicate.
func SDKToModel ¶ added in v1.0.4
func SDKToModel(ctx context.Context, sdkFilter filterTypes.FilterRoot) *RootFilterModel
func (RootFilterModel) Equals ¶ added in v1.0.4
func (m RootFilterModel) Equals(other *RootFilterModel) bool
Equals returns true if all non-nil fields of the receiver match the corresponding fields of other. Nested And/Or slices are compared recursively.