/
model_exported_test_information.go
49 lines (43 loc) 路 1.38 KB
/
model_exported_test_information.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* TraceTest
*
* OpenAPI definition for TraceTest endpoint and resources
*
* API version: 0.2.1
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
type ExportedTestInformation struct {
Test Test `json:"test"`
Run TestRun `json:"run"`
}
// AssertExportedTestInformationRequired checks if the required fields are not zero-ed
func AssertExportedTestInformationRequired(obj ExportedTestInformation) error {
elements := map[string]interface{}{
"test": obj.Test,
"run": obj.Run,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
if err := AssertTestRequired(obj.Test); err != nil {
return err
}
if err := AssertTestRunRequired(obj.Run); err != nil {
return err
}
return nil
}
// AssertRecurseExportedTestInformationRequired recursively checks if required fields are not zero-ed in a nested slice.
// Accepts only nested slice of ExportedTestInformation (e.g. [][]ExportedTestInformation), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseExportedTestInformationRequired(objSlice interface{}) error {
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
aExportedTestInformation, ok := obj.(ExportedTestInformation)
if !ok {
return ErrTypeAssertionError
}
return AssertExportedTestInformationRequired(aExportedTestInformation)
})
}