// Copyright Epic Games, Inc. All Rights Reserved. using System.ComponentModel; using EpicGames.Core; namespace EpicGames.Horde.Artifacts { /// /// Unique id for an artifact /// /// Identifier for the artifact [LogValueType] [JsonSchemaString] [TypeConverter(typeof(BinaryIdTypeConverter))] [BinaryIdConverter(typeof(ArtifactIdConverter))] public readonly record struct ArtifactId(BinaryId Id) { /// public static ArtifactId Parse(string text) => new ArtifactId(BinaryId.Parse(text)); /// public override readonly string ToString() => Id.ToString(); } /// /// Converter class to and from ObjectId values /// class ArtifactIdConverter : BinaryIdConverter { /// public override ArtifactId FromBinaryId(BinaryId id) => new ArtifactId(id); /// public override BinaryId ToBinaryId(ArtifactId value) => value.Id; } }