using System.Text.Json.Serialization;
using CacheManager.Core;
using CacheManager.Core.Internal;

namespace Hotline.CacheManager
{
    internal class JsonCacheItem<T> : SerializerCacheItem<T>
    {
        [JsonConstructor]
        public JsonCacheItem()
        {
            
        }

        public JsonCacheItem(ICacheItemProperties properties, object value) : base(properties, value)
        {
        }

        [JsonPropertyName("createdUtc")]
        public override long CreatedUtc { get; set; }

        [JsonPropertyName("expirationMode")]
        public override ExpirationMode ExpirationMode { get; set; }

        [JsonPropertyName("expirationTimeout")]
        public override double ExpirationTimeout { get; set; }

        [JsonPropertyName("key")]
        public override string Key { get; set; }

        [JsonPropertyName("lastAccessedUtc")]
        public override long LastAccessedUtc { get; set; }

        [JsonPropertyName("region")]
        public override string Region { get; set; }

        [JsonPropertyName("usesExpirationDefaults")]
        public override bool UsesExpirationDefaults { get; set; }

        [JsonPropertyName("valueType")]
        public override string ValueType { get; set; }

        [JsonPropertyName("value")]
        public override T Value { get; set; }
    }
}