2020-02-21 10:47:46 -05:00
|
|
|
// Code generated by "mapstructure-to-hcl2 -type NIC,CreateConfig,DiskConfig"; DO NOT EDIT.
|
2020-01-07 19:59:31 -05:00
|
|
|
package iso
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/hcl/v2/hcldec"
|
|
|
|
"github.com/zclconf/go-cty/cty"
|
|
|
|
)
|
|
|
|
|
|
|
|
// FlatCreateConfig is an auto-generated flat version of CreateConfig.
|
|
|
|
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
|
|
|
|
type FlatCreateConfig struct {
|
2020-02-21 10:47:46 -05:00
|
|
|
Version *uint `mapstructure:"vm_version" cty:"vm_version"`
|
|
|
|
GuestOSType *string `mapstructure:"guest_os_type" cty:"guest_os_type"`
|
|
|
|
Firmware *string `mapstructure:"firmware" cty:"firmware"`
|
|
|
|
DiskControllerType *string `mapstructure:"disk_controller_type" cty:"disk_controller_type"`
|
|
|
|
DiskSize *int64 `mapstructure:"disk_size" cty:"disk_size"`
|
|
|
|
DiskThinProvisioned *bool `mapstructure:"disk_thin_provisioned" cty:"disk_thin_provisioned"`
|
|
|
|
DiskEagerlyScrub *bool `mapstructure:"disk_eagerly_scrub" cty:"disk_eagerly_scrub"`
|
|
|
|
Storage []FlatDiskConfig `mapstructure:"storage" cty:"storage"`
|
|
|
|
Network *string `mapstructure:"network" cty:"network"`
|
|
|
|
NetworkCard *string `mapstructure:"network_card" cty:"network_card"`
|
|
|
|
NICs []FlatNIC `mapstructure:"network_adapters" cty:"network_adapters"`
|
|
|
|
USBController *bool `mapstructure:"usb_controller" cty:"usb_controller"`
|
|
|
|
Notes *string `mapstructure:"notes" cty:"notes"`
|
2020-01-07 19:59:31 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// FlatMapstructure returns a new FlatCreateConfig.
|
|
|
|
// FlatCreateConfig is an auto-generated flat version of CreateConfig.
|
|
|
|
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
|
|
|
|
func (*CreateConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
|
|
|
|
return new(FlatCreateConfig)
|
|
|
|
}
|
|
|
|
|
|
|
|
// HCL2Spec returns the hcl spec of a CreateConfig.
|
|
|
|
// This spec is used by HCL to read the fields of CreateConfig.
|
|
|
|
// The decoded values from this spec will then be applied to a FlatCreateConfig.
|
|
|
|
func (*FlatCreateConfig) HCL2Spec() map[string]hcldec.Spec {
|
|
|
|
s := map[string]hcldec.Spec{
|
|
|
|
"vm_version": &hcldec.AttrSpec{Name: "vm_version", Type: cty.Number, Required: false},
|
|
|
|
"guest_os_type": &hcldec.AttrSpec{Name: "guest_os_type", Type: cty.String, Required: false},
|
|
|
|
"firmware": &hcldec.AttrSpec{Name: "firmware", Type: cty.String, Required: false},
|
|
|
|
"disk_controller_type": &hcldec.AttrSpec{Name: "disk_controller_type", Type: cty.String, Required: false},
|
|
|
|
"disk_size": &hcldec.AttrSpec{Name: "disk_size", Type: cty.Number, Required: false},
|
|
|
|
"disk_thin_provisioned": &hcldec.AttrSpec{Name: "disk_thin_provisioned", Type: cty.Bool, Required: false},
|
2020-02-17 10:58:28 -05:00
|
|
|
"disk_eagerly_scrub": &hcldec.AttrSpec{Name: "disk_eagerly_scrub", Type: cty.Bool, Required: false},
|
2020-02-21 10:47:46 -05:00
|
|
|
"storage": &hcldec.BlockListSpec{TypeName: "storage", Nested: hcldec.ObjectSpec((*FlatDiskConfig)(nil).HCL2Spec())},
|
2020-01-07 19:59:31 -05:00
|
|
|
"network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false},
|
|
|
|
"network_card": &hcldec.AttrSpec{Name: "network_card", Type: cty.String, Required: false},
|
2020-02-14 11:51:57 -05:00
|
|
|
"network_adapters": &hcldec.BlockListSpec{TypeName: "network_adapters", Nested: hcldec.ObjectSpec((*FlatNIC)(nil).HCL2Spec())},
|
2020-01-07 19:59:31 -05:00
|
|
|
"usb_controller": &hcldec.AttrSpec{Name: "usb_controller", Type: cty.Bool, Required: false},
|
|
|
|
"notes": &hcldec.AttrSpec{Name: "notes", Type: cty.String, Required: false},
|
|
|
|
}
|
|
|
|
return s
|
|
|
|
}
|
2020-02-14 11:51:57 -05:00
|
|
|
|
2020-02-21 10:47:46 -05:00
|
|
|
// FlatDiskConfig is an auto-generated flat version of DiskConfig.
|
|
|
|
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
|
|
|
|
type FlatDiskConfig struct {
|
|
|
|
DiskSize *int64 `mapstructure:"disk_size" required:"true" cty:"disk_size"`
|
|
|
|
DiskThinProvisioned *bool `mapstructure:"disk_thin_provisioned" cty:"disk_thin_provisioned"`
|
|
|
|
DiskEagerlyScrub *bool `mapstructure:"disk_eagerly_scrub" cty:"disk_eagerly_scrub"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// FlatMapstructure returns a new FlatDiskConfig.
|
|
|
|
// FlatDiskConfig is an auto-generated flat version of DiskConfig.
|
|
|
|
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
|
|
|
|
func (*DiskConfig) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
|
|
|
|
return new(FlatDiskConfig)
|
|
|
|
}
|
|
|
|
|
|
|
|
// HCL2Spec returns the hcl spec of a DiskConfig.
|
|
|
|
// This spec is used by HCL to read the fields of DiskConfig.
|
|
|
|
// The decoded values from this spec will then be applied to a FlatDiskConfig.
|
|
|
|
func (*FlatDiskConfig) HCL2Spec() map[string]hcldec.Spec {
|
|
|
|
s := map[string]hcldec.Spec{
|
|
|
|
"disk_size": &hcldec.AttrSpec{Name: "disk_size", Type: cty.Number, Required: false},
|
|
|
|
"disk_thin_provisioned": &hcldec.AttrSpec{Name: "disk_thin_provisioned", Type: cty.Bool, Required: false},
|
|
|
|
"disk_eagerly_scrub": &hcldec.AttrSpec{Name: "disk_eagerly_scrub", Type: cty.Bool, Required: false},
|
|
|
|
}
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
|
2020-02-14 11:51:57 -05:00
|
|
|
// FlatNIC is an auto-generated flat version of NIC.
|
|
|
|
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
|
|
|
|
type FlatNIC struct {
|
|
|
|
Network *string `mapstructure:"network" cty:"network"`
|
|
|
|
NetworkCard *string `mapstructure:"network_card" required:"true" cty:"network_card"`
|
|
|
|
MacAddress *string `mapstructure:"mac_address" cty:"mac_address"`
|
|
|
|
Passthrough *bool `mapstructure:"passthrough" cty:"passthrough"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// FlatMapstructure returns a new FlatNIC.
|
|
|
|
// FlatNIC is an auto-generated flat version of NIC.
|
|
|
|
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
|
2020-03-17 07:30:36 -04:00
|
|
|
func (*NIC) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
|
|
|
|
return new(FlatNIC)
|
|
|
|
}
|
2020-02-14 11:51:57 -05:00
|
|
|
|
|
|
|
// HCL2Spec returns the hcl spec of a NIC.
|
|
|
|
// This spec is used by HCL to read the fields of NIC.
|
|
|
|
// The decoded values from this spec will then be applied to a FlatNIC.
|
|
|
|
func (*FlatNIC) HCL2Spec() map[string]hcldec.Spec {
|
|
|
|
s := map[string]hcldec.Spec{
|
|
|
|
"network": &hcldec.AttrSpec{Name: "network", Type: cty.String, Required: false},
|
|
|
|
"network_card": &hcldec.AttrSpec{Name: "network_card", Type: cty.String, Required: false},
|
|
|
|
"mac_address": &hcldec.AttrSpec{Name: "mac_address", Type: cty.String, Required: false},
|
|
|
|
"passthrough": &hcldec.AttrSpec{Name: "passthrough", Type: cty.Bool, Required: false},
|
|
|
|
}
|
|
|
|
return s
|
|
|
|
}
|