using System.Runtime.Serialization;
namespace TINK.Repository.Response
{
///
/// Holds info about a single bike.
///
[DataContract]
public class BikeInfoBase
{
///
/// Id of the bike.
///
[DataMember]
public string bike { get; private set; }
///
/// Position of the bike.
///
[DataMember]
public Position gps { get; private set; }
///
/// Id of the station.
///
[DataMember]
public string station { get; private set; }
///
/// Holds the localized (German) description of the bike.
///
[DataMember]
public string description { get; private set; }
/// Holds the group of the bike.
///
/// Copri returns values "TINK", "Konrad".
///
[DataMember]
public string[] bike_group { get; private set; }
///
/// Rental state.
///
[DataMember]
public string state { get; private set; }
///
/// Holds the uri where to reserve/ rent the bike.
///
[DataMember]
public string uri_operator { get; private set; }
/// Holds whether bike is equipped with computer or if bike is a lock bike.
///
///
///
Value
Type of bike
Member to extract info.
///
LOCK
Bike with manual lock.
TextToTypeHelper.GetIsNonBikeComputerBike
///
BC
Bike with a bord computer.
///
Ilockit
Bike with a bluetooth lock.
///
sigo
Sigo bike.
///
///
[DataMember]
public string system { get; private set; }
#if !NOTARIFFDESCRIPTION
/// Holds the tariff information for a bike.
/// This member is obsolete. Use instead.
[DataMember]
public TariffDescription tariff_description { get; private set; }
/// Holds the rental information for a bike.
[DataMember]
public RentalDescription rental_description { get; private set; }
#endif
[DataMember]
/// Describes type of the bike.
public BikeType bike_type { get; private set; }
///
/// Holds whether bike is a AA bike (bike must be always returned a the same station) or AB bike (start and end stations can be different stations).
///
[DataMember]
public string aa_ride { get; private set; }
/// Loading state of motor battery in % ]0..100[.
[DataMember]
public string bike_charge { get; private set; }
/// Locking state.
[DataMember]
public string lock_state { get; private set; }
[DataMember]
/// Full advertisement name.
public string Ilockit_ID { get; private set; }
[DataMember]
/// Full advertisement name.
public string Ilockit_GUID { get; private set; }
///
/// Textual description of response.
///
/// Object as text.
public new string ToString()
{
return $"Bike {bike}{(station != null ? $", at station {station}" : string.Empty)}{(!string.IsNullOrEmpty(description) ? $", {description}" : string.Empty)}{(!string.IsNullOrEmpty(state) ? $", status={state}" : string.Empty)}.";
}
}
}