V2
This commit is contained in:
46
backend/dashapi/model_tracking_category.go
Normal file
46
backend/dashapi/model_tracking_category.go
Normal 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)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user