mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* Get and display autoBuild / deployByDefault * Set autoBuild / deployByDefault * Update ui static files * [api] Add orpahn field to Image/Resource * Display more info about Build / Deploy at startup * Update ui static files * e2e tests * Update ui static files * Fix unit tests * 3-states button for AutoBuild * 3-states button for DeployByDefault * static ui files
63 lines
1.5 KiB
Go
Generated
63 lines
1.5 KiB
Go
Generated
/*
|
|
* odo dev
|
|
*
|
|
* API interface for 'odo dev'
|
|
*
|
|
* API version: 0.1
|
|
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
|
*/
|
|
|
|
package openapi
|
|
|
|
type Image struct {
|
|
Name string `json:"name"`
|
|
|
|
ImageName string `json:"imageName"`
|
|
|
|
Args []string `json:"args"`
|
|
|
|
BuildContext string `json:"buildContext"`
|
|
|
|
RootRequired bool `json:"rootRequired"`
|
|
|
|
Uri string `json:"uri"`
|
|
|
|
AutoBuild string `json:"autoBuild"`
|
|
|
|
// true if the image is not referenced in any command
|
|
Orphan bool `json:"orphan"`
|
|
}
|
|
|
|
// AssertImageRequired checks if the required fields are not zero-ed
|
|
func AssertImageRequired(obj Image) error {
|
|
elements := map[string]interface{}{
|
|
"name": obj.Name,
|
|
"imageName": obj.ImageName,
|
|
"args": obj.Args,
|
|
"buildContext": obj.BuildContext,
|
|
"rootRequired": obj.RootRequired,
|
|
"uri": obj.Uri,
|
|
"autoBuild": obj.AutoBuild,
|
|
"orphan": obj.Orphan,
|
|
}
|
|
for name, el := range elements {
|
|
if isZero := IsZeroValue(el); isZero {
|
|
return &RequiredError{Field: name}
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// AssertRecurseImageRequired recursively checks if required fields are not zero-ed in a nested slice.
|
|
// Accepts only nested slice of Image (e.g. [][]Image), otherwise ErrTypeAssertionError is thrown.
|
|
func AssertRecurseImageRequired(objSlice interface{}) error {
|
|
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
|
|
aImage, ok := obj.(Image)
|
|
if !ok {
|
|
return ErrTypeAssertionError
|
|
}
|
|
return AssertImageRequired(aImage)
|
|
})
|
|
}
|