// 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 DiskEncryptionSet_Spec struct {
	// Identity: The managed identity for the disk encryption set. It should be given permission on the key vault before it can
	// be used  to encrypt disks.
	Identity *EncryptionSetIdentity `json:"identity,omitempty"`

	// Location: Resource location
	Location   *string                  `json:"location,omitempty"`
	Name       string                   `json:"name,omitempty"`
	Properties *EncryptionSetProperties `json:"properties,omitempty"`

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

var _ genruntime.ARMResourceSpec = &DiskEncryptionSet_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2022-07-02"
func (encryptionSet DiskEncryptionSet_Spec) GetAPIVersion() string {
	return "2022-07-02"
}

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Compute/diskEncryptionSets"
func (encryptionSet *DiskEncryptionSet_Spec) GetType() string {
	return "Microsoft.Compute/diskEncryptionSets"
}

// The managed identity for the disk encryption set. It should be given permission on the key vault before it can be used
// to encrypt disks.
type EncryptionSetIdentity struct {
	// Type: The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported for new creations.
	// Disk Encryption Sets can be updated with Identity type None during migration of subscription to a new Azure Active
	// Directory tenant; it will cause the encrypted resources to lose access to the keys.
	Type                   *EncryptionSetIdentity_Type            `json:"type,omitempty"`
	UserAssignedIdentities map[string]UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

type EncryptionSetProperties struct {
	// ActiveKey: The key vault key which is currently used by this disk encryption set.
	ActiveKey *KeyForDiskEncryptionSet `json:"activeKey,omitempty"`

	// EncryptionType: The type of key used to encrypt the data of the disk.
	EncryptionType *DiskEncryptionSetType `json:"encryptionType,omitempty"`

	// FederatedClientId: Multi-tenant application client id to access key vault in a different tenant. Setting the value to
	// 'None' will clear the property.
	FederatedClientId *string `json:"federatedClientId,omitempty" optionalConfigMapPair:"FederatedClientId"`

	// RotationToLatestKeyVersionEnabled: Set this flag to true to enable auto-updating of this disk encryption set to the
	// latest key version.
	RotationToLatestKeyVersionEnabled *bool `json:"rotationToLatestKeyVersionEnabled,omitempty"`
}

// The type of key used to encrypt the data of the disk.
// +kubebuilder:validation:Enum={"ConfidentialVmEncryptedWithCustomerKey","EncryptionAtRestWithCustomerKey","EncryptionAtRestWithPlatformAndCustomerKeys"}
type DiskEncryptionSetType string

const (
	DiskEncryptionSetType_ConfidentialVmEncryptedWithCustomerKey      = DiskEncryptionSetType("ConfidentialVmEncryptedWithCustomerKey")
	DiskEncryptionSetType_EncryptionAtRestWithCustomerKey             = DiskEncryptionSetType("EncryptionAtRestWithCustomerKey")
	DiskEncryptionSetType_EncryptionAtRestWithPlatformAndCustomerKeys = DiskEncryptionSetType("EncryptionAtRestWithPlatformAndCustomerKeys")
)

// Mapping from string to DiskEncryptionSetType
var diskEncryptionSetType_Values = map[string]DiskEncryptionSetType{
	"confidentialvmencryptedwithcustomerkey":      DiskEncryptionSetType_ConfidentialVmEncryptedWithCustomerKey,
	"encryptionatrestwithcustomerkey":             DiskEncryptionSetType_EncryptionAtRestWithCustomerKey,
	"encryptionatrestwithplatformandcustomerkeys": DiskEncryptionSetType_EncryptionAtRestWithPlatformAndCustomerKeys,
}

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

const (
	EncryptionSetIdentity_Type_None                       = EncryptionSetIdentity_Type("None")
	EncryptionSetIdentity_Type_SystemAssigned             = EncryptionSetIdentity_Type("SystemAssigned")
	EncryptionSetIdentity_Type_SystemAssignedUserAssigned = EncryptionSetIdentity_Type("SystemAssigned, UserAssigned")
	EncryptionSetIdentity_Type_UserAssigned               = EncryptionSetIdentity_Type("UserAssigned")
)

// Mapping from string to EncryptionSetIdentity_Type
var encryptionSetIdentity_Type_Values = map[string]EncryptionSetIdentity_Type{
	"none":                         EncryptionSetIdentity_Type_None,
	"systemassigned":               EncryptionSetIdentity_Type_SystemAssigned,
	"systemassigned, userassigned": EncryptionSetIdentity_Type_SystemAssignedUserAssigned,
	"userassigned":                 EncryptionSetIdentity_Type_UserAssigned,
}

// Key Vault Key Url to be used for server side encryption of Managed Disks and Snapshots
type KeyForDiskEncryptionSet struct {
	// KeyUrl: Fully versioned Key Url pointing to a key in KeyVault. Version segment of the Url is required regardless of
	// rotationToLatestKeyVersionEnabled value.
	KeyUrl *string `json:"keyUrl,omitempty" optionalConfigMapPair:"KeyUrl"`

	// SourceVault: Resource id of the KeyVault containing the key or secret. This property is optional and cannot be used if
	// the KeyVault subscription is not the same as the Disk Encryption Set subscription.
	SourceVault *SourceVault `json:"sourceVault,omitempty"`
}

// Information about the user assigned identity for the resource
type UserAssignedIdentityDetails struct {
}

// The vault id is an Azure Resource Manager Resource id in the form
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}
type SourceVault struct {
	// Id: Resource Id
	Id *string `json:"id,omitempty"`
}
