44 lines
1.1 KiB
Go
44 lines
1.1 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 InboxItem struct {
|
|
|
|
Id int32 `json:"id,omitempty"`
|
|
|
|
Item string `json:"item"`
|
|
}
|
|
|
|
// AssertInboxItemRequired checks if the required fields are not zero-ed
|
|
func AssertInboxItemRequired(obj InboxItem) error {
|
|
elements := map[string]interface{}{
|
|
"item": obj.Item,
|
|
}
|
|
for name, el := range elements {
|
|
if isZero := IsZeroValue(el); isZero {
|
|
return &RequiredError{Field: name}
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// AssertRecurseInboxItemRequired recursively checks if required fields are not zero-ed in a nested slice.
|
|
// Accepts only nested slice of InboxItem (e.g. [][]InboxItem), otherwise ErrTypeAssertionError is thrown.
|
|
func AssertRecurseInboxItemRequired(objSlice interface{}) error {
|
|
return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
|
|
aInboxItem, ok := obj.(InboxItem)
|
|
if !ok {
|
|
return ErrTypeAssertionError
|
|
}
|
|
return AssertInboxItemRequired(aInboxItem)
|
|
})
|
|
}
|