// 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 (
	"context"

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

// CentralChangeClusterNameReq central change cluster name req
//
// swagger:model centralChangeClusterNameReq
type CentralChangeClusterNameReq struct {

	// cluster id
	// Required: true
	ClusterID *string `json:"cluster_id"`

	// cluster name
	// Required: true
	ClusterName *string `json:"cluster_name"`

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

	// project id
	// Required: true
	ProjectID *string `json:"project_id"`
}

// Validate validates this central change cluster name req
func (m *CentralChangeClusterNameReq) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

func (m *CentralChangeClusterNameReq) validateClusterID(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralChangeClusterNameReq) validateClusterName(formats strfmt.Registry) error {

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

	return nil
}

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

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

	return nil
}

func (m *CentralChangeClusterNameReq) validateProjectID(formats strfmt.Registry) error {

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

	return nil
}

// ContextValidate validates this central change cluster name req based on context it is used
func (m *CentralChangeClusterNameReq) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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