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

// GetCorporationsCorporationIDDivisionsOKBodyWalletItems get_corporations_corporation_id_divisions_wallet
//
// wallet object
// swagger:model getCorporationsCorporationIdDivisionsOKBodyWalletItems

type GetCorporationsCorporationIDDivisionsOKBodyWalletItems struct {

	// get_corporations_corporation_id_divisions_division
	//
	// division integer
	// Maximum: 7
	// Minimum: 1
	Division int32 `json:"division,omitempty"`

	// get_corporations_corporation_id_divisions_name
	//
	// name string
	// Max Length: 50
	Name string `json:"name,omitempty"`
}

/* polymorph getCorporationsCorporationIdDivisionsOKBodyWalletItems division false */

/* polymorph getCorporationsCorporationIdDivisionsOKBodyWalletItems name false */

// Validate validates this get corporations corporation Id divisions o k body wallet items
func (m *GetCorporationsCorporationIDDivisionsOKBodyWalletItems) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *GetCorporationsCorporationIDDivisionsOKBodyWalletItems) validateDivision(formats strfmt.Registry) error {

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

	if err := validate.MinimumInt("division", "body", int64(m.Division), 1, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("division", "body", int64(m.Division), 7, false); err != nil {
		return err
	}

	return nil
}

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

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

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

	return nil
}

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

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