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