//------------------------------------------------------------------------------ // // This code was generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. // // Changes to this file may cause incorrect behavior and will be lost when // the code is regenerated. // //------------------------------------------------------------------------------ #nullable enable namespace LukeHagar.PlexAPI.SDK.Models.Requests { using LukeHagar.PlexAPI.SDK.Utils; using Newtonsoft.Json; using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; /// /// An integer log level to write to the PMS log with.
/// /// /// 0: Error
/// 1: Warning
/// 2: Info
/// 3: Debug
/// 4: Verbose
/// ///
///
[JsonConverter(typeof(OpenEnumConverter))] public class Level : IEquatable { public static readonly Level Zero = new Level(0); public static readonly Level One = new Level(1); public static readonly Level Two = new Level(2); public static readonly Level Three = new Level(3); public static readonly Level Four = new Level(4); private static readonly Dictionary _knownValues = new Dictionary () { [0] = Zero, [1] = One, [2] = Two, [3] = Three, [4] = Four }; private static readonly ConcurrentDictionary _values = new ConcurrentDictionary(_knownValues); private Level(long value) { Value = value; } public long Value { get; } public static Level Of(long value) { return _values.GetOrAdd(value, _ => new Level(value)); } public static implicit operator Level(long value) => Of(value); public static implicit operator long(Level level) => level.Value; public static Level[] Values() { return _values.Values.ToArray(); } public override string ToString() => Value.ToString(); public bool IsKnown() { return _knownValues.ContainsKey(Value); } public override bool Equals(object? obj) => Equals(obj as Level); public bool Equals(Level? other) { if (ReferenceEquals(this, other)) return true; if (other is null) return false; return string.Equals(Value, other.Value); } public override int GetHashCode() => Value.GetHashCode(); } }