github.com/mineiros-io/terradoc@v0.0.9-0.20220711062319-018bd4ae81f5/internal/entities/attribute.go (about)

     1  package entities
     2  
     3  import (
     4  	"encoding/json"
     5  )
     6  
     7  // Attribute represents an `attribute` block from the input file
     8  type Attribute struct {
     9  	// Name is the attribute name as defined in the `attribute` block label
    10  	Name string `json:"name"`
    11  	// Type is the type definition for the attribute
    12  	Type Type `json:"type_definition"`
    13  	// Default is an optional default value for this variable in case none is given. Must be a valid JSON value.
    14  	Default json.RawMessage `json:"default,omitempty"`
    15  	// Description is an optional attribute description
    16  	Description string `json:"description,omitempty"`
    17  	// ForcesRecreation specifies if a change in the attribute will force the resource recreation
    18  	ForcesRecreation bool `json:"forces_recreation"`
    19  	// ReadmeExample is an optional readme example to be used in the documentation
    20  	ReadmeExample string `json:"readme_example,omitempty"`
    21  	// Required specifies if the attribute is required
    22  	Required bool `json:"required"`
    23  	// Attributes is a collection of nested attributes contained in the attribute block definition
    24  	Attributes []Attribute `json:"attributes,omitempty"`
    25  	// Level is the nesting level of this attribute
    26  	Level int `json:"-"`
    27  }