//------------------------------------------------------------------------------
//
// 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 the episode ordering for the show.
///
///
/// Options:
/// - None = Library default
/// - tmdbAiring = The Movie Database (Aired)
/// - aired = TheTVDB (Aired)
/// - dvd = TheTVDB (DVD)
/// - absolute = TheTVDB (Absolute)
///
///
///
[JsonConverter(typeof(OpenEnumConverter))]
public class ShowOrdering : IEquatable
{
public static readonly ShowOrdering None = new ShowOrdering("None");
public static readonly ShowOrdering TmdbAiring = new ShowOrdering("tmdbAiring");
public static readonly ShowOrdering TvdbAired = new ShowOrdering("aired");
public static readonly ShowOrdering TvdbDvd = new ShowOrdering("dvd");
public static readonly ShowOrdering TvdbAbsolute = new ShowOrdering("absolute");
private static readonly Dictionary _knownValues =
new Dictionary ()
{
["None"] = None,
["tmdbAiring"] = TmdbAiring,
["aired"] = TvdbAired,
["dvd"] = TvdbDvd,
["absolute"] = TvdbAbsolute
};
private static readonly ConcurrentDictionary _values =
new ConcurrentDictionary(_knownValues);
private ShowOrdering(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static ShowOrdering Of(string value)
{
return _values.GetOrAdd(value, _ => new ShowOrdering(value));
}
public static implicit operator ShowOrdering(string value) => Of(value);
public static implicit operator string(ShowOrdering showordering) => showordering.Value;
public static ShowOrdering[] 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 ShowOrdering);
public bool Equals(ShowOrdering? 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();
}
}