...
1
9
10 package openapi
11
12 type VolumeMount struct {
13 Name string `json:"name"`
14
15 Path string `json:"path"`
16 }
17
18
19 func AssertVolumeMountRequired(obj VolumeMount) error {
20 elements := map[string]interface{}{
21 "name": obj.Name,
22 "path": obj.Path,
23 }
24 for name, el := range elements {
25 if isZero := IsZeroValue(el); isZero {
26 return &RequiredError{Field: name}
27 }
28 }
29
30 return nil
31 }
32
33
34
35 func AssertRecurseVolumeMountRequired(objSlice interface{}) error {
36 return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
37 aVolumeMount, ok := obj.(VolumeMount)
38 if !ok {
39 return ErrTypeAssertionError
40 }
41 return AssertVolumeMountRequired(aVolumeMount)
42 })
43 }
44
View as plain text