// 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 ServersDatabase_Spec struct {
	// Identity: The Azure Active Directory identity of the database.
	Identity *DatabaseIdentity `json:"identity,omitempty"`

	// Location: Resource location.
	Location *string `json:"location,omitempty"`
	Name     string  `json:"name,omitempty"`

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

	// Sku: The database SKU.
	// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition,
	// family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation`
	// REST API or one of the following commands:
	// ```azurecli
	// az sql db list-editions -l <location> -o table
	// ````
	// ```powershell
	// Get-AzSqlServerServiceObjective -Location <location>
	// ````
	Sku *Sku `json:"sku,omitempty"`

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

var _ genruntime.ARMResourceSpec = &ServersDatabase_Spec{}

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

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

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

// Azure Active Directory identity configuration for a resource.
type DatabaseIdentity struct {
	// Type: The identity type
	Type                   *DatabaseIdentity_Type                 `json:"type,omitempty"`
	UserAssignedIdentities map[string]UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

// The database's properties.
type DatabaseProperties struct {
	// AutoPauseDelay: Time in minutes after which database is automatically paused. A value of -1 means that automatic pause
	// is disabled
	AutoPauseDelay *int `json:"autoPauseDelay,omitempty"`

	// CatalogCollation: Collation of the metadata catalog.
	CatalogCollation *DatabaseProperties_CatalogCollation `json:"catalogCollation,omitempty"`

	// Collation: The collation of the database.
	Collation *string `json:"collation,omitempty"`

	// CreateMode: Specifies the mode of database creation.
	// Default: regular database creation.
	// Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the
	// source database.
	// Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the
	// resource ID of the existing primary database.
	// PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId
	// must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
	// Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable
	// database resource ID to restore.
	// Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If
	// sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise
	// sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored.
	// restorePointInTime may also be specified to restore from an earlier point in time.
	// RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault.
	// recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
	// Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
	CreateMode *DatabaseProperties_CreateMode `json:"createMode,omitempty"`

	// ElasticPoolId: The resource identifier of the elastic pool containing this database.
	ElasticPoolId *string `json:"elasticPoolId,omitempty"`

	// FederatedClientId: The Client id used for cross tenant per database CMK scenario
	FederatedClientId *string `json:"federatedClientId,omitempty"`

	// HighAvailabilityReplicaCount: The number of secondary replicas associated with the database that are used to provide
	// high availability. Not applicable to a Hyperscale database within an elastic pool.
	HighAvailabilityReplicaCount *int `json:"highAvailabilityReplicaCount,omitempty"`

	// IsLedgerOn: Whether or not this database is a ledger database, which means all tables in the database are ledger tables.
	// Note: the value of this property cannot be changed after the database has been created.
	IsLedgerOn *bool `json:"isLedgerOn,omitempty"`

	// LicenseType: The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you
	// have a license and are eligible for the Azure Hybrid Benefit.
	LicenseType *DatabaseProperties_LicenseType `json:"licenseType,omitempty"`

	// LongTermRetentionBackupResourceId: The resource identifier of the long term retention backup associated with create
	// operation of this database.
	LongTermRetentionBackupResourceId *string `json:"longTermRetentionBackupResourceId,omitempty"`

	// MaintenanceConfigurationId: Maintenance configuration id assigned to the database. This configuration defines the period
	// when the maintenance updates will occur.
	MaintenanceConfigurationId *string `json:"maintenanceConfigurationId,omitempty"`

	// MaxSizeBytes: The max size of the database expressed in bytes.
	MaxSizeBytes *int `json:"maxSizeBytes,omitempty"`

	// MinCapacity: Minimal capacity that database will always have allocated, if not paused
	MinCapacity *float64 `json:"minCapacity,omitempty"`

	// ReadScale: The state of read-only routing. If enabled, connections that have application intent set to readonly in their
	// connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale
	// database within an elastic pool.
	ReadScale *DatabaseProperties_ReadScale `json:"readScale,omitempty"`

	// RecoverableDatabaseId: The resource identifier of the recoverable database associated with create operation of this
	// database.
	RecoverableDatabaseId *string `json:"recoverableDatabaseId,omitempty"`

	// RecoveryServicesRecoveryPointId: The resource identifier of the recovery point associated with create operation of this
	// database.
	RecoveryServicesRecoveryPointId *string `json:"recoveryServicesRecoveryPointId,omitempty"`

	// RequestedBackupStorageRedundancy: The storage account type to be used to store backups for this database.
	RequestedBackupStorageRedundancy *DatabaseProperties_RequestedBackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"`

	// RestorableDroppedDatabaseId: The resource identifier of the restorable dropped database associated with create operation
	// of this database.
	RestorableDroppedDatabaseId *string `json:"restorableDroppedDatabaseId,omitempty"`

	// RestorePointInTime: Specifies the point in time (ISO8601 format) of the source database that will be restored to create
	// the new database.
	RestorePointInTime *string `json:"restorePointInTime,omitempty"`

	// SampleName: The name of the sample schema to apply when creating this database.
	SampleName *DatabaseProperties_SampleName `json:"sampleName,omitempty"`

	// SecondaryType: The secondary type of the database if it is a secondary.  Valid values are Geo and Named.
	SecondaryType *DatabaseProperties_SecondaryType `json:"secondaryType,omitempty"`

	// SourceDatabaseDeletionDate: Specifies the time that the database was deleted.
	SourceDatabaseDeletionDate *string `json:"sourceDatabaseDeletionDate,omitempty"`

	// SourceDatabaseId: The resource identifier of the source database associated with create operation of this database.
	SourceDatabaseId *string `json:"sourceDatabaseId,omitempty"`

	// SourceResourceId: The resource identifier of the source associated with the create operation of this database.
	// This property is only supported for DataWarehouse edition and allows to restore across subscriptions.
	// When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and
	// sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover.
	// When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing database or existing sql
	// pool, and restorePointInTime must be specified.
	// When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable
	// dropped sql pool.
	// When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool.
	// When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary”
	// header must contain authentication token for the source tenant. For more details about
	// “x-ms-authorization-auxiliary” header see
	// https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant
	SourceResourceId *string `json:"sourceResourceId,omitempty"`

	// ZoneRedundant: Whether or not this database is zone redundant, which means the replicas of this database will be spread
	// across multiple availability zones.
	ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
}

// An ARM Resource SKU.
type Sku struct {
	// Capacity: Capacity of the particular SKU.
	Capacity *int `json:"capacity,omitempty"`

	// Family: If the service has different generations of hardware, for the same SKU, then that can be captured here.
	Family *string `json:"family,omitempty"`

	// Name: The name of the SKU, typically, a letter + Number code, e.g. P3.
	Name *string `json:"name,omitempty"`

	// Size: Size of the particular SKU
	Size *string `json:"size,omitempty"`

	// Tier: The tier or edition of the particular SKU, e.g. Basic, Premium.
	Tier *string `json:"tier,omitempty"`
}

// +kubebuilder:validation:Enum={"None","UserAssigned"}
type DatabaseIdentity_Type string

const (
	DatabaseIdentity_Type_None         = DatabaseIdentity_Type("None")
	DatabaseIdentity_Type_UserAssigned = DatabaseIdentity_Type("UserAssigned")
)

// Mapping from string to DatabaseIdentity_Type
var databaseIdentity_Type_Values = map[string]DatabaseIdentity_Type{
	"none":         DatabaseIdentity_Type_None,
	"userassigned": DatabaseIdentity_Type_UserAssigned,
}

// +kubebuilder:validation:Enum={"DATABASE_DEFAULT","SQL_Latin1_General_CP1_CI_AS"}
type DatabaseProperties_CatalogCollation string

const (
	DatabaseProperties_CatalogCollation_DATABASE_DEFAULT             = DatabaseProperties_CatalogCollation("DATABASE_DEFAULT")
	DatabaseProperties_CatalogCollation_SQL_Latin1_General_CP1_CI_AS = DatabaseProperties_CatalogCollation("SQL_Latin1_General_CP1_CI_AS")
)

// Mapping from string to DatabaseProperties_CatalogCollation
var databaseProperties_CatalogCollation_Values = map[string]DatabaseProperties_CatalogCollation{
	"database_default":             DatabaseProperties_CatalogCollation_DATABASE_DEFAULT,
	"sql_latin1_general_cp1_ci_as": DatabaseProperties_CatalogCollation_SQL_Latin1_General_CP1_CI_AS,
}

// +kubebuilder:validation:Enum={"Copy","Default","OnlineSecondary","PointInTimeRestore","Recovery","Restore","RestoreExternalBackup","RestoreExternalBackupSecondary","RestoreLongTermRetentionBackup","Secondary"}
type DatabaseProperties_CreateMode string

const (
	DatabaseProperties_CreateMode_Copy                           = DatabaseProperties_CreateMode("Copy")
	DatabaseProperties_CreateMode_Default                        = DatabaseProperties_CreateMode("Default")
	DatabaseProperties_CreateMode_OnlineSecondary                = DatabaseProperties_CreateMode("OnlineSecondary")
	DatabaseProperties_CreateMode_PointInTimeRestore             = DatabaseProperties_CreateMode("PointInTimeRestore")
	DatabaseProperties_CreateMode_Recovery                       = DatabaseProperties_CreateMode("Recovery")
	DatabaseProperties_CreateMode_Restore                        = DatabaseProperties_CreateMode("Restore")
	DatabaseProperties_CreateMode_RestoreExternalBackup          = DatabaseProperties_CreateMode("RestoreExternalBackup")
	DatabaseProperties_CreateMode_RestoreExternalBackupSecondary = DatabaseProperties_CreateMode("RestoreExternalBackupSecondary")
	DatabaseProperties_CreateMode_RestoreLongTermRetentionBackup = DatabaseProperties_CreateMode("RestoreLongTermRetentionBackup")
	DatabaseProperties_CreateMode_Secondary                      = DatabaseProperties_CreateMode("Secondary")
)

// Mapping from string to DatabaseProperties_CreateMode
var databaseProperties_CreateMode_Values = map[string]DatabaseProperties_CreateMode{
	"copy":                           DatabaseProperties_CreateMode_Copy,
	"default":                        DatabaseProperties_CreateMode_Default,
	"onlinesecondary":                DatabaseProperties_CreateMode_OnlineSecondary,
	"pointintimerestore":             DatabaseProperties_CreateMode_PointInTimeRestore,
	"recovery":                       DatabaseProperties_CreateMode_Recovery,
	"restore":                        DatabaseProperties_CreateMode_Restore,
	"restoreexternalbackup":          DatabaseProperties_CreateMode_RestoreExternalBackup,
	"restoreexternalbackupsecondary": DatabaseProperties_CreateMode_RestoreExternalBackupSecondary,
	"restorelongtermretentionbackup": DatabaseProperties_CreateMode_RestoreLongTermRetentionBackup,
	"secondary":                      DatabaseProperties_CreateMode_Secondary,
}

// +kubebuilder:validation:Enum={"BasePrice","LicenseIncluded"}
type DatabaseProperties_LicenseType string

const (
	DatabaseProperties_LicenseType_BasePrice       = DatabaseProperties_LicenseType("BasePrice")
	DatabaseProperties_LicenseType_LicenseIncluded = DatabaseProperties_LicenseType("LicenseIncluded")
)

// Mapping from string to DatabaseProperties_LicenseType
var databaseProperties_LicenseType_Values = map[string]DatabaseProperties_LicenseType{
	"baseprice":       DatabaseProperties_LicenseType_BasePrice,
	"licenseincluded": DatabaseProperties_LicenseType_LicenseIncluded,
}

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

const (
	DatabaseProperties_ReadScale_Disabled = DatabaseProperties_ReadScale("Disabled")
	DatabaseProperties_ReadScale_Enabled  = DatabaseProperties_ReadScale("Enabled")
)

// Mapping from string to DatabaseProperties_ReadScale
var databaseProperties_ReadScale_Values = map[string]DatabaseProperties_ReadScale{
	"disabled": DatabaseProperties_ReadScale_Disabled,
	"enabled":  DatabaseProperties_ReadScale_Enabled,
}

// +kubebuilder:validation:Enum={"Geo","GeoZone","Local","Zone"}
type DatabaseProperties_RequestedBackupStorageRedundancy string

const (
	DatabaseProperties_RequestedBackupStorageRedundancy_Geo     = DatabaseProperties_RequestedBackupStorageRedundancy("Geo")
	DatabaseProperties_RequestedBackupStorageRedundancy_GeoZone = DatabaseProperties_RequestedBackupStorageRedundancy("GeoZone")
	DatabaseProperties_RequestedBackupStorageRedundancy_Local   = DatabaseProperties_RequestedBackupStorageRedundancy("Local")
	DatabaseProperties_RequestedBackupStorageRedundancy_Zone    = DatabaseProperties_RequestedBackupStorageRedundancy("Zone")
)

// Mapping from string to DatabaseProperties_RequestedBackupStorageRedundancy
var databaseProperties_RequestedBackupStorageRedundancy_Values = map[string]DatabaseProperties_RequestedBackupStorageRedundancy{
	"geo":     DatabaseProperties_RequestedBackupStorageRedundancy_Geo,
	"geozone": DatabaseProperties_RequestedBackupStorageRedundancy_GeoZone,
	"local":   DatabaseProperties_RequestedBackupStorageRedundancy_Local,
	"zone":    DatabaseProperties_RequestedBackupStorageRedundancy_Zone,
}

// +kubebuilder:validation:Enum={"AdventureWorksLT","WideWorldImportersFull","WideWorldImportersStd"}
type DatabaseProperties_SampleName string

const (
	DatabaseProperties_SampleName_AdventureWorksLT       = DatabaseProperties_SampleName("AdventureWorksLT")
	DatabaseProperties_SampleName_WideWorldImportersFull = DatabaseProperties_SampleName("WideWorldImportersFull")
	DatabaseProperties_SampleName_WideWorldImportersStd  = DatabaseProperties_SampleName("WideWorldImportersStd")
)

// Mapping from string to DatabaseProperties_SampleName
var databaseProperties_SampleName_Values = map[string]DatabaseProperties_SampleName{
	"adventureworkslt":       DatabaseProperties_SampleName_AdventureWorksLT,
	"wideworldimportersfull": DatabaseProperties_SampleName_WideWorldImportersFull,
	"wideworldimportersstd":  DatabaseProperties_SampleName_WideWorldImportersStd,
}

// +kubebuilder:validation:Enum={"Geo","Named"}
type DatabaseProperties_SecondaryType string

const (
	DatabaseProperties_SecondaryType_Geo   = DatabaseProperties_SecondaryType("Geo")
	DatabaseProperties_SecondaryType_Named = DatabaseProperties_SecondaryType("Named")
)

// Mapping from string to DatabaseProperties_SecondaryType
var databaseProperties_SecondaryType_Values = map[string]DatabaseProperties_SecondaryType{
	"geo":   DatabaseProperties_SecondaryType_Geo,
	"named": DatabaseProperties_SecondaryType_Named,
}
