Add controller version to generated files
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user