4 "github.com/hashicorp/hcl2/hcldec"
5 "github.com/zclconf/go-cty/cty"
8 // ImpliedType returns the cty.Type that would result from decoding a
9 // configuration block using the receiving block schema.
11 // ImpliedType always returns a result, even if the given schema is
12 // inconsistent. Code that creates configschema.Block objects should be
13 // tested using the InternalValidate method to detect any inconsistencies
14 // that would cause this method to fall back on defaults and assumptions.
15 func (b *Block) ImpliedType() cty.Type {
17 return cty.EmptyObject
20 return hcldec.ImpliedType(b.DecoderSpec())
23 // ContainsSensitive returns true if any of the attributes of the receiving
24 // block or any of its descendent blocks are marked as sensitive.
26 // Blocks themselves cannot be sensitive as a whole -- sensitivity is a
27 // per-attribute idea -- but sometimes we want to include a whole object
28 // decoded from a block in some UI output, and that is safe to do only if
29 // none of the contained attributes are sensitive.
30 func (b *Block) ContainsSensitive() bool {
31 for _, attrS := range b.Attributes {
36 for _, blockS := range b.BlockTypes {
37 if blockS.ContainsSensitive() {