using System; using System.Linq; using Alkami.Ops.SecretServer.Enum; using Alkami.Ops.SecretServer.SSWebService; namespace Alkami.Ops.SecretServer.Model { /// /// Represents a Windows Account secret /// public class User : SecretBase { /// /// The secret type /// /// /// Returns .Certificate /// public new SecretType SecretType => SecretType.User; /// /// The user name from the "Username" field on the secret /// public string UserName => SecretItems.FirstOrDefault(p => string.Equals(p.FieldName, "Username", StringComparison.OrdinalIgnoreCase))?.Value; /// /// The password from the "Password" field on the secret /// public string Password => SecretItems.FirstOrDefault(p => string.Equals(p.FieldName, "Password", StringComparison.OrdinalIgnoreCase) && p.IsPassword)?.Value; /// /// Instantiates a new instance of the Secret class /// /// public User(Secret secret) : base(secret) { } } }