using System; using System.Runtime.Serialization; using Newtonsoft.Json; namespace ShareeBike.Repository.Response { [DataContract] [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] public class BikeInfoReservedOrBooked : BikeInfoBase, IEquatable { /// /// Date from when bike was reserved from/ booked from. /// Format: 2017-11-28 11:01:51.637747+01 /// [DataMember] public string start_time { get; private set; } /// Booking code if bike is BC-bike. [DataMember] public string timeCode { get; private set; } [DataMember] /// Seed used to generate key for connecting to bluetooth lock. public string K_seed { get; private set; } [DataMember] /// Key for connect to bluetooth lock as user. public string K_u { get; private set; } [DataMember] /// Key for connect to bluetooth lock as admin. public string K_a { get; private set; } public static bool operator ==(BikeInfoReservedOrBooked first, BikeInfoReservedOrBooked second) => JsonConvert.SerializeObject(first) == JsonConvert.SerializeObject(second); public static bool operator !=(BikeInfoReservedOrBooked first, BikeInfoReservedOrBooked second) => !(first == second); public override bool Equals(object obj) => obj is BikeInfoReservedOrBooked target && target == this; public override int GetHashCode() => JsonConvert.SerializeObject(this).GetHashCode(); public bool Equals(BikeInfoReservedOrBooked other) => other == this; } }