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

// RPCUpdateKubectlClusterSettingsRequest rpc update kubectl cluster settings request
//
// swagger:model rpcUpdateKubectlClusterSettingsRequest
type RPCUpdateKubectlClusterSettingsRequest struct {

	// disable c l i kubectl
	DisableCLIKubectl bool `json:"disableCLIKubectl,omitempty"`

	// disable web kubectl
	DisableWebKubectl bool `json:"disableWebKubectl,omitempty"`

	// opts
	Opts *V3QueryOptions `json:"opts,omitempty"`
}

// Validate validates this rpc update kubectl cluster settings request
func (m *RPCUpdateKubectlClusterSettingsRequest) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *RPCUpdateKubectlClusterSettingsRequest) validateOpts(formats strfmt.Registry) error {
	if swag.IsZero(m.Opts) { // not required
		return nil
	}

	if m.Opts != nil {
		if err := m.Opts.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("opts")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("opts")
			}
			return err
		}
	}

	return nil
}

// ContextValidate validate this rpc update kubectl cluster settings request based on the context it is used
func (m *RPCUpdateKubectlClusterSettingsRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

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

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

func (m *RPCUpdateKubectlClusterSettingsRequest) contextValidateOpts(ctx context.Context, formats strfmt.Registry) error {

	if m.Opts != nil {
		if err := m.Opts.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("opts")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("opts")
			}
			return err
		}
	}

	return nil
}

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

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