Files
odo/pkg/apiserver-gen/go/model_devfile_put_request.go
Philippe Martin 2c3d2ea0b1 Add /devfile PUT and GET endpoints (#6950)
* Serve /devfile

* Implement /devfile endpoints

* Load/Save devfile from UI

* Required metadata fields in the response

* Add an Apply button on 1st tab

* Fix: validate new devfile, not previous one

* Add generated UI files to gitattributes file

* Fix rebase
2023-07-06 12:30:48 -04:00

41 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 DevfilePutRequest struct {
Content string `json:"content"`
}
// AssertDevfilePutRequestRequired checks if the required fields are not zero-ed
func AssertDevfilePutRequestRequired(obj DevfilePutRequest) error {
elements := map[string]interface{}{
"content": obj.Content,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertRecurseDevfilePutRequestRequired recursively checks if required fields are not zero-ed in a nested slice.
// Accepts only nested slice of DevfilePutRequest (e.g. [][]DevfilePutRequest), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseDevfilePutRequestRequired(objSlice interface{}) error {
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
aDevfilePutRequest, ok := obj.(DevfilePutRequest)
if !ok {
return ErrTypeAssertionError
}
return AssertDevfilePutRequestRequired(aDevfilePutRequest)
})
}