/
model_test_run_event.go
64 lines (50 loc) 路 1.63 KB
/
model_test_run_event.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* TraceTest
*
* OpenAPI definition for TraceTest endpoint and resources
*
* API version: 0.2.1
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
import (
"time"
)
type TestRunEvent struct {
Type string `json:"type,omitempty"`
Stage string `json:"stage,omitempty"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
TestId string `json:"testId,omitempty"`
RunId int32 `json:"runId,omitempty"`
DataStoreConnection ConnectionResult `json:"dataStoreConnection,omitempty"`
Polling PollingInfo `json:"polling,omitempty"`
Outputs []OutputInfo `json:"outputs,omitempty"`
}
// AssertTestRunEventRequired checks if the required fields are not zero-ed
func AssertTestRunEventRequired(obj TestRunEvent) error {
if err := AssertConnectionResultRequired(obj.DataStoreConnection); err != nil {
return err
}
if err := AssertPollingInfoRequired(obj.Polling); err != nil {
return err
}
for _, el := range obj.Outputs {
if err := AssertOutputInfoRequired(el); err != nil {
return err
}
}
return nil
}
// AssertRecurseTestRunEventRequired recursively checks if required fields are not zero-ed in a nested slice.
// Accepts only nested slice of TestRunEvent (e.g. [][]TestRunEvent), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTestRunEventRequired(objSlice interface{}) error {
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
aTestRunEvent, ok := obj.(TestRunEvent)
if !ok {
return ErrTypeAssertionError
}
return AssertTestRunEventRequired(aTestRunEvent)
})
}