// 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"
)

// GetCharactersCharacterIDBookmarksOKBodyItems get_characters_character_id_bookmarks_200_ok
//
// 200 ok object
// swagger:model getCharactersCharacterIdBookmarksOKBodyItems

type GetCharactersCharacterIDBookmarksOKBodyItems struct {

	// get_characters_character_id_bookmarks_bookmark_id
	//
	// bookmark_id integer
	// Required: true
	BookmarkID *int64 `json:"bookmark_id"`

	// get_characters_character_id_bookmarks_create_date
	//
	// create_date string
	// Required: true
	CreateDate *strfmt.DateTime `json:"create_date"`

	// get_characters_character_id_bookmarks_creator_id
	//
	// creator_id integer
	// Required: true
	CreatorID *int32 `json:"creator_id"`

	// get_characters_character_id_bookmarks_folder_id
	//
	// folder_id integer
	FolderID int32 `json:"folder_id,omitempty"`

	// get_characters_character_id_bookmarks_memo
	//
	// memo string
	// Required: true
	Memo *string `json:"memo"`

	// get_characters_character_id_bookmarks_note
	//
	// note string
	// Required: true
	Note *string `json:"note"`

	// get_characters_character_id_bookmarks_owner_id
	//
	// owner_id integer
	// Required: true
	OwnerID *int32 `json:"owner_id"`

	// target
	// Required: true
	Target *GetCharactersCharacterIDBookmarksOKBodyItemsTarget `json:"target"`
}

/* polymorph getCharactersCharacterIdBookmarksOKBodyItems bookmark_id false */

/* polymorph getCharactersCharacterIdBookmarksOKBodyItems create_date false */

/* polymorph getCharactersCharacterIdBookmarksOKBodyItems creator_id false */

/* polymorph getCharactersCharacterIdBookmarksOKBodyItems folder_id false */

/* polymorph getCharactersCharacterIdBookmarksOKBodyItems memo false */

/* polymorph getCharactersCharacterIdBookmarksOKBodyItems note false */

/* polymorph getCharactersCharacterIdBookmarksOKBodyItems owner_id false */

/* polymorph getCharactersCharacterIdBookmarksOKBodyItems target false */

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

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

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

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

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

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

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

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

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

func (m *GetCharactersCharacterIDBookmarksOKBodyItems) validateBookmarkID(formats strfmt.Registry) error {

	if err := validate.Required("bookmark_id", "body", m.BookmarkID); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDBookmarksOKBodyItems) validateCreateDate(formats strfmt.Registry) error {

	if err := validate.Required("create_date", "body", m.CreateDate); err != nil {
		return err
	}

	if err := validate.FormatOf("create_date", "body", "date-time", m.CreateDate.String(), formats); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDBookmarksOKBodyItems) validateCreatorID(formats strfmt.Registry) error {

	if err := validate.Required("creator_id", "body", m.CreatorID); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDBookmarksOKBodyItems) validateMemo(formats strfmt.Registry) error {

	if err := validate.Required("memo", "body", m.Memo); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDBookmarksOKBodyItems) validateNote(formats strfmt.Registry) error {

	if err := validate.Required("note", "body", m.Note); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDBookmarksOKBodyItems) validateOwnerID(formats strfmt.Registry) error {

	if err := validate.Required("owner_id", "body", m.OwnerID); err != nil {
		return err
	}

	return nil
}

func (m *GetCharactersCharacterIDBookmarksOKBodyItems) validateTarget(formats strfmt.Registry) error {

	if err := validate.Required("target", "body", m.Target); err != nil {
		return err
	}

	if m.Target != nil {

		if err := m.Target.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("target")
			}
			return err
		}
	}

	return nil
}

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

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