packer-cn/packer/builder_mock.hcl2spec.go

211 lines
12 KiB
Go

// Code generated by "mapstructure-to-hcl2 -type MockBuilder,MockCommunicator,RemoteCmd,MockProvisioner,MockPostProcessor"; DO NOT EDIT.
package packer
import (
"io"
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/zclconf/go-cty/cty"
)
// FlatMockBuilder is an auto-generated flat version of MockBuilder.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatMockBuilder struct {
ArtifactId *string `cty:"artifact_id"`
PrepareWarnings []string `cty:"prepare_warnings"`
RunErrResult *bool `cty:"run_err_result"`
RunNilResult *bool `cty:"run_nil_result"`
PrepareCalled *bool `cty:"prepare_called"`
PrepareConfig []interface{} `cty:"prepare_config"`
RunCalled *bool `cty:"run_called"`
RunHook Hook `cty:"run_hook"`
RunUi Ui `cty:"run_ui"`
CancelCalled *bool `cty:"cancel_called"`
GeneratedVars []string `cty:"generated_vars"`
}
// FlatMapstructure returns a new FlatMockBuilder.
// FlatMockBuilder is an auto-generated flat version of MockBuilder.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*MockBuilder) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatMockBuilder)
}
// HCL2Spec returns the hcl spec of a MockBuilder.
// This spec is used by HCL to read the fields of MockBuilder.
// The decoded values from this spec will then be applied to a FlatMockBuilder.
func (*FlatMockBuilder) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"artifact_id": &hcldec.AttrSpec{Name: "artifact_id", Type: cty.String, Required: false},
"prepare_warnings": &hcldec.AttrSpec{Name: "prepare_warnings", Type: cty.List(cty.String), Required: false},
"run_err_result": &hcldec.AttrSpec{Name: "run_err_result", Type: cty.Bool, Required: false},
"run_nil_result": &hcldec.AttrSpec{Name: "run_nil_result", Type: cty.Bool, Required: false},
"prepare_called": &hcldec.AttrSpec{Name: "prepare_called", Type: cty.Bool, Required: false},
"prepare_config": &hcldec.AttrSpec{Name: "prepare_config", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"run_called": &hcldec.AttrSpec{Name: "run_called", Type: cty.Bool, Required: false},
"run_hook": &hcldec.AttrSpec{Name: "run_hook", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"run_ui": &hcldec.AttrSpec{Name: "run_ui", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"cancel_called": &hcldec.AttrSpec{Name: "cancel_called", Type: cty.Bool, Required: false},
"generated_vars": &hcldec.AttrSpec{Name: "generated_vars", Type: cty.List(cty.String), Required: false},
}
return s
}
// FlatMockCommunicator is an auto-generated flat version of MockCommunicator.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatMockCommunicator struct {
StartCalled *bool `cty:"start_called"`
StartCmd *FlatRemoteCmd `cty:"start_cmd"`
StartStderr *string `cty:"start_stderr"`
StartStdout *string `cty:"start_stdout"`
StartStdin *string `cty:"start_stdin"`
StartExitStatus *int `cty:"start_exit_status"`
UploadCalled *bool `cty:"upload_called"`
UploadPath *string `cty:"upload_path"`
UploadData *string `cty:"upload_data"`
UploadDirDst *string `cty:"upload_dir_dst"`
UploadDirSrc *string `cty:"upload_dir_src"`
UploadDirExclude []string `cty:"upload_dir_exclude"`
DownloadDirDst *string `cty:"download_dir_dst"`
DownloadDirSrc *string `cty:"download_dir_src"`
DownloadDirExclude []string `cty:"download_dir_exclude"`
DownloadCalled *bool `cty:"download_called"`
DownloadPath *string `cty:"download_path"`
DownloadData *string `cty:"download_data"`
}
// FlatMapstructure returns a new FlatMockCommunicator.
// FlatMockCommunicator is an auto-generated flat version of MockCommunicator.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*MockCommunicator) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatMockCommunicator)
}
// HCL2Spec returns the hcl spec of a MockCommunicator.
// This spec is used by HCL to read the fields of MockCommunicator.
// The decoded values from this spec will then be applied to a FlatMockCommunicator.
func (*FlatMockCommunicator) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"start_called": &hcldec.AttrSpec{Name: "start_called", Type: cty.Bool, Required: false},
"start_cmd": &hcldec.BlockSpec{TypeName: "start_cmd", Nested: hcldec.ObjectSpec((*FlatRemoteCmd)(nil).HCL2Spec())},
"start_stderr": &hcldec.AttrSpec{Name: "start_stderr", Type: cty.String, Required: false},
"start_stdout": &hcldec.AttrSpec{Name: "start_stdout", Type: cty.String, Required: false},
"start_stdin": &hcldec.AttrSpec{Name: "start_stdin", Type: cty.String, Required: false},
"start_exit_status": &hcldec.AttrSpec{Name: "start_exit_status", Type: cty.Number, Required: false},
"upload_called": &hcldec.AttrSpec{Name: "upload_called", Type: cty.Bool, Required: false},
"upload_path": &hcldec.AttrSpec{Name: "upload_path", Type: cty.String, Required: false},
"upload_data": &hcldec.AttrSpec{Name: "upload_data", Type: cty.String, Required: false},
"upload_dir_dst": &hcldec.AttrSpec{Name: "upload_dir_dst", Type: cty.String, Required: false},
"upload_dir_src": &hcldec.AttrSpec{Name: "upload_dir_src", Type: cty.String, Required: false},
"upload_dir_exclude": &hcldec.AttrSpec{Name: "upload_dir_exclude", Type: cty.List(cty.String), Required: false},
"download_dir_dst": &hcldec.AttrSpec{Name: "download_dir_dst", Type: cty.String, Required: false},
"download_dir_src": &hcldec.AttrSpec{Name: "download_dir_src", Type: cty.String, Required: false},
"download_dir_exclude": &hcldec.AttrSpec{Name: "download_dir_exclude", Type: cty.List(cty.String), Required: false},
"download_called": &hcldec.AttrSpec{Name: "download_called", Type: cty.Bool, Required: false},
"download_path": &hcldec.AttrSpec{Name: "download_path", Type: cty.String, Required: false},
"download_data": &hcldec.AttrSpec{Name: "download_data", Type: cty.String, Required: false},
}
return s
}
// FlatMockPostProcessor is an auto-generated flat version of MockPostProcessor.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatMockPostProcessor struct {
ArtifactId *string `cty:"artifact_id"`
Keep *bool `cty:"keep"`
ForceOverride *bool `cty:"force_override"`
Error error `cty:"error"`
ConfigureCalled *bool `cty:"configure_called"`
ConfigureConfigs []interface{} `cty:"configure_configs"`
ConfigureError error `cty:"configure_error"`
PostProcessCalled *bool `cty:"post_process_called"`
PostProcessArtifact Artifact `cty:"post_process_artifact"`
PostProcessUi Ui `cty:"post_process_ui"`
}
// FlatMapstructure returns a new FlatMockPostProcessor.
// FlatMockPostProcessor is an auto-generated flat version of MockPostProcessor.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*MockPostProcessor) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatMockPostProcessor)
}
// HCL2Spec returns the hcl spec of a MockPostProcessor.
// This spec is used by HCL to read the fields of MockPostProcessor.
// The decoded values from this spec will then be applied to a FlatMockPostProcessor.
func (*FlatMockPostProcessor) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"artifact_id": &hcldec.AttrSpec{Name: "artifact_id", Type: cty.String, Required: false},
"keep": &hcldec.AttrSpec{Name: "keep", Type: cty.Bool, Required: false},
"force_override": &hcldec.AttrSpec{Name: "force_override", Type: cty.Bool, Required: false},
"error": &hcldec.AttrSpec{Name: "error", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"configure_called": &hcldec.AttrSpec{Name: "configure_called", Type: cty.Bool, Required: false},
"configure_configs": &hcldec.AttrSpec{Name: "configure_configs", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"configure_error": &hcldec.AttrSpec{Name: "configure_error", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"post_process_called": &hcldec.AttrSpec{Name: "post_process_called", Type: cty.Bool, Required: false},
"post_process_artifact": &hcldec.AttrSpec{Name: "post_process_artifact", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"post_process_ui": &hcldec.AttrSpec{Name: "post_process_ui", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
}
return s
}
// FlatMockProvisioner is an auto-generated flat version of MockProvisioner.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatMockProvisioner struct {
PrepCalled *bool `cty:"prep_called"`
PrepConfigs []interface{} `cty:"prep_configs"`
ProvCalled *bool `cty:"prov_called"`
ProvCommunicator Communicator `cty:"prov_communicator"`
ProvUi Ui `cty:"prov_ui"`
}
// FlatMapstructure returns a new FlatMockProvisioner.
// FlatMockProvisioner is an auto-generated flat version of MockProvisioner.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*MockProvisioner) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatMockProvisioner)
}
// HCL2Spec returns the hcl spec of a MockProvisioner.
// This spec is used by HCL to read the fields of MockProvisioner.
// The decoded values from this spec will then be applied to a FlatMockProvisioner.
func (*FlatMockProvisioner) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"prep_called": &hcldec.AttrSpec{Name: "prep_called", Type: cty.Bool, Required: false},
"prep_configs": &hcldec.AttrSpec{Name: "prep_configs", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"prov_called": &hcldec.AttrSpec{Name: "prov_called", Type: cty.Bool, Required: false},
"prov_communicator": &hcldec.AttrSpec{Name: "prov_communicator", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"prov_ui": &hcldec.AttrSpec{Name: "prov_ui", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
}
return s
}
// FlatRemoteCmd is an auto-generated flat version of RemoteCmd.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatRemoteCmd struct {
Command *string `cty:"command"`
Stdin io.Reader `cty:"stdin"`
Stdout io.Writer `cty:"stdout"`
Stderr io.Writer `cty:"stderr"`
}
// FlatMapstructure returns a new FlatRemoteCmd.
// FlatRemoteCmd is an auto-generated flat version of RemoteCmd.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*RemoteCmd) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatRemoteCmd)
}
// HCL2Spec returns the hcl spec of a RemoteCmd.
// This spec is used by HCL to read the fields of RemoteCmd.
// The decoded values from this spec will then be applied to a FlatRemoteCmd.
func (*FlatRemoteCmd) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"command": &hcldec.AttrSpec{Name: "command", Type: cty.String, Required: false},
"stdin": &hcldec.AttrSpec{Name: "stdin", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"stdout": &hcldec.AttrSpec{Name: "stdout", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
"stderr": &hcldec.AttrSpec{Name: "stderr", Type: cty.Bool, Required: false}, /* TODO(azr): could not find type */
}
return s
}