// 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 ServersFailoverGroup_Spec struct {
	Name string `json:"name,omitempty"`

	// Properties: Resource properties.
	Properties *FailoverGroupProperties `json:"properties,omitempty"`

	// Tags: Resource tags.
	Tags map[string]string `json:"tags,omitempty"`
}

var _ genruntime.ARMResourceSpec = &ServersFailoverGroup_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01"
func (group ServersFailoverGroup_Spec) GetAPIVersion() string {
	return "2021-11-01"
}

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Sql/servers/failoverGroups"
func (group *ServersFailoverGroup_Spec) GetType() string {
	return "Microsoft.Sql/servers/failoverGroups"
}

// Properties of a failover group.
type FailoverGroupProperties struct {
	// Databases: List of databases in the failover group.
	Databases []string `json:"databases,omitempty"`

	// PartnerServers: List of partner server information for the failover group.
	PartnerServers []PartnerInfo `json:"partnerServers,omitempty"`

	// ReadOnlyEndpoint: Read-only endpoint of the failover group instance.
	ReadOnlyEndpoint *FailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"`

	// ReadWriteEndpoint: Read-write endpoint of the failover group instance.
	ReadWriteEndpoint *FailoverGroupReadWriteEndpoint `json:"readWriteEndpoint,omitempty"`
}

// Read-only endpoint of the failover group instance.
type FailoverGroupReadOnlyEndpoint struct {
	// FailoverPolicy: Failover policy of the read-only endpoint for the failover group.
	FailoverPolicy *FailoverGroupReadOnlyEndpoint_FailoverPolicy `json:"failoverPolicy,omitempty"`
}

// Read-write endpoint of the failover group instance.
type FailoverGroupReadWriteEndpoint struct {
	// FailoverPolicy: Failover policy of the read-write endpoint for the failover group. If failoverPolicy is Automatic then
	// failoverWithDataLossGracePeriodMinutes is required.
	FailoverPolicy *FailoverGroupReadWriteEndpoint_FailoverPolicy `json:"failoverPolicy,omitempty"`

	// FailoverWithDataLossGracePeriodMinutes: Grace period before failover with data loss is attempted for the read-write
	// endpoint. If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.
	FailoverWithDataLossGracePeriodMinutes *int `json:"failoverWithDataLossGracePeriodMinutes,omitempty"`
}

// Partner server information for the failover group.
type PartnerInfo struct {
	// Id: Resource identifier of the partner server.
	Id *string `json:"id,omitempty"`
}

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

const (
	FailoverGroupReadOnlyEndpoint_FailoverPolicy_Disabled = FailoverGroupReadOnlyEndpoint_FailoverPolicy("Disabled")
	FailoverGroupReadOnlyEndpoint_FailoverPolicy_Enabled  = FailoverGroupReadOnlyEndpoint_FailoverPolicy("Enabled")
)

// Mapping from string to FailoverGroupReadOnlyEndpoint_FailoverPolicy
var failoverGroupReadOnlyEndpoint_FailoverPolicy_Values = map[string]FailoverGroupReadOnlyEndpoint_FailoverPolicy{
	"disabled": FailoverGroupReadOnlyEndpoint_FailoverPolicy_Disabled,
	"enabled":  FailoverGroupReadOnlyEndpoint_FailoverPolicy_Enabled,
}

// +kubebuilder:validation:Enum={"Automatic","Manual"}
type FailoverGroupReadWriteEndpoint_FailoverPolicy string

const (
	FailoverGroupReadWriteEndpoint_FailoverPolicy_Automatic = FailoverGroupReadWriteEndpoint_FailoverPolicy("Automatic")
	FailoverGroupReadWriteEndpoint_FailoverPolicy_Manual    = FailoverGroupReadWriteEndpoint_FailoverPolicy("Manual")
)

// Mapping from string to FailoverGroupReadWriteEndpoint_FailoverPolicy
var failoverGroupReadWriteEndpoint_FailoverPolicy_Values = map[string]FailoverGroupReadWriteEndpoint_FailoverPolicy{
	"automatic": FailoverGroupReadWriteEndpoint_FailoverPolicy_Automatic,
	"manual":    FailoverGroupReadWriteEndpoint_FailoverPolicy_Manual,
}
