// Copyright Epic Games, Inc. All Rights Reserved.
using System.ComponentModel;
using EpicGames.Core;
namespace EpicGames.Horde.ServiceAccounts
{
///
/// Identifier for a user account
///
/// Id to construct from
[LogValueType]
[JsonSchemaString]
[TypeConverter(typeof(BinaryIdTypeConverter))]
[BinaryIdConverter(typeof(ServiceAccountIdConverter))]
public readonly record struct ServiceAccountId(BinaryId Id)
{
///
public static ServiceAccountId Parse(string text) => new ServiceAccountId(BinaryId.Parse(text));
///
public override string ToString() => Id.ToString();
}
///
/// Converter to and from instances.
///
class ServiceAccountIdConverter : BinaryIdConverter
{
///
public override ServiceAccountId FromBinaryId(BinaryId id) => new ServiceAccountId(id);
///
public override BinaryId ToBinaryId(ServiceAccountId value) => value.Id;
}
}