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

	// Properties: Role assignment properties.
	Properties *RoleAssignmentProperties `json:"properties,omitempty"`
}

var _ genruntime.ARMResourceSpec = &RoleAssignment_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2020-08-01-preview"
func (assignment RoleAssignment_Spec) GetAPIVersion() string {
	return "2020-08-01-preview"
}

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Authorization/roleAssignments"
func (assignment *RoleAssignment_Spec) GetType() string {
	return "Microsoft.Authorization/roleAssignments"
}

// Role assignment properties.
type RoleAssignmentProperties struct {
	// Condition: The conditions on the role assignment. This limits the resources it can be assigned to. e.g.:
	// @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase
	// 'foo_storage_container'
	Condition *string `json:"condition,omitempty"`

	// ConditionVersion: Version of the condition. Currently accepted value is '2.0'
	ConditionVersion *string `json:"conditionVersion,omitempty"`

	// DelegatedManagedIdentityResourceId: Id of the delegated managed identity resource
	DelegatedManagedIdentityResourceId *string `json:"delegatedManagedIdentityResourceId,omitempty"`

	// Description: Description of role assignment
	Description *string `json:"description,omitempty"`

	// PrincipalId: The principal ID.
	PrincipalId *string `json:"principalId,omitempty" optionalConfigMapPair:"PrincipalId"`

	// PrincipalType: The principal type of the assigned principal ID.
	PrincipalType *RoleAssignmentProperties_PrincipalType `json:"principalType,omitempty"`

	// RoleDefinitionId: The role definition ID. This can be the ARM ID of a custom role definition, or the well-known name of
	// a built-in role definition. See https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles for
	// well-known role definition names.
	RoleDefinitionId *string `json:"roleDefinitionId,omitempty"`
}

// +kubebuilder:validation:Enum={"ForeignGroup","Group","ServicePrincipal","User"}
type RoleAssignmentProperties_PrincipalType string

const (
	RoleAssignmentProperties_PrincipalType_ForeignGroup     = RoleAssignmentProperties_PrincipalType("ForeignGroup")
	RoleAssignmentProperties_PrincipalType_Group            = RoleAssignmentProperties_PrincipalType("Group")
	RoleAssignmentProperties_PrincipalType_ServicePrincipal = RoleAssignmentProperties_PrincipalType("ServicePrincipal")
	RoleAssignmentProperties_PrincipalType_User             = RoleAssignmentProperties_PrincipalType("User")
)

// Mapping from string to RoleAssignmentProperties_PrincipalType
var roleAssignmentProperties_PrincipalType_Values = map[string]RoleAssignmentProperties_PrincipalType{
	"foreigngroup":     RoleAssignmentProperties_PrincipalType_ForeignGroup,
	"group":            RoleAssignmentProperties_PrincipalType_Group,
	"serviceprincipal": RoleAssignmentProperties_PrincipalType_ServicePrincipal,
	"user":             RoleAssignmentProperties_PrincipalType_User,
}
