2023-03-20 20:25:53 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2022-04-03 04:07:16 +00:00
|
|
|
package hcl
|
|
|
|
|
|
|
|
// BlockHeaderSchema represents the shape of a block header, and is
|
|
|
|
// used for matching blocks within bodies.
|
|
|
|
type BlockHeaderSchema struct {
|
|
|
|
Type string
|
|
|
|
LabelNames []string
|
|
|
|
}
|
|
|
|
|
|
|
|
// AttributeSchema represents the requirements for an attribute, and is used
|
|
|
|
// for matching attributes within bodies.
|
|
|
|
type AttributeSchema struct {
|
|
|
|
Name string
|
|
|
|
Required bool
|
|
|
|
}
|
|
|
|
|
|
|
|
// BodySchema represents the desired shallow structure of a body.
|
|
|
|
type BodySchema struct {
|
|
|
|
Attributes []AttributeSchema
|
|
|
|
Blocks []BlockHeaderSchema
|
|
|
|
}
|