// 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 (
	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// CentralUpdateUserReq central update user req
//
// swagger:model centralUpdateUserReq
type CentralUpdateUserReq struct {

	// org id
	// Required: true
	OrgID *string `json:"org_id"`

	// role
	// Required: true
	Role *string `json:"role"`

	// user id
	// Required: true
	UserID *string `json:"user_id"`
}

// Validate validates this central update user req
func (m *CentralUpdateUserReq) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

func (m *CentralUpdateUserReq) validateOrgID(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralUpdateUserReq) validateRole(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralUpdateUserReq) validateUserID(formats strfmt.Registry) error {

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

	return nil
}

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

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