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