forked from hashicorp/terraform-plugin-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpression_step_element_key_string_any.go
35 lines (27 loc) · 1.15 KB
/
expression_step_element_key_string_any.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package path
// Ensure ExpressionStepElementKeyStringAny satisfies the ExpressionStep
// interface.
var _ ExpressionStep = ExpressionStepElementKeyStringAny{}
// ExpressionStepElementKeyStringAny is an attribute path expression for a matching any
// string key within a map.
type ExpressionStepElementKeyStringAny struct{}
// Equal returns true if the given ExpressionStep is a
// ExpressionStepElementKeyStringAny.
func (s ExpressionStepElementKeyStringAny) Equal(o ExpressionStep) bool {
_, ok := o.(ExpressionStepElementKeyStringAny)
return ok
}
// Matches returns true if the given PathStep is fulfilled by the
// ExpressionStepElementKeyStringAny condition.
func (s ExpressionStepElementKeyStringAny) Matches(pathStep PathStep) bool {
_, ok := pathStep.(PathStepElementKeyString)
return ok
}
// String returns the human-readable representation of the element key
// expression. It is intended for logging and error messages and is not
// protected by compatibility guarantees.
func (s ExpressionStepElementKeyStringAny) String() string {
return `["*"]`
}
// unexported satisfies the Step interface.
func (s ExpressionStepElementKeyStringAny) unexported() {}