// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package arm

import "github.com/Azure/azure-service-operator/v2/pkg/genruntime"

type RedisEnterpriseDatabase_Spec struct {
	Name string `json:"name,omitempty"`

	// Properties: Other properties of the database.
	Properties *DatabaseProperties `json:"properties,omitempty"`
}

var _ genruntime.ARMResourceSpec = &RedisEnterpriseDatabase_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2025-04-01"
func (database RedisEnterpriseDatabase_Spec) GetAPIVersion() string {
	return "2025-04-01"
}

// GetName returns the Name of the resource
func (database *RedisEnterpriseDatabase_Spec) GetName() string {
	return database.Name
}

// GetType returns the ARM Type of the resource. This is always "Microsoft.Cache/redisEnterprise/databases"
func (database *RedisEnterpriseDatabase_Spec) GetType() string {
	return "Microsoft.Cache/redisEnterprise/databases"
}

// Properties of Redis Enterprise databases, as opposed to general resource properties like location, tags
type DatabaseProperties struct {
	// AccessKeysAuthentication: This property can be Enabled/Disabled to allow or deny access with the current access keys.
	// Can be updated even after database is created.
	AccessKeysAuthentication *DatabaseProperties_AccessKeysAuthentication `json:"accessKeysAuthentication,omitempty"`

	// ClientProtocol: Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is
	// TLS-encrypted.
	ClientProtocol *DatabaseProperties_ClientProtocol `json:"clientProtocol,omitempty"`

	// ClusteringPolicy: Clustering policy - default is OSSCluster. This property must be chosen at create time, and cannot be
	// changed without deleting the database.
	ClusteringPolicy *DatabaseProperties_ClusteringPolicy `json:"clusteringPolicy,omitempty"`

	// DeferUpgrade: Option to defer upgrade when newest version is released - default is NotDeferred. Learn more:
	// https://aka.ms/redisversionupgrade
	DeferUpgrade *DatabaseProperties_DeferUpgrade `json:"deferUpgrade,omitempty"`

	// EvictionPolicy: Redis eviction policy - default is VolatileLRU
	EvictionPolicy *DatabaseProperties_EvictionPolicy `json:"evictionPolicy,omitempty"`

	// GeoReplication: Optional set of properties to configure geo replication for this database.
	GeoReplication *DatabaseProperties_GeoReplication `json:"geoReplication,omitempty"`

	// Modules: Optional set of redis modules to enable in this database - modules can only be added at creation time.
	Modules []Module `json:"modules,omitempty"`

	// Persistence: Persistence settings
	Persistence *Persistence `json:"persistence,omitempty"`

	// Port: TCP port of the database endpoint. Specified at create time. Defaults to an available port.
	Port *int `json:"port,omitempty"`
}

// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type DatabaseProperties_AccessKeysAuthentication string

const (
	DatabaseProperties_AccessKeysAuthentication_Disabled = DatabaseProperties_AccessKeysAuthentication("Disabled")
	DatabaseProperties_AccessKeysAuthentication_Enabled  = DatabaseProperties_AccessKeysAuthentication("Enabled")
)

// Mapping from string to DatabaseProperties_AccessKeysAuthentication
var databaseProperties_AccessKeysAuthentication_Values = map[string]DatabaseProperties_AccessKeysAuthentication{
	"disabled": DatabaseProperties_AccessKeysAuthentication_Disabled,
	"enabled":  DatabaseProperties_AccessKeysAuthentication_Enabled,
}

// +kubebuilder:validation:Enum={"Encrypted","Plaintext"}
type DatabaseProperties_ClientProtocol string

const (
	DatabaseProperties_ClientProtocol_Encrypted = DatabaseProperties_ClientProtocol("Encrypted")
	DatabaseProperties_ClientProtocol_Plaintext = DatabaseProperties_ClientProtocol("Plaintext")
)

// Mapping from string to DatabaseProperties_ClientProtocol
var databaseProperties_ClientProtocol_Values = map[string]DatabaseProperties_ClientProtocol{
	"encrypted": DatabaseProperties_ClientProtocol_Encrypted,
	"plaintext": DatabaseProperties_ClientProtocol_Plaintext,
}

// +kubebuilder:validation:Enum={"EnterpriseCluster","OSSCluster"}
type DatabaseProperties_ClusteringPolicy string

const (
	DatabaseProperties_ClusteringPolicy_EnterpriseCluster = DatabaseProperties_ClusteringPolicy("EnterpriseCluster")
	DatabaseProperties_ClusteringPolicy_OSSCluster        = DatabaseProperties_ClusteringPolicy("OSSCluster")
)

// Mapping from string to DatabaseProperties_ClusteringPolicy
var databaseProperties_ClusteringPolicy_Values = map[string]DatabaseProperties_ClusteringPolicy{
	"enterprisecluster": DatabaseProperties_ClusteringPolicy_EnterpriseCluster,
	"osscluster":        DatabaseProperties_ClusteringPolicy_OSSCluster,
}

// +kubebuilder:validation:Enum={"Deferred","NotDeferred"}
type DatabaseProperties_DeferUpgrade string

const (
	DatabaseProperties_DeferUpgrade_Deferred    = DatabaseProperties_DeferUpgrade("Deferred")
	DatabaseProperties_DeferUpgrade_NotDeferred = DatabaseProperties_DeferUpgrade("NotDeferred")
)

// Mapping from string to DatabaseProperties_DeferUpgrade
var databaseProperties_DeferUpgrade_Values = map[string]DatabaseProperties_DeferUpgrade{
	"deferred":    DatabaseProperties_DeferUpgrade_Deferred,
	"notdeferred": DatabaseProperties_DeferUpgrade_NotDeferred,
}

// +kubebuilder:validation:Enum={"AllKeysLFU","AllKeysLRU","AllKeysRandom","NoEviction","VolatileLFU","VolatileLRU","VolatileRandom","VolatileTTL"}
type DatabaseProperties_EvictionPolicy string

const (
	DatabaseProperties_EvictionPolicy_AllKeysLFU     = DatabaseProperties_EvictionPolicy("AllKeysLFU")
	DatabaseProperties_EvictionPolicy_AllKeysLRU     = DatabaseProperties_EvictionPolicy("AllKeysLRU")
	DatabaseProperties_EvictionPolicy_AllKeysRandom  = DatabaseProperties_EvictionPolicy("AllKeysRandom")
	DatabaseProperties_EvictionPolicy_NoEviction     = DatabaseProperties_EvictionPolicy("NoEviction")
	DatabaseProperties_EvictionPolicy_VolatileLFU    = DatabaseProperties_EvictionPolicy("VolatileLFU")
	DatabaseProperties_EvictionPolicy_VolatileLRU    = DatabaseProperties_EvictionPolicy("VolatileLRU")
	DatabaseProperties_EvictionPolicy_VolatileRandom = DatabaseProperties_EvictionPolicy("VolatileRandom")
	DatabaseProperties_EvictionPolicy_VolatileTTL    = DatabaseProperties_EvictionPolicy("VolatileTTL")
)

// Mapping from string to DatabaseProperties_EvictionPolicy
var databaseProperties_EvictionPolicy_Values = map[string]DatabaseProperties_EvictionPolicy{
	"allkeyslfu":     DatabaseProperties_EvictionPolicy_AllKeysLFU,
	"allkeyslru":     DatabaseProperties_EvictionPolicy_AllKeysLRU,
	"allkeysrandom":  DatabaseProperties_EvictionPolicy_AllKeysRandom,
	"noeviction":     DatabaseProperties_EvictionPolicy_NoEviction,
	"volatilelfu":    DatabaseProperties_EvictionPolicy_VolatileLFU,
	"volatilelru":    DatabaseProperties_EvictionPolicy_VolatileLRU,
	"volatilerandom": DatabaseProperties_EvictionPolicy_VolatileRandom,
	"volatilettl":    DatabaseProperties_EvictionPolicy_VolatileTTL,
}

type DatabaseProperties_GeoReplication struct {
	// GroupNickname: Name for the group of linked database resources
	GroupNickname *string `json:"groupNickname,omitempty"`

	// LinkedDatabases: List of database resources to link with this database
	LinkedDatabases []LinkedDatabase `json:"linkedDatabases,omitempty"`
}

// Specifies configuration of a redis module
type Module struct {
	// Args: Configuration options for the module, e.g. 'ERROR_RATE 0.01 INITIAL_SIZE 400'.
	Args *string `json:"args,omitempty"`

	// Name: The name of the module, e.g. 'RedisBloom', 'RediSearch', 'RedisTimeSeries'
	Name *string `json:"name,omitempty"`
}

// Persistence-related configuration for the Redis Enterprise database
type Persistence struct {
	// AofEnabled: Sets whether AOF is enabled. Note that at most one of AOF or RDB persistence may be enabled.
	AofEnabled *bool `json:"aofEnabled,omitempty"`

	// AofFrequency: Sets the frequency at which data is written to disk. Defaults to '1s', meaning 'every second'. Note that
	// the 'always' setting is deprecated, because of its performance impact.
	AofFrequency *Persistence_AofFrequency `json:"aofFrequency,omitempty"`

	// RdbEnabled: Sets whether RDB is enabled. Note that at most one of AOF or RDB persistence may be enabled.
	RdbEnabled *bool `json:"rdbEnabled,omitempty"`

	// RdbFrequency: Sets the frequency at which a snapshot of the database is created.
	RdbFrequency *Persistence_RdbFrequency `json:"rdbFrequency,omitempty"`
}

// Specifies details of a linked database resource.
type LinkedDatabase struct {
	// Id: Resource ID of a database resource to link with this database.
	Id *string `json:"id,omitempty"`
}

// +kubebuilder:validation:Enum={"1s","always"}
type Persistence_AofFrequency string

const (
	Persistence_AofFrequency_1S     = Persistence_AofFrequency("1s")
	Persistence_AofFrequency_Always = Persistence_AofFrequency("always")
)

// Mapping from string to Persistence_AofFrequency
var persistence_AofFrequency_Values = map[string]Persistence_AofFrequency{
	"1s":     Persistence_AofFrequency_1S,
	"always": Persistence_AofFrequency_Always,
}

// +kubebuilder:validation:Enum={"12h","1h","6h"}
type Persistence_RdbFrequency string

const (
	Persistence_RdbFrequency_12H = Persistence_RdbFrequency("12h")
	Persistence_RdbFrequency_1H  = Persistence_RdbFrequency("1h")
	Persistence_RdbFrequency_6H  = Persistence_RdbFrequency("6h")
)

// Mapping from string to Persistence_RdbFrequency
var persistence_RdbFrequency_Values = map[string]Persistence_RdbFrequency{
	"12h": Persistence_RdbFrequency_12H,
	"1h":  Persistence_RdbFrequency_1H,
	"6h":  Persistence_RdbFrequency_6H,
}
