// Copyright Epic Games, Inc. All Rights Reserved.
using EpicGames.Core;
namespace EpicGames.Horde.Jobs.Templates
{
///
/// Identifier for a template parameter
///
/// Id to construct from
[JsonSchemaString]
[StringIdConverter(typeof(ParameterIdConverter))]
public record struct ParameterId(StringId Id)
{
///
/// Constructor
///
public ParameterId(string id) : this(new StringId(id))
{
}
///
public static ParameterId Sanitize(string name)
=> new ParameterId(StringId.Sanitize(name));
///
public override string ToString() => Id.ToString();
}
///
/// Converter to and from instances.
///
class ParameterIdConverter : StringIdConverter
{
///
public override ParameterId FromStringId(StringId id) => new ParameterId(id);
///
public override StringId ToStringId(ParameterId value) => value.Id;
}
}