// Copyright Epic Games, Inc. All Rights Reserved.
using System.ComponentModel;
using EpicGames.Core;
using EpicGames.Horde;
namespace HordeServer.Acls
{
///
/// Identifier for a profile; a group of actions which can be assigned to a user as a whole.
///
/// Id to construct from
[LogValueType]
[JsonSchemaString]
[TypeConverter(typeof(StringIdTypeConverter))]
[StringIdConverter(typeof(AclProfileIdConverter))]
public record struct AclProfileId(StringId Id)
{
///
/// Constructor
///
public AclProfileId(string id) : this(new StringId(id))
{
}
///
public bool IsEmpty => Id.IsEmpty;
///
public override string ToString() => Id.ToString();
}
///
/// Converter to and from instances.
///
class AclProfileIdConverter : StringIdConverter
{
///
public override AclProfileId FromStringId(StringId id) => new AclProfileId(id);
///
public override StringId ToStringId(AclProfileId value) => value.Id;
}
}