using System.Collections.Generic; using System.Runtime.Serialization; using Newtonsoft.Json; namespace ShareeBike.Repository.Response.Stations.Station { /// /// Holds info about a single station. /// [DataContract] public class StationInfo { /// /// Unique id of the station. /// [DataMember] public string station { get; private set; } [DataMember] public string[] station_group { get; private set; } [DataMember] public string description { get; private set; } /// /// Position of the station. /// [DataMember] public Position gps { get; private set; } [DataMember] public OperatorData operator_data { get; private set; } /// /// Holds the count of available bikes at the station. /// [DataMember] public string bike_count { get; set; } /// /// Holds the count type of station, i.e. which bikes are located at station. /// [DataMember] public Dictionary station_type { get; private set; } /// /// Holds the uri of the operator which manages the bikes at station/ the station. /// [DataMember] public string uri_operator { get; private set; } public static bool operator ==(StationInfo first, StationInfo second) => JsonConvert.SerializeObject(first) == JsonConvert.SerializeObject(second); public static bool operator !=(StationInfo first, StationInfo second) => !(first == second); public override bool Equals(object obj) => obj is StationInfo target && target == this; public override int GetHashCode() => JsonConvert.SerializeObject(this).GetHashCode(); } }