-
Notifications
You must be signed in to change notification settings - Fork 47
/
template.hcl2spec.go
45 lines (40 loc) · 2.46 KB
/
template.hcl2spec.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
36
37
38
39
40
41
42
43
44
45
// Code generated by "packer-sdc mapstructure-to-hcl2"; DO NOT EDIT.
package template
import (
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/zclconf/go-cty/cty"
)
// FlatProvisioner is an auto-generated flat version of Provisioner.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatProvisioner struct {
Only []string `json:"only,omitempty" cty:"only" hcl:"only"`
Except []string `json:"except,omitempty" cty:"except" hcl:"except"`
Type *string `json:"type" cty:"type" hcl:"type"`
Config map[string]interface{} `json:"config,omitempty" cty:"config" hcl:"config"`
Override map[string]interface{} `json:"override,omitempty" cty:"override" hcl:"override"`
PauseBefore *string `mapstructure:"pause_before" json:"pause_before,omitempty" cty:"pause_before" hcl:"pause_before"`
MaxRetries *string `mapstructure:"max_retries" json:"max_retries,omitempty" cty:"max_retries" hcl:"max_retries"`
Timeout *string `mapstructure:"timeout" json:"timeout,omitempty" cty:"timeout" hcl:"timeout"`
}
// FlatMapstructure returns a new FlatProvisioner.
// FlatProvisioner is an auto-generated flat version of Provisioner.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*Provisioner) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatProvisioner)
}
// HCL2Spec returns the hcl spec of a Provisioner.
// This spec is used by HCL to read the fields of Provisioner.
// The decoded values from this spec will then be applied to a FlatProvisioner.
func (*FlatProvisioner) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"only": &hcldec.AttrSpec{Name: "only", Type: cty.List(cty.String), Required: false},
"except": &hcldec.AttrSpec{Name: "except", Type: cty.List(cty.String), Required: false},
"type": &hcldec.AttrSpec{Name: "type", Type: cty.String, Required: false},
"config": &hcldec.AttrSpec{Name: "config", Type: cty.Map(cty.String), Required: false},
"override": &hcldec.AttrSpec{Name: "override", Type: cty.Map(cty.String), Required: false},
"pause_before": &hcldec.AttrSpec{Name: "pause_before", Type: cty.String, Required: false},
"max_retries": &hcldec.AttrSpec{Name: "max_retries", Type: cty.String, Required: false},
"timeout": &hcldec.AttrSpec{Name: "timeout", Type: cty.String, Required: false},
}
return s
}