// Code generated by go-swagger; DO NOT EDIT.

package types

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

// ContainerExecInspect holds information about a running process started.
// swagger:model ContainerExecInspect
type ContainerExecInspect struct {

	// can remove
	// Required: true
	CanRemove bool `json:"CanRemove"`

	// The ID of this container
	// Required: true
	ContainerID string `json:"ContainerID"`

	// detach keys
	// Required: true
	DetachKeys string `json:"DetachKeys"`

	// The last exit code of this container
	// Required: true
	ExitCode int64 `json:"ExitCode"`

	// The ID of this exec
	// Required: true
	ID string `json:"ID"`

	// open stderr
	// Required: true
	OpenStderr bool `json:"OpenStderr"`

	// open stdin
	// Required: true
	OpenStdin bool `json:"OpenStdin"`

	// open stdout
	// Required: true
	OpenStdout bool `json:"OpenStdout"`

	// process config
	// Required: true
	ProcessConfig *ProcessConfig `json:"ProcessConfig"`

	// running
	// Required: true
	Running bool `json:"Running"`
}

// Validate validates this container exec inspect
func (m *ContainerExecInspect) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

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

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

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

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

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

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

func (m *ContainerExecInspect) validateCanRemove(formats strfmt.Registry) error {

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

	return nil
}

func (m *ContainerExecInspect) validateContainerID(formats strfmt.Registry) error {

	if err := validate.RequiredString("ContainerID", "body", string(m.ContainerID)); err != nil {
		return err
	}

	return nil
}

func (m *ContainerExecInspect) validateDetachKeys(formats strfmt.Registry) error {

	if err := validate.RequiredString("DetachKeys", "body", string(m.DetachKeys)); err != nil {
		return err
	}

	return nil
}

func (m *ContainerExecInspect) validateExitCode(formats strfmt.Registry) error {

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

	return nil
}

func (m *ContainerExecInspect) validateID(formats strfmt.Registry) error {

	if err := validate.RequiredString("ID", "body", string(m.ID)); err != nil {
		return err
	}

	return nil
}

func (m *ContainerExecInspect) validateOpenStderr(formats strfmt.Registry) error {

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

	return nil
}

func (m *ContainerExecInspect) validateOpenStdin(formats strfmt.Registry) error {

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

	return nil
}

func (m *ContainerExecInspect) validateOpenStdout(formats strfmt.Registry) error {

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

	return nil
}

func (m *ContainerExecInspect) validateProcessConfig(formats strfmt.Registry) error {

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

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

	return nil
}

func (m *ContainerExecInspect) validateRunning(formats strfmt.Registry) error {

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

	return nil
}

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

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