// Copyright Epic Games, Inc. All Rights Reserved.
using System.ComponentModel;
using EpicGames.Core;
using EpicGames.Serialization;
namespace EpicGames.Horde.Projects
{
///
/// Identifier for a pool
///
/// Id to construct from
[LogValueType]
[JsonSchemaString]
[TypeConverter(typeof(StringIdTypeConverter))]
[StringIdConverter(typeof(ProjectIdConverter))]
[CbConverter(typeof(StringIdCbConverter))]
public readonly record struct ProjectId(StringId Id)
{
///
/// Constructor
///
public ProjectId(string id) : this(new StringId(id))
{
}
///
public bool IsEmpty => Id.IsEmpty;
///
public override string ToString() => Id.ToString();
}
///
/// Converter to and from instances.
///
public class ProjectIdConverter : StringIdConverter
{
///
public override ProjectId FromStringId(StringId id) => new ProjectId(id);
///
public override StringId ToStringId(ProjectId value) => value.Id;
}
}