FarePrice

public struct FarePrice : Hashable

Price of a fare.

  • Type of price represented by this object. Defaults to FarePriceType.value.

    Declaration

    Swift

    public var type: FarePriceType
  • True when the fare price is estimated based on best guess and the actual price may differ. Defaults to false.

    Declaration

    Swift

    public var estimated: Bool
  • Local currency of the price compliant to ISO 4217. For example, “GBP” for the British pound sterling. Defaults to “EUR” string.

    Declaration

    Swift

    public var currency: String
  • Minimum price when the price is of FarePriceType.range type. Otherwise, it is equal to FarePrice.maximum. Defaults to 0.

    Declaration

    Swift

    public var minimum: Double
  • Maximum price when the price is of FarePriceType.range type. Otherwise, it is equal to FarePrice.minimum. Defaults to 0.

    Declaration

    Swift

    public var maximum: Double
  • When set, the price is paid for a specific duration.

    Examples:

    3600 seconds - price for one hour

    28800 seconds - price for eight hours

    86400 seconds - price for one day

    Note: When the ticket validity period starts depends on the Agency providing the service. Defaults to nil.

    Declaration

    Swift

    public var validityPeriod: TimeInterval?
  • Creates a new instance.

    • Parameters

      • type: Type of price represented by this object. Defaults to FarePriceType.value.
      • estimated: True when the fare price is estimated based on best guess and the actual price may differ. Defaults to false.
      • currency: Local currency of the price compliant to ISO 4217. For example, “GBP” for the British pound sterling. Defaults to “EUR” string.
      • minimum: Minimum price when the price is of FarePriceType.range type. Otherwise, it is equal to FarePrice.maximum. Defaults to 0.
      • maximum: Maximum price when the price is of FarePriceType.range type. Otherwise, it is equal to FarePrice.minimum. Defaults to 0.
      • validityPeriod: When set, the price is paid for a specific duration.

      Examples:

      3600 seconds - price for one hour

      28800 seconds - price for eight hours

      86400 seconds - price for one day

      Note: When the ticket validity period starts depends on the Agency providing the service. Defaults to nil.

    Declaration

    Swift

    public init(type: FarePriceType = FarePriceType.value, estimated: Bool = false, currency: String = "EUR", minimum: Double = 0.0, maximum: Double = 0.0, validityPeriod: TimeInterval? = nil)