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

// GetOpportunitiesGroupsGroupIDOKBody get_opportunities_groups_group_id_ok
//
// 200 ok object
// swagger:model getOpportunitiesGroupsGroupIdOKBody

type GetOpportunitiesGroupsGroupIDOKBody struct {

	// get_opportunities_groups_group_id_connected_groups
	//
	// The groups that are connected to this group on the opportunities map
	// Required: true
	// Max Items: 50
	ConnectedGroups []int32 `json:"connected_groups"`

	// get_opportunities_groups_group_id_description
	//
	// description string
	// Required: true
	Description *string `json:"description"`

	// get_opportunities_groups_group_id_group_id
	//
	// group_id integer
	// Required: true
	GroupID *int32 `json:"group_id"`

	// get_opportunities_groups_group_id_name
	//
	// name string
	// Required: true
	Name *string `json:"name"`

	// get_opportunities_groups_group_id_notification
	//
	// notification string
	// Required: true
	Notification *string `json:"notification"`

	// get_opportunities_groups_group_id_required_tasks
	//
	// Tasks need to complete for this group
	// Required: true
	// Max Items: 100
	RequiredTasks []int32 `json:"required_tasks"`
}

/* polymorph getOpportunitiesGroupsGroupIdOKBody connected_groups false */

/* polymorph getOpportunitiesGroupsGroupIdOKBody description false */

/* polymorph getOpportunitiesGroupsGroupIdOKBody group_id false */

/* polymorph getOpportunitiesGroupsGroupIdOKBody name false */

/* polymorph getOpportunitiesGroupsGroupIdOKBody notification false */

/* polymorph getOpportunitiesGroupsGroupIdOKBody required_tasks false */

// Validate validates this get opportunities groups group Id o k body
func (m *GetOpportunitiesGroupsGroupIDOKBody) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

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

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

func (m *GetOpportunitiesGroupsGroupIDOKBody) validateConnectedGroups(formats strfmt.Registry) error {

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

	iConnectedGroupsSize := int64(len(m.ConnectedGroups))

	if err := validate.MaxItems("connected_groups", "body", iConnectedGroupsSize, 50); err != nil {
		return err
	}

	return nil
}

func (m *GetOpportunitiesGroupsGroupIDOKBody) validateDescription(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetOpportunitiesGroupsGroupIDOKBody) validateGroupID(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetOpportunitiesGroupsGroupIDOKBody) validateName(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetOpportunitiesGroupsGroupIDOKBody) validateNotification(formats strfmt.Registry) error {

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

	return nil
}

func (m *GetOpportunitiesGroupsGroupIDOKBody) validateRequiredTasks(formats strfmt.Registry) error {

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

	iRequiredTasksSize := int64(len(m.RequiredTasks))

	if err := validate.MaxItems("required_tasks", "body", iRequiredTasksSize, 100); err != nil {
		return err
	}

	return nil
}

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

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