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

// CacheConfigSetter ConfigSetter defines the cache parameters that users can configure per datasource
// This is only intended to be consumed by the SetCache HTTP Handler
//
// swagger:model CacheConfigSetter
type CacheConfigSetter struct {

	// data source ID
	DataSourceID int64 `json:"dataSourceID,omitempty"`

	// data source UID
	DataSourceUID string `json:"dataSourceUID,omitempty"`

	// enabled
	Enabled bool `json:"enabled,omitempty"`

	// TTL MS, or "time to live", is how long a cached item will stay in the cache before it is removed (in milliseconds)
	TTLQueriesMs int64 `json:"ttlQueriesMs,omitempty"`

	// ttl resources ms
	TTLResourcesMs int64 `json:"ttlResourcesMs,omitempty"`

	// If UseDefaultTTL is enabled, then the TTLQueriesMS and TTLResourcesMS in this object is always sent as the default TTL located in grafana.ini
	UseDefaultTTL bool `json:"useDefaultTTL,omitempty"`
}

// Validate validates this cache config setter
func (m *CacheConfigSetter) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this cache config setter based on context it is used
func (m *CacheConfigSetter) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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