...
1
9
10 package openapi
11
12 type ExecCommand struct {
13 Component string `json:"component"`
14
15 CommandLine string `json:"commandLine"`
16
17 WorkingDir string `json:"workingDir"`
18
19 HotReloadCapable bool `json:"hotReloadCapable"`
20 }
21
22
23 func AssertExecCommandRequired(obj ExecCommand) error {
24 elements := map[string]interface{}{
25 "component": obj.Component,
26 "commandLine": obj.CommandLine,
27 "workingDir": obj.WorkingDir,
28 "hotReloadCapable": obj.HotReloadCapable,
29 }
30 for name, el := range elements {
31 if isZero := IsZeroValue(el); isZero {
32 return &RequiredError{Field: name}
33 }
34 }
35
36 return nil
37 }
38
39
40
41 func AssertRecurseExecCommandRequired(objSlice interface{}) error {
42 return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
43 aExecCommand, ok := obj.(ExecCommand)
44 if !ok {
45 return ErrTypeAssertionError
46 }
47 return AssertExecCommandRequired(aExecCommand)
48 })
49 }
50
View as plain text