/*
 * 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 PlanWeek struct {

	Date string `json:"date"`

	Items []PlanWeekItem `json:"items,omitempty"`
}

// AssertPlanWeekRequired checks if the required fields are not zero-ed
func AssertPlanWeekRequired(obj PlanWeek) error {
	elements := map[string]interface{}{
		"date": obj.Date,
	}
	for name, el := range elements {
		if isZero := IsZeroValue(el); isZero {
			return &RequiredError{Field: name}
		}
	}

	for _, el := range obj.Items {
		if err := AssertPlanWeekItemRequired(el); err != nil {
			return err
		}
	}
	return nil
}

// AssertRecursePlanWeekRequired recursively checks if required fields are not zero-ed in a nested slice.
// Accepts only nested slice of PlanWeek (e.g. [][]PlanWeek), otherwise ErrTypeAssertionError is thrown.
func AssertRecursePlanWeekRequired(objSlice interface{}) error {
	return AssertRecurseInterfaceRequired(objSlice, func(obj interface{}) error {
		aPlanWeek, ok := obj.(PlanWeek)
		if !ok {
			return ErrTypeAssertionError
		}
		return AssertPlanWeekRequired(aPlanWeek)
	})
}
