Files
dash/backend/dashapi/model_tracking_category.go
Martin Pander 8addda35ea V2
2023-12-09 19:34:45 +01:00

47 lines
1.3 KiB
Go

/*
* 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)
})
}