AdministrativeRules

public struct AdministrativeRules : Hashable

Represents a set of administrative rules for a country or a state.

  • Country code for which the administrative rules apply.

    Declaration

    Swift

    public var countryCode: CountryCode
  • The state code for which the administrative rules apply. It represents the state / province code. It is a 1 to 3 upper-case characters string that follows the ISO 3166-2 standard, but without the preceding country code (e.g. for Texas, the state code will be TX). It will be nil if the rules are applying to the entire country and not just a specific state.

    Declaration

    Swift

    public var stateCode: String?
  • The side of the road used for driving in the country or state. Defaults to right driving side.

    Declaration

    Swift

    public var drivingSide: DrivingSide?
  • Defines the measurement system used for distances. Defaults to metric measurement system.

    Declaration

    Swift

    public var unitSystem: UnitSystem?
  • The general speed limits in the country or state.

    Declaration

    Swift

    public var speedLimits: GeneralVehicleSpeedLimits
  • The time zone offset from UTC of the country or state expressed in minutes. The value can also be negative (e.g.: Eastern Standard Time (EST) will be -360 minutes, Central European Time (CET) will be 60 minutes). Defaults to 0 minutes. Note: A time zone with a positive shift of 1 hour and 30 minutes will result in a time zone offset of 90 minutes. A time zone with a negative shift of 3 hour and 30 minutes will result in an time zone offset of -210 minutes. In order to properly calculate the time zone offset, the [AdministrativeRules.daylight_saving_period] should be taken into consideration and if the daylight savings time is observed at the time of the calculation, then a value of 60 minutes should be substracted from the time zone offset.

    Declaration

    Swift

    public var timeZoneOffsetsInMinutes: [TimeInterval]
  • Time rule indicating the time periods in which daylight savings applies. If the field is ‘null’ then daylight savings time is not observed in the country or state. Note: In order to properly calculate the time zone offset, if the daylight savings time is observed at the time of the calculation, then a value of 60 minutes should be substracted from the time zone offset.

    Declaration

    Swift

    public var daylightSavingPeriod: TimeRule?
  • Indicates if performing a u-turn maneuver is restricted. Defaults to false.

    Declaration

    Swift

    public var isUturnRestricted: Bool
  • Indicates in which conditions should the headlights be turned on. Defaults to an empty list, which means that by default there are no special situations in which the headlights should be turned on.

    Declaration

    Swift

    public var headlightsRequirements: [HeadlightsRequirement]
  • Indicates if the country or state requires paid fees for usage of the motorways / controlled access roads. Defaults to false.

    Declaration

    Swift

    public var isTollRequired: Bool
  • Indicates if the country or state requires a toll sticker. Defaults to false.

    Declaration

    Swift

    public var isTollStickerRequired: Bool
  • Indicates the regulations for turning on the red color of the traffic light.

    Declaration

    Swift

    public var turnOnRedRegulations: [TurnOnRedRegulation]
  • Indicates the regulations for parking on the side of the road.

    Declaration

    Swift

    public var parkingSideRegulations: [ParkingSideRegulation]
  • Indicates if the country or state requires an ecological sticker. Defaults to false.

    Declaration

    Swift

    public var isCleanAirStickerRequired: Bool
  • Indicates the rules regarding alcohol in blood content limit in a country or state for all types of drivers.

    Declaration

    Swift

    public var bloodAlcoholContentLimit: BloodAlcoholContentLimit
  • Indicates the toll systems present in a country or state.

    Declaration

    Swift

    public var tollSystems: [TollSystem]
  • Indicates the legal requirements to be considered before a trip for all vehicles types.

    Declaration

    Swift

    public var preTripPlanning: PreTripPlanning
  • Creates a new instance.

    Declaration

    Swift

    public init(countryCode: CountryCode = CountryCode.abw, stateCode: String? = nil, drivingSide: DrivingSide? = nil, unitSystem: UnitSystem? = nil, speedLimits: GeneralVehicleSpeedLimits = GeneralVehicleSpeedLimits(), timeZoneOffsetsInMinutes: [TimeInterval] = [], daylightSavingPeriod: TimeRule? = nil, isUturnRestricted: Bool = false, headlightsRequirements: [HeadlightsRequirement] = [], isTollRequired: Bool = false, isTollStickerRequired: Bool = false, turnOnRedRegulations: [TurnOnRedRegulation] = [], parkingSideRegulations: [ParkingSideRegulation] = [], isCleanAirStickerRequired: Bool = false, bloodAlcoholContentLimit: BloodAlcoholContentLimit = BloodAlcoholContentLimit(), tollSystems: [TollSystem] = [], preTripPlanning: PreTripPlanning = PreTripPlanning())