This commit is contained in:
Martin Pander
2023-12-09 19:34:45 +01:00
parent 32346e0aa9
commit 8addda35ea
144 changed files with 7247 additions and 3268 deletions

View File

@ -0,0 +1,46 @@
/*
* Dash API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 0.1
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package dashapi
type TrackingCategory struct {
Type string `json:"type"`
Name string `json:"name"`
Items []string `json:"items,omitempty"`
}
// AssertTrackingCategoryRequired checks if the required fields are not zero-ed
func AssertTrackingCategoryRequired(obj TrackingCategory) error {
elements := map[string]interface{}{
"type": obj.Type,
"name": obj.Name,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertRecurseTrackingCategoryRequired recursively checks if required fields are not zero-ed in a nested slice.
// Accepts only nested slice of TrackingCategory (e.g. [][]TrackingCategory), otherwise ErrTypeAssertionError is thrown.
func AssertRecurseTrackingCategoryRequired(objSlice interface{}) error {
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
aTrackingCategory, ok := obj.(TrackingCategory)
if !ok {
return ErrTypeAssertionError
}
return AssertTrackingCategoryRequired(aTrackingCategory)
})
}