-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprovisioner.hcl2spec.go
More file actions
60 lines (52 loc) · 2.5 KB
/
provisioner.hcl2spec.go
File metadata and controls
60 lines (52 loc) · 2.5 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Code generated by "packer-sdc mapstructure-to-hcl2"; DO NOT EDIT.
package main
import (
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/zclconf/go-cty/cty"
)
// FlatConfig is an auto-generated flat version of Config.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatConfig struct {
Profile *string `mapstructure:"profile" cty:"profile" hcl:"profile"`
UsePathStyle *bool `mapstructure:"use_path_style" cty:"use_path_style" hcl:"use_path_style"`
Objects []FlatObject `mapstructure:"objects" cty:"objects" hcl:"objects"`
}
// FlatMapstructure returns a new FlatConfig.
// FlatConfig is an auto-generated flat version of Config.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatConfig)
}
// HCL2Spec returns the hcl spec of a Config.
// This spec is used by HCL to read the fields of Config.
// The decoded values from this spec will then be applied to a FlatConfig.
func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"profile": &hcldec.AttrSpec{Name: "profile", Type: cty.String, Required: false},
"use_path_style": &hcldec.AttrSpec{Name: "use_path_style", Type: cty.Bool, Required: false},
"objects": &hcldec.BlockListSpec{TypeName: "objects", Nested: hcldec.ObjectSpec((*FlatObject)(nil).HCL2Spec())},
}
return s
}
// FlatObject is an auto-generated flat version of Object.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatObject struct {
Source *string `mapstructure:"source" cty:"source" hcl:"source"`
Destination *string `mapstructure:"destination" cty:"destination" hcl:"destination"`
}
// FlatMapstructure returns a new FlatObject.
// FlatObject is an auto-generated flat version of Object.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*Object) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatObject)
}
// HCL2Spec returns the hcl spec of a Object.
// This spec is used by HCL to read the fields of Object.
// The decoded values from this spec will then be applied to a FlatObject.
func (*FlatObject) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"source": &hcldec.AttrSpec{Name: "source", Type: cty.String, Required: false},
"destination": &hcldec.AttrSpec{Name: "destination", Type: cty.String, Required: false},
}
return s
}