mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
* API returns more info about container * Display more info about containers * Update UI static files * Fix unit tests * Get/Set sources configuration * [ui] create container with sources mount configuration * e2e tests + ui static files * Set containers's envvars * Regenerate UI static files * Add Annotation to POST /container * [api] Create Container with Annotations * [ui] Annotations when creating container * Regenerate UI static files * [api] Endpoints when adding container * [ui] Endpoints when adding container * Regenerate UI static files
44 lines
1.1 KiB
Go
Generated
44 lines
1.1 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 Annotation struct {
|
|
Deployment map[string]string `json:"deployment"`
|
|
|
|
Service map[string]string `json:"service"`
|
|
}
|
|
|
|
// AssertAnnotationRequired checks if the required fields are not zero-ed
|
|
func AssertAnnotationRequired(obj Annotation) error {
|
|
elements := map[string]interface{}{
|
|
"deployment": obj.Deployment,
|
|
"service": obj.Service,
|
|
}
|
|
for name, el := range elements {
|
|
if isZero := IsZeroValue(el); isZero {
|
|
return &RequiredError{Field: name}
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// AssertRecurseAnnotationRequired recursively checks if required fields are not zero-ed in a nested slice.
|
|
// Accepts only nested slice of Annotation (e.g. [][]Annotation), otherwise ErrTypeAssertionError is thrown.
|
|
func AssertRecurseAnnotationRequired(objSlice interface{}) error {
|
|
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
|
|
aAnnotation, ok := obj.(Annotation)
|
|
if !ok {
|
|
return ErrTypeAssertionError
|
|
}
|
|
return AssertAnnotationRequired(aAnnotation)
|
|
})
|
|
}
|