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

// CentralAccessLog central access log
//
// swagger:model centralAccessLog
type CentralAccessLog struct {

	// content
	// Required: true
	Content *string `json:"content"`

	// happened on
	// Required: true
	HappenedOn *string `json:"happened_on"`

	// id
	// Required: true
	ID *string `json:"id"`

	// user
	// Required: true
	User *string `json:"user"`
}

// Validate validates this central access log
func (m *CentralAccessLog) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

func (m *CentralAccessLog) validateContent(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralAccessLog) validateHappenedOn(formats strfmt.Registry) error {

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

	return nil
}

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

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

	return nil
}

func (m *CentralAccessLog) validateUser(formats strfmt.Registry) error {

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

	return nil
}

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

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