MultiValuedFilterAttributes returns the attributes of the given attribute on which can be filtered. In the case of a complex attribute, the sub-attributes get returned. Otherwise if the given attribute is not complex, a "value" sub- attribute gets created to filter against.
(attr schema.CoreAttribute)
| 9 | // complex attribute, the sub-attributes get returned. Otherwise if the given attribute is not complex, a "value" sub- |
| 10 | // attribute gets created to filter against. |
| 11 | func MultiValuedFilterAttributes(attr schema.CoreAttribute) schema.Attributes { |
| 12 | switch attr.AttributeType() { |
| 13 | case "complex": |
| 14 | return attr.SubAttributes() |
| 15 | default: |
| 16 | return schema.Attributes{schema.SimpleCoreAttribute(getSimpleParams(attr))} |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | // getSimpleParams returns simple params based on the type of the attribute. The simple params only have their name |
| 21 | // assigned to "value", everything else is left out (i.e. default values). Can not be used for complex attributes. |
no test coverage detected
searching dependent graphs…