//------------------------------------------------------------------------------
//
// 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.Components
{
using LukeHagar.PlexAPI.SDK.Utils;
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
///
/// String representation of subscriptionActive
///
[JsonConverter(typeof(OpenEnumConverter))]
public class UserPlexAccountSubscriptionsStatus : IEquatable
{
public static readonly UserPlexAccountSubscriptionsStatus Inactive = new UserPlexAccountSubscriptionsStatus("Inactive");
public static readonly UserPlexAccountSubscriptionsStatus Active = new UserPlexAccountSubscriptionsStatus("Active");
private static readonly Dictionary _knownValues =
new Dictionary ()
{
["Inactive"] = Inactive,
["Active"] = Active
};
private static readonly ConcurrentDictionary _values =
new ConcurrentDictionary(_knownValues);
private UserPlexAccountSubscriptionsStatus(string value)
{
if (value == null) throw new ArgumentNullException(nameof(value));
Value = value;
}
public string Value { get; }
public static UserPlexAccountSubscriptionsStatus Of(string value)
{
return _values.GetOrAdd(value, _ => new UserPlexAccountSubscriptionsStatus(value));
}
public static implicit operator UserPlexAccountSubscriptionsStatus(string value) => Of(value);
public static implicit operator string(UserPlexAccountSubscriptionsStatus userplexaccountsubscriptionsstatus) => userplexaccountsubscriptionsstatus.Value;
public static UserPlexAccountSubscriptionsStatus[] 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 UserPlexAccountSubscriptionsStatus);
public bool Equals(UserPlexAccountSubscriptionsStatus? 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();
}
}