mirror of https://github.com/hashicorp/boundary
parent
b594535391
commit
f70ff526da
@ -0,0 +1,42 @@
|
||||
// Code generated by go generate; DO NOT EDIT.
|
||||
// This file was generated by robots at
|
||||
// 2020-05-03 11:13:42.5271736 -0400 EDT m=+0.049578501
|
||||
package hosts
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/mitchellh/mapstructure"
|
||||
)
|
||||
|
||||
type AwsEc2HostCatalog struct {
|
||||
*HostCatalog
|
||||
|
||||
// The AWS regions from which this catalog will retrieve the EC2 instances.
|
||||
Regions []string `json:"regions,omitempty"`
|
||||
// The access key used for authenticating with AWS when retrieving EC2 instance details.
|
||||
AccessKey *string `json:"access_key,omitempty"`
|
||||
// Input only.
|
||||
SecretKey *string `json:"secret_key,omitempty"`
|
||||
// This value will never be returned in a response.
|
||||
Rotate *bool `json:"rotate,omitempty"`
|
||||
}
|
||||
|
||||
func (s *HostCatalog) AsAwsEc2HostCatalog() (*AwsEc2HostCatalog, error) {
|
||||
out := &AwsEc2HostCatalog{
|
||||
HostCatalog: s,
|
||||
}
|
||||
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
|
||||
Result: out,
|
||||
TagName: "json",
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating map decoder: %w", err)
|
||||
}
|
||||
|
||||
if err := decoder.Decode(s.Attributes); err != nil {
|
||||
return nil, fmt.Errorf("error decoding attributes map: %w", err)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
// Code generated by go generate; DO NOT EDIT.
|
||||
// This file was generated by robots at
|
||||
// 2020-05-03 11:13:42.5270389 -0400 EDT m=+0.049443801
|
||||
package hosts
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/mitchellh/mapstructure"
|
||||
)
|
||||
|
||||
type StaticHostCatalog struct {
|
||||
*HostCatalog
|
||||
}
|
||||
|
||||
func (s *HostCatalog) AsStaticHostCatalog() (*StaticHostCatalog, error) {
|
||||
out := &StaticHostCatalog{
|
||||
HostCatalog: s,
|
||||
}
|
||||
decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{
|
||||
Result: out,
|
||||
TagName: "json",
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error creating map decoder: %w", err)
|
||||
}
|
||||
|
||||
if err := decoder.Decode(s.Attributes); err != nil {
|
||||
return nil, fmt.Errorf("error decoding attributes map: %w", err)
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
Loading…
Reference in new issue