// 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 (
	"encoding/json"

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

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

// GetIndustrySystemsOKBodyItemsCostIndicesItems get_industry_systems_cost_indice
//
// cost_indice object
// swagger:model getIndustrySystemsOKBodyItemsCostIndicesItems

type GetIndustrySystemsOKBodyItemsCostIndicesItems struct {

	// get_industry_systems_activity
	//
	// activity string
	// Required: true
	Activity *string `json:"activity"`

	// get_industry_systems_cost_index
	//
	// cost_index number
	// Required: true
	CostIndex *float32 `json:"cost_index"`
}

/* polymorph getIndustrySystemsOKBodyItemsCostIndicesItems activity false */

/* polymorph getIndustrySystemsOKBodyItemsCostIndicesItems cost_index false */

// Validate validates this get industry systems o k body items cost indices items
func (m *GetIndustrySystemsOKBodyItemsCostIndicesItems) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

var getIndustrySystemsOKBodyItemsCostIndicesItemsTypeActivityPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["none","manufacturing","researching_technology","researching_time_efficiency","researching_material_efficiency","copying","duplicating","invention","reverse_engineering"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getIndustrySystemsOKBodyItemsCostIndicesItemsTypeActivityPropEnum = append(getIndustrySystemsOKBodyItemsCostIndicesItemsTypeActivityPropEnum, v)
	}
}

const (
	// GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityNone captures enum value "none"
	GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityNone string = "none"
	// GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityManufacturing captures enum value "manufacturing"
	GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityManufacturing string = "manufacturing"
	// GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityResearchingTechnology captures enum value "researching_technology"
	GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityResearchingTechnology string = "researching_technology"
	// GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityResearchingTimeEfficiency captures enum value "researching_time_efficiency"
	GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityResearchingTimeEfficiency string = "researching_time_efficiency"
	// GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityResearchingMaterialEfficiency captures enum value "researching_material_efficiency"
	GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityResearchingMaterialEfficiency string = "researching_material_efficiency"
	// GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityCopying captures enum value "copying"
	GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityCopying string = "copying"
	// GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityDuplicating captures enum value "duplicating"
	GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityDuplicating string = "duplicating"
	// GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityInvention captures enum value "invention"
	GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityInvention string = "invention"
	// GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityReverseEngineering captures enum value "reverse_engineering"
	GetIndustrySystemsOKBodyItemsCostIndicesItemsActivityReverseEngineering string = "reverse_engineering"
)

// prop value enum
func (m *GetIndustrySystemsOKBodyItemsCostIndicesItems) validateActivityEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, getIndustrySystemsOKBodyItemsCostIndicesItemsTypeActivityPropEnum); err != nil {
		return err
	}
	return nil
}

func (m *GetIndustrySystemsOKBodyItemsCostIndicesItems) validateActivity(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateActivityEnum("activity", "body", *m.Activity); err != nil {
		return err
	}

	return nil
}

func (m *GetIndustrySystemsOKBodyItemsCostIndicesItems) validateCostIndex(formats strfmt.Registry) error {

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

	return nil
}

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

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