// Copyright Epic Games, Inc. All Rights Reserved.
using System.ComponentModel;
using System.Text.Json.Serialization;
using EpicGames.Core;
namespace EpicGames.Horde.Tools
{
///
/// Identifier for a tool deployment
///
/// Identifier for the artifact
[LogValueType]
[JsonSchemaString]
[JsonConverter(typeof(BinaryIdJsonConverter))]
[TypeConverter(typeof(BinaryIdTypeConverter))]
[BinaryIdConverter(typeof(ToolDeploymentIdConverter))]
public readonly record struct ToolDeploymentId(BinaryId Id)
{
///
public static ToolDeploymentId Parse(string text) => new ToolDeploymentId(BinaryId.Parse(text));
///
public override readonly string ToString() => Id.ToString();
}
///
/// Converter class to and from BinaryId values
///
class ToolDeploymentIdConverter : BinaryIdConverter
{
///
public override ToolDeploymentId FromBinaryId(BinaryId id) => new ToolDeploymentId(id);
///
public override BinaryId ToBinaryId(ToolDeploymentId value) => value.Id;
}
}