Add controller version to generated files

This commit is contained in:
Paul Tyng
2021-08-31 09:02:23 -04:00
parent 4e9d935af2
commit 13d5677bf3
63 changed files with 73 additions and 8 deletions

View File

@@ -92,10 +92,11 @@ var fileReps = []replacement{
var embedTypes bool
type Resource struct {
StructName string
ResourcePath string
Types map[string]*FieldInfo
FieldProcessor func(name string, f *FieldInfo) error
ControllerVersion string
StructName string
ResourcePath string
Types map[string]*FieldInfo
FieldProcessor func(name string, f *FieldInfo) error
}
type FieldInfo struct {
@@ -109,9 +110,11 @@ type FieldInfo struct {
CustomUnmarshalType string
}
func NewResource(structName string, resourcePath string) *Resource {
func NewResource(version string, structName string, resourcePath string) *Resource {
baseType := NewFieldInfo(structName, resourcePath, "struct", "", false, false, "")
resource := &Resource{
ControllerVersion: version,
StructName: structName,
ResourcePath: resourcePath,
Types: map[string]*FieldInfo{
@@ -296,7 +299,7 @@ func main() {
continue
}
resource := NewResource(structName, urlPath)
resource := NewResource(fmt.Sprintf("v%s", unifiVersion), structName, urlPath)
switch resource.StructName {
case "Account":