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

// GetCharactersCharacterIDOpportunitiesOKBodyItems get_characters_character_id_opportunities_200_ok
//
// 200 ok object
// swagger:model getCharactersCharacterIdOpportunitiesOKBodyItems

type GetCharactersCharacterIDOpportunitiesOKBodyItems struct {

	// get_characters_character_id_opportunities_completed_at
	//
	// completed_at string
	// Required: true
	CompletedAt *strfmt.DateTime `json:"completed_at"`

	// get_characters_character_id_opportunities_task_id
	//
	// task_id integer
	// Required: true
	TaskID *int32 `json:"task_id"`
}

/* polymorph getCharactersCharacterIdOpportunitiesOKBodyItems completed_at false */

/* polymorph getCharactersCharacterIdOpportunitiesOKBodyItems task_id false */

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

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

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

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

func (m *GetCharactersCharacterIDOpportunitiesOKBodyItems) validateCompletedAt(formats strfmt.Registry) error {

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

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

	return nil
}

func (m *GetCharactersCharacterIDOpportunitiesOKBodyItems) validateTaskID(formats strfmt.Registry) error {

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

	return nil
}

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

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