generated from hashicorp/packer-plugin-scaffolding
/
affinities.hcl2spec.go
35 lines (30 loc) · 1.45 KB
/
affinities.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
// Code generated by "packer-sdc mapstructure-to-hcl2"; DO NOT EDIT.
package common
import (
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/zclconf/go-cty/cty"
)
// FlatNodeAffinity is an auto-generated flat version of NodeAffinity.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatNodeAffinity struct {
Key *string `mapstructure:"key" json:"key" cty:"key" hcl:"key"`
Operator *string `mapstructure:"operator" json:"operator" cty:"operator" hcl:"operator"`
Values []string `mapstructure:"values" json:"values" cty:"values" hcl:"values"`
}
// FlatMapstructure returns a new FlatNodeAffinity.
// FlatNodeAffinity is an auto-generated flat version of NodeAffinity.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*NodeAffinity) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatNodeAffinity)
}
// HCL2Spec returns the hcl spec of a NodeAffinity.
// This spec is used by HCL to read the fields of NodeAffinity.
// The decoded values from this spec will then be applied to a FlatNodeAffinity.
func (*FlatNodeAffinity) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"key": &hcldec.AttrSpec{Name: "key", Type: cty.String, Required: false},
"operator": &hcldec.AttrSpec{Name: "operator", Type: cty.String, Required: false},
"values": &hcldec.AttrSpec{Name: "values", Type: cty.List(cty.String), Required: false},
}
return s
}