// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	strfmt "github.com/go-openapi/strfmt"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// GetCharactersCharacterIDMailLabelsOKBody get_characters_character_id_mail_labels_ok
//
// 200 ok object
// swagger:model getCharactersCharacterIdMailLabelsOKBody

type GetCharactersCharacterIDMailLabelsOKBody struct {

	// labels
	Labels GetCharactersCharacterIDMailLabelsOKBodyLabels `json:"labels"`

	// get_characters_character_id_mail_labels_total_unread_count
	//
	// total_unread_count integer
	// Minimum: 0
	TotalUnreadCount *int32 `json:"total_unread_count,omitempty"`
}

/* polymorph getCharactersCharacterIdMailLabelsOKBody labels false */

/* polymorph getCharactersCharacterIdMailLabelsOKBody total_unread_count false */

// Validate validates this get characters character Id mail labels o k body
func (m *GetCharactersCharacterIDMailLabelsOKBody) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateLabels(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if err := m.validateTotalUnreadCount(formats); err != nil {
		// prop
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (m *GetCharactersCharacterIDMailLabelsOKBody) validateLabels(formats strfmt.Registry) error {

	if swag.IsZero(m.Labels) { // not required
		return nil
	}

	return nil
}

func (m *GetCharactersCharacterIDMailLabelsOKBody) validateTotalUnreadCount(formats strfmt.Registry) error {

	if swag.IsZero(m.TotalUnreadCount) { // not required
		return nil
	}

	if err := validate.MinimumInt("total_unread_count", "body", int64(*m.TotalUnreadCount), 0, false); err != nil {
		return err
	}

	return nil
}

// MarshalBinary interface implementation
func (m *GetCharactersCharacterIDMailLabelsOKBody) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *GetCharactersCharacterIDMailLabelsOKBody) UnmarshalBinary(b []byte) error {
	var res GetCharactersCharacterIDMailLabelsOKBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
