//------------------------------------------------------------------------------ // // 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; /// /// Setting that indicates if seasons are set to hidden for the show. (-1 = Library default, 0 = Hide, 1 = Show).
/// /// /// /// ///
[JsonConverter(typeof(OpenEnumConverter))] public class FlattenSeasons : IEquatable { public static readonly FlattenSeasons LibraryDefault = new FlattenSeasons("-1"); public static readonly FlattenSeasons Hide = new FlattenSeasons("0"); public static readonly FlattenSeasons Show = new FlattenSeasons("1"); private static readonly Dictionary _knownValues = new Dictionary () { ["-1"] = LibraryDefault, ["0"] = Hide, ["1"] = Show }; private static readonly ConcurrentDictionary _values = new ConcurrentDictionary(_knownValues); private FlattenSeasons(string value) { if (value == null) throw new ArgumentNullException(nameof(value)); Value = value; } public string Value { get; } public static FlattenSeasons Of(string value) { return _values.GetOrAdd(value, _ => new FlattenSeasons(value)); } public static implicit operator FlattenSeasons(string value) => Of(value); public static implicit operator string(FlattenSeasons flattenseasons) => flattenseasons.Value; public static FlattenSeasons[] 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 FlattenSeasons); public bool Equals(FlattenSeasons? 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(); } }