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