...
1
9
10 package openapi
11
12 type DevstateContainerPostRequest struct {
13
14
15 Name string `json:"name"`
16
17
18 Image string `json:"image"`
19
20
21 Command []string `json:"command,omitempty"`
22
23
24 Args []string `json:"args,omitempty"`
25
26
27 Env []Env `json:"env,omitempty"`
28
29
30 MemReq string `json:"memReq,omitempty"`
31
32
33 MemLimit string `json:"memLimit,omitempty"`
34
35
36 CpuReq string `json:"cpuReq,omitempty"`
37
38
39 CpuLimit string `json:"cpuLimit,omitempty"`
40
41
42 VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"`
43
44
45 ConfigureSources bool `json:"configureSources,omitempty"`
46
47
48 MountSources bool `json:"mountSources,omitempty"`
49
50
51 SourceMapping string `json:"sourceMapping,omitempty"`
52
53 Annotation Annotation `json:"annotation,omitempty"`
54
55
56 Endpoints []Endpoint `json:"endpoints,omitempty"`
57 }
58
59
60 func AssertDevstateContainerPostRequestRequired(obj DevstateContainerPostRequest) error {
61 elements := map[string]interface{}{
62 "name": obj.Name,
63 "image": obj.Image,
64 }
65 for name, el := range elements {
66 if isZero := IsZeroValue(el); isZero {
67 return &RequiredError{Field: name}
68 }
69 }
70
71 for _, el := range obj.Env {
72 if err := AssertEnvRequired(el); err != nil {
73 return err
74 }
75 }
76 for _, el := range obj.VolumeMounts {
77 if err := AssertVolumeMountRequired(el); err != nil {
78 return err
79 }
80 }
81 if err := AssertAnnotationRequired(obj.Annotation); err != nil {
82 return err
83 }
84 for _, el := range obj.Endpoints {
85 if err := AssertEndpointRequired(el); err != nil {
86 return err
87 }
88 }
89 return nil
90 }
91
92
93
94 func AssertRecurseDevstateContainerPostRequestRequired(objSlice interface{}) error {
95 return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
96 aDevstateContainerPostRequest, ok := obj.(DevstateContainerPostRequest)
97 if !ok {
98 return ErrTypeAssertionError
99 }
100 return AssertDevstateContainerPostRequestRequired(aDevstateContainerPostRequest)
101 })
102 }
103
View as plain text