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

// ContainerPathStat ContainerPathStat is used to describe the stat of file
// swagger:model ContainerPathStat
type ContainerPathStat struct {

	// mode
	Mode uint32 `json:"mode,omitempty"`

	// modification time.
	// Format: date-time
	Mtime strfmt.DateTime `json:"mtime,omitempty"`

	// name
	Name string `json:"name,omitempty"`

	// path
	Path string `json:"path,omitempty"`

	// size
	Size string `json:"size,omitempty"`
}

// Validate validates this container path stat
func (m *ContainerPathStat) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *ContainerPathStat) validateMtime(formats strfmt.Registry) error {

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

	if err := validate.FormatOf("mtime", "body", "date-time", m.Mtime.String(), formats); err != nil {
		return err
	}

	return nil
}

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

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