// 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 (
	"encoding/json"

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

// LogConfig The logging configuration for this container
// swagger:model LogConfig
type LogConfig struct {

	// log driver
	// Enum: [json-file syslog journald gelf fluentd awslogs splunk etwlogs none]
	LogDriver string `json:"Type,omitempty"`

	// log opts
	LogOpts map[string]string `json:"Config,omitempty"`
}

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

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

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

var logConfigTypeLogDriverPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["json-file","syslog","journald","gelf","fluentd","awslogs","splunk","etwlogs","none"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		logConfigTypeLogDriverPropEnum = append(logConfigTypeLogDriverPropEnum, v)
	}
}

const (

	// LogConfigLogDriverJSONFile captures enum value "json-file"
	LogConfigLogDriverJSONFile string = "json-file"

	// LogConfigLogDriverSyslog captures enum value "syslog"
	LogConfigLogDriverSyslog string = "syslog"

	// LogConfigLogDriverJournald captures enum value "journald"
	LogConfigLogDriverJournald string = "journald"

	// LogConfigLogDriverGelf captures enum value "gelf"
	LogConfigLogDriverGelf string = "gelf"

	// LogConfigLogDriverFluentd captures enum value "fluentd"
	LogConfigLogDriverFluentd string = "fluentd"

	// LogConfigLogDriverAwslogs captures enum value "awslogs"
	LogConfigLogDriverAwslogs string = "awslogs"

	// LogConfigLogDriverSplunk captures enum value "splunk"
	LogConfigLogDriverSplunk string = "splunk"

	// LogConfigLogDriverEtwlogs captures enum value "etwlogs"
	LogConfigLogDriverEtwlogs string = "etwlogs"

	// LogConfigLogDriverNone captures enum value "none"
	LogConfigLogDriverNone string = "none"
)

// prop value enum
func (m *LogConfig) validateLogDriverEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, logConfigTypeLogDriverPropEnum); err != nil {
		return err
	}
	return nil
}

func (m *LogConfig) validateLogDriver(formats strfmt.Registry) error {

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

	// value enum
	if err := m.validateLogDriverEnum("Type", "body", m.LogDriver); err != nil {
		return err
	}

	return nil
}

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

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