Files

123 lines
6.1 KiB
Go

// Code generated by "packer-sdc mapstructure-to-hcl2"; DO NOT EDIT.
package secrets
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 {
Host *string `mapstructure:"host" cty:"host" hcl:"host"`
ProjectId *string `mapstructure:"project_id" required:"true" cty:"project_id" hcl:"project_id"`
FolderPath *string `mapstructure:"folder_path" cty:"folder_path" hcl:"folder_path"`
EnvSlug *string `mapstructure:"env_slug" required:"true" cty:"env_slug" hcl:"env_slug"`
UniversalAuth *FlatUniversalAuth `mapstructure:"universal_auth" cty:"universal_auth" hcl:"universal_auth"`
}
// 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{
"host": &hcldec.AttrSpec{Name: "host", Type: cty.String, Required: false},
"project_id": &hcldec.AttrSpec{Name: "project_id", Type: cty.String, Required: false},
"folder_path": &hcldec.AttrSpec{Name: "folder_path", Type: cty.String, Required: false},
"env_slug": &hcldec.AttrSpec{Name: "env_slug", Type: cty.String, Required: false},
"universal_auth": &hcldec.BlockSpec{TypeName: "universal_auth", Nested: hcldec.ObjectSpec((*FlatUniversalAuth)(nil).HCL2Spec())},
}
return s
}
// FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatDatasourceOutput struct {
Secrets map[string]Secret `mapstructure:"secrets" required:"true" cty:"secrets" hcl:"secrets"`
}
// FlatMapstructure returns a new FlatDatasourceOutput.
// FlatDatasourceOutput is an auto-generated flat version of DatasourceOutput.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*DatasourceOutput) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatDatasourceOutput)
}
// HCL2Spec returns the hcl spec of a DatasourceOutput.
// This spec is used by HCL to read the fields of DatasourceOutput.
// The decoded values from this spec will then be applied to a FlatDatasourceOutput.
func (*FlatDatasourceOutput) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"secrets": &hcldec.AttrSpec{Name: "secrets", Type: cty.Map(cty.String), Required: false},
}
return s
}
// FlatSecret is an auto-generated flat version of Secret.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatSecret struct {
Version *int `mapstructure:"version" required:"true" cty:"version" hcl:"version"`
Workspace *string `mapstructure:"workspace" required:"true" cty:"workspace" hcl:"workspace"`
Type *string `mapstructure:"type" required:"true" cty:"type" hcl:"type"`
Environment *string `mapstructure:"environment" required:"true" cty:"environment" hcl:"environment"`
SecretKey *string `mapstructure:"secret_key" required:"true" cty:"secret_key" hcl:"secret_key"`
SecretValue *string `mapstructure:"secret_value" required:"true" cty:"secret_value" hcl:"secret_value"`
SecretComment *string `mapstructure:"secret_comment" required:"true" cty:"secret_comment" hcl:"secret_comment"`
}
// FlatMapstructure returns a new FlatSecret.
// FlatSecret is an auto-generated flat version of Secret.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*Secret) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatSecret)
}
// HCL2Spec returns the hcl spec of a Secret.
// This spec is used by HCL to read the fields of Secret.
// The decoded values from this spec will then be applied to a FlatSecret.
func (*FlatSecret) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"version": &hcldec.AttrSpec{Name: "version", Type: cty.Number, Required: false},
"workspace": &hcldec.AttrSpec{Name: "workspace", Type: cty.String, Required: false},
"type": &hcldec.AttrSpec{Name: "type", Type: cty.String, Required: false},
"environment": &hcldec.AttrSpec{Name: "environment", Type: cty.String, Required: false},
"secret_key": &hcldec.AttrSpec{Name: "secret_key", Type: cty.String, Required: false},
"secret_value": &hcldec.AttrSpec{Name: "secret_value", Type: cty.String, Required: false},
"secret_comment": &hcldec.AttrSpec{Name: "secret_comment", Type: cty.String, Required: false},
}
return s
}
// FlatUniversalAuth is an auto-generated flat version of UniversalAuth.
// Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.
type FlatUniversalAuth struct {
ClientID *string `mapstructure:"client_id" required:"true" cty:"client_id" hcl:"client_id"`
ClientSecret *string `mapstructure:"client_secret" cty:"client_secret" hcl:"client_secret"`
}
// FlatMapstructure returns a new FlatUniversalAuth.
// FlatUniversalAuth is an auto-generated flat version of UniversalAuth.
// Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.
func (*UniversalAuth) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec } {
return new(FlatUniversalAuth)
}
// HCL2Spec returns the hcl spec of a UniversalAuth.
// This spec is used by HCL to read the fields of UniversalAuth.
// The decoded values from this spec will then be applied to a FlatUniversalAuth.
func (*FlatUniversalAuth) HCL2Spec() map[string]hcldec.Spec {
s := map[string]hcldec.Spec{
"client_id": &hcldec.AttrSpec{Name: "client_id", Type: cty.String, Required: false},
"client_secret": &hcldec.AttrSpec{Name: "client_secret", Type: cty.String, Required: false},
}
return s
}