Typing improved
This commit is contained in:
@@ -11,19 +11,19 @@ except ImportError:
|
||||
# 2.25. Arrival Board (arrivalBoard)
|
||||
def board_arrival(accessId: str,
|
||||
json: bool = True,
|
||||
id: str = None, # type: ignore
|
||||
extId: str = None, # type: ignore
|
||||
direction: str = None, # type: ignore
|
||||
date: Union[str, datetime] = None, # type: ignore
|
||||
time: Union[str, datetime] = None, # type: ignore
|
||||
duration: int = 60,
|
||||
id: Union[str, None] = None,
|
||||
extId: Union[str, None] = None,
|
||||
direction: Union[str, None] = None,
|
||||
date: Union[str, datetime, None] = None,
|
||||
time: Union[str, datetime, None] = None,
|
||||
duration: Union[int, timedelta] = 60,
|
||||
maxJourneys: int = -1,
|
||||
products: int = None, # type: ignore
|
||||
operators: Union[str, list] = None, # type: ignore
|
||||
lines: Union[str, list] = None, # type: ignore
|
||||
products: Union[int, None] = None,
|
||||
operators: Union[str, list, None] = None,
|
||||
lines: Union[str, list, None] = None,
|
||||
filterEquiv: bool = True,
|
||||
attributes: Union[str, list] = None, # type: ignore
|
||||
platforms: Union[str, list] = None, # type: ignore
|
||||
attributes: Union[str, list, None] = None,
|
||||
platforms: Union[str, list, None] = None,
|
||||
passlist: bool = False,
|
||||
boardType: Literal["ARR", "ARR_EQUIVS", "ARR_MAST", "ARR_STATION"] = "ARR"
|
||||
) -> dict:
|
||||
@@ -81,7 +81,7 @@ def board_arrival(accessId: str,
|
||||
elif str(var) == "duration":
|
||||
if val != None:
|
||||
if isinstance(val, timedelta):
|
||||
payload[str(var)] = val.minutes
|
||||
payload[str(var)] = val.minutes # type: ignore
|
||||
else:
|
||||
payload[str(var)] = val
|
||||
elif str(var) == "boardType":
|
||||
|
@@ -11,19 +11,19 @@ except ImportError:
|
||||
# 2.24. Departure Board (departureBoard)
|
||||
def board_departure(accessId: str,
|
||||
json: bool = True,
|
||||
id: str = None, # type: ignore
|
||||
extId: str = None, # type: ignore
|
||||
direction: str = None, # type: ignore
|
||||
date: Union[str, datetime] = None, # type: ignore
|
||||
time: Union[str, datetime] = None, # type: ignore
|
||||
duration: int = 60,
|
||||
id: Union[str, None] = None,
|
||||
extId: Union[str, None] = None,
|
||||
direction: Union[str, None] = None,
|
||||
date: Union[str, datetime, None] = None,
|
||||
time: Union[str, datetime, None] = None,
|
||||
duration: Union[int, timedelta] = 60,
|
||||
maxJourneys: int = -1,
|
||||
products: int = None, # type: ignore
|
||||
operators: Union[str, list] = None, # type: ignore
|
||||
lines: Union[str, list] = None, # type: ignore
|
||||
products: Union[int, None] = None,
|
||||
operators: Union[str, list, None] = None,
|
||||
lines: Union[str, list, None] = None,
|
||||
filterEquiv: bool = True,
|
||||
attributes: Union[str, list] = None, # type: ignore
|
||||
platforms: Union[str, list] = None, # type: ignore
|
||||
attributes: Union[str, list, None] = None,
|
||||
platforms: Union[str, list, None] = None,
|
||||
passlist: bool = False,
|
||||
boardType: Literal["DEP", "DEP_EQUIVS", "DEP_MAST", "DEP_STATION"] = "DEP"
|
||||
) -> dict:
|
||||
@@ -82,7 +82,7 @@ def board_departure(accessId: str,
|
||||
elif str(var) == "duration":
|
||||
if val != None:
|
||||
if isinstance(val, timedelta):
|
||||
payload[str(var)] = val.minutes
|
||||
payload[str(var)] = val.minutes # type: ignore
|
||||
else:
|
||||
payload[str(var)] = val
|
||||
elif str(var) == "boardType":
|
||||
|
@@ -13,38 +13,38 @@ except ImportError:
|
||||
# 2.37. HIM Search (himsearch)
|
||||
def him_search(accessId: str,
|
||||
json: bool = True,
|
||||
dateB: Union[str, datetime] = None, # type: ignore
|
||||
dateE: Union[str, datetime] = None, # type: ignore
|
||||
timeB: Union[str, datetime] = None, # type: ignore
|
||||
timeE: Union[str, datetime] = None, # type: ignore
|
||||
weekdays: Union[str, OrderedDict[str, bool]] = None, # type: ignore
|
||||
himIds: Union[str, list] = None, # type: ignore
|
||||
dateB: Union[str, datetime, None] = None,
|
||||
dateE: Union[str, datetime, None] = None,
|
||||
timeB: Union[str, datetime, None] = None,
|
||||
timeE: Union[str, datetime, None] = None,
|
||||
weekdays: Union[str, OrderedDict[str, bool], None] = None,
|
||||
himIds: Union[str, list, None] = None,
|
||||
hierarchicalView: bool = False,
|
||||
operators: Union[str, list] = None, # type: ignore
|
||||
categories: Union[str, list] = None, # type: ignore
|
||||
channels: Union[str, list] = None, # type: ignore
|
||||
companies: Union[str, list] = None, # type: ignore
|
||||
lines: Union[str, list] = None, # type: ignore
|
||||
lineids: Union[str, list] = None, # type: ignore
|
||||
stations: Union[str, list] = None, # type: ignore
|
||||
fromstation: str = None, # type: ignore
|
||||
tostation: str = None, # type: ignore
|
||||
bothways: bool = None, # type: ignore
|
||||
trainnames: Union[str, list] = None, # type: ignore
|
||||
metas: Union[str, list] = None, # type: ignore
|
||||
himcategory: str = None, # type: ignore
|
||||
himtags: Union[str, list] = None, # type: ignore
|
||||
regions: Union[str, list] = None, # type: ignore
|
||||
himtext: Union[str, list] = None, # type: ignore
|
||||
himtexttags: Union[str, list] = None, # type: ignore
|
||||
additionalfields: Union[str, list, dict] = None, # type: ignore
|
||||
operators: Union[str, list, None] = None,
|
||||
categories: Union[str, list, None] = None,
|
||||
channels: Union[str, list, None] = None,
|
||||
companies: Union[str, list, None] = None,
|
||||
lines: Union[str, list, None] = None,
|
||||
lineids: Union[str, list, None] = None,
|
||||
stations: Union[str, list, None] = None,
|
||||
fromstation: Union[str, None] = None,
|
||||
tostation: Union[str, None] = None,
|
||||
bothways: Union[bool, None] = None,
|
||||
trainnames: Union[str, list, None] = None,
|
||||
metas: Union[str, list, None] = None,
|
||||
himcategory: Union[str, None] = None,
|
||||
himtags: Union[str, list, None] = None,
|
||||
regions: Union[str, list, None] = None,
|
||||
himtext: Union[str, list, None] = None,
|
||||
himtexttags: Union[str, list, None] = None,
|
||||
additionalfields: Union[str, list, dict, None] = None,
|
||||
poly: bool = False,
|
||||
searchmode: Literal["MATCH", "NOMATCH", "TFMATCH"] = None, # type: ignore
|
||||
affectedJourneyMode: Literal["ALL", "OFF"] = None, # type: ignore
|
||||
affectedJourneyStopMode: Literal["ALL", "IMP", "OFF"] = None, # type: ignore
|
||||
orderBy: Union[str, list] = None, # type: ignore
|
||||
minprio: Union[str, int] = None, # type: ignore
|
||||
maxprio: Union[str, int] = None # type: ignore
|
||||
searchmode: Union[Literal["MATCH", "NOMATCH", "TFMATCH"], None] = None,
|
||||
affectedJourneyMode: Union[Literal["ALL", "OFF"], None] = None,
|
||||
affectedJourneyStopMode: Union[Literal["ALL", "IMP", "OFF"], None] = None,
|
||||
orderBy: Union[str, list, None] = None,
|
||||
minprio: Union[str, int, None] = None,
|
||||
maxprio: Union[str, int, None] = None
|
||||
) -> dict:
|
||||
"""The himSearch will return a list of HIM messages if matched by the given criteria as well as affected
|
||||
products if any.
|
||||
|
@@ -12,15 +12,15 @@ except ImportError:
|
||||
def journey_detail(accessId: str,
|
||||
id: str,
|
||||
json: bool = True,
|
||||
date: Union[str, datetime] = None, # type: ignore
|
||||
date: Union[str, datetime, None] = None,
|
||||
poly: bool = False,
|
||||
polyEnc: Literal["DLT", "GPA", "N"] = "N",
|
||||
showPassingPoints: bool = False,
|
||||
rtMode: Literal["FULL", "INFOS", "OFF", "REALTIME", "SERVER_DEFAULT"] = None, # type: ignore
|
||||
fromId: str = None, # type: ignore
|
||||
fromIdx: str = None, # type: ignore
|
||||
toId: str = None, # type: ignore
|
||||
toIdx: str = None, # type: ignore
|
||||
rtMode: Union[Literal["FULL", "INFOS", "OFF", "REALTIME", "SERVER_DEFAULT"], None] = None,
|
||||
fromId: Union[str, None] = None,
|
||||
fromIdx: Union[int, None] = None,
|
||||
toId: Union[str, None] = None,
|
||||
toIdx: Union[int, None] = None,
|
||||
baim: bool = False
|
||||
) -> dict:
|
||||
"""The journey_detail method will deliver information about the complete route of a vehicle. The journey
|
||||
|
@@ -16,11 +16,11 @@ def stop_by_coords(accessId: str,
|
||||
radius: Union[int, float] = 1000,
|
||||
maxNo: int = 10,
|
||||
stopType: Literal["S", "P", "SP", "SE", "SPE"] = "S",
|
||||
locationSelectionMode: Literal["SLCT_N", "SLCT_A"] = None, # type: ignore
|
||||
products: int = None, # type: ignore
|
||||
meta: str = None, # type: ignore
|
||||
sattributes: Union[str, list] = None, # type: ignore
|
||||
sinfotexts: Union[str, list] = None # type: ignore
|
||||
locationSelectionMode: Union[Literal["SLCT_N", "SLCT_A"], None] = None,
|
||||
products: Union[int, None] = None,
|
||||
meta: Union[str, None] = None,
|
||||
sattributes: Union[str, list, None] = None,
|
||||
sinfotexts: Union[str, list, None] = None
|
||||
) -> dict:
|
||||
"""The location.nearbystops service returns a list of stops around a given center coordinate (within a
|
||||
radius of 1000m). The returned results are ordered by their distance to the center coordinate.
|
||||
|
@@ -14,15 +14,15 @@ def stop_by_name(accessId: str,
|
||||
json: bool = True,
|
||||
maxNo: int = 10,
|
||||
stopType: Literal["A", "ALL", "AP", "P", "S", "SA", "SP"] = "ALL",
|
||||
locationSelectionMode: Literal["SLCT_N", "SLCT_A"] = None, # type: ignore
|
||||
products: int = None, # type: ignore
|
||||
coordLat: Union[str, float] = None, # type: ignore
|
||||
coordLong: Union[str, float] = None, # type: ignore
|
||||
locationSelectionMode: Union[Literal["SLCT_N", "SLCT_A"], None] = None,
|
||||
products: Union[int, None] = None,
|
||||
coordLat: Union[str, float, None] = None,
|
||||
coordLong: Union[str, float, None] = None,
|
||||
radius: Union[int, float] = 1000,
|
||||
refineId: str = None, # type: ignore
|
||||
meta: str = None, # type: ignore
|
||||
stations: Union[str, list] = None, # type: ignore
|
||||
sattributes: Union[str, list] = None, # type: ignore
|
||||
refineId: Union[str, None] = None,
|
||||
meta: Union[str, None] = None,
|
||||
stations: Union[str, list, None] = None,
|
||||
sattributes: Union[str, list, None] = None,
|
||||
filterMode: Literal["DIST_PERI", "EXCL_PERI", "SLCT_PERI"] = "DIST_PERI"
|
||||
) -> dict:
|
||||
"""The location.name service can be used to perform a pattern matching of a user input and to retrieve a list
|
||||
|
@@ -13,87 +13,87 @@ def trip_find(accessId: str,
|
||||
lang: Literal["de", "da", "en", "es", "fr", "hu", "it", "nl", "no", "pl", "sv", "tr"] = "en",
|
||||
json: bool = True,
|
||||
|
||||
originId: str = None, # type: ignore
|
||||
originExtId: str = None, # type: ignore
|
||||
originCoordLat: Union[str, float] = None, # type: ignore
|
||||
originCoordLong: Union[str, float] = None, # type: ignore
|
||||
originCoordName: str = None, # type: ignore
|
||||
originId: Union[str, None] = None,
|
||||
originExtId: Union[str, None] = None,
|
||||
originCoordLat: Union[str, float, None] = None,
|
||||
originCoordLong: Union[str, float, None] = None,
|
||||
originCoordName: Union[str, None] = None,
|
||||
|
||||
destId: str = None, # type: ignore
|
||||
destExtId: str = None, # type: ignore
|
||||
destCoordLat: Union[str, float] = None, # type: ignore
|
||||
destCoordLong: Union[str, float] = None, # type: ignore
|
||||
destCoordName: str = None, # type: ignore
|
||||
destId: Union[str, None] = None,
|
||||
destExtId: Union[str, None] = None,
|
||||
destCoordLat: Union[str, float, None] = None,
|
||||
destCoordLong: Union[str, float, None] = None,
|
||||
destCoordName: Union[str, None] = None,
|
||||
|
||||
via: str = None, # type: ignore
|
||||
viaId: str = None, # type: ignore
|
||||
via: Union[str, None] = None,
|
||||
viaId: Union[str, None] = None,
|
||||
viaWaitTime: int = 0,
|
||||
|
||||
avoid: str = None, # type: ignore
|
||||
avoidId: str = None, # type: ignore
|
||||
avoid: Union[str, None] = None,
|
||||
avoidId: Union[str, None] = None,
|
||||
|
||||
viaGis: str = None, # type: ignore
|
||||
viaGis: Union[str, None] = None,
|
||||
|
||||
changeTimePercent: int = 100,
|
||||
minChangeTime: int = None, # type: ignore
|
||||
maxChangeTime: int = None, # type: ignore
|
||||
addChangeTime: int = None, # type: ignore
|
||||
maxChange: int = None, # type: ignore
|
||||
minChangeTime: Union[int, None] = None,
|
||||
maxChangeTime: Union[int, None] = None,
|
||||
addChangeTime: Union[int, None] = None,
|
||||
maxChange: Union[int, None] = None,
|
||||
|
||||
date: Union[str, datetime] = None, # type: ignore
|
||||
time: Union[str, datetime] = None, # type: ignore
|
||||
date: Union[str, datetime, None] = None,
|
||||
time: Union[str, datetime, None] = None,
|
||||
|
||||
searchForArrival: bool = False,
|
||||
|
||||
numF: int = None, # type: ignore
|
||||
numB: int = None, # type: ignore
|
||||
numF: Union[int, None] = None,
|
||||
numB: Union[int, None] = None,
|
||||
|
||||
context: str = None, # type: ignore
|
||||
context: Union[str, None] = None,
|
||||
|
||||
poly: bool = False,
|
||||
polyEnc: Literal["DLT", "GPA", "N"] = "N",
|
||||
|
||||
passlist: bool = False,
|
||||
products: int = None, # type: ignore
|
||||
operators: Union[str, list] = None, # type: ignore
|
||||
products: Union[int, None] = None,
|
||||
operators: Union[str, list, None] = None,
|
||||
|
||||
attributes: Union[str, list] = None, # type: ignore
|
||||
sattributes: Union[str, list] = None, # type: ignore
|
||||
fattributes: Union[str, list] = None, # type: ignore
|
||||
lines: Union[str, list] = None, # type: ignore
|
||||
lineids: Union[str, list] = None, # type: ignore
|
||||
attributes: Union[str, list, None] = None,
|
||||
sattributes: Union[str, list, None] = None,
|
||||
fattributes: Union[str, list, None] = None,
|
||||
lines: Union[str, list, None] = None,
|
||||
lineids: Union[str, list, None] = None,
|
||||
|
||||
avoidPaths: List[Literal["SW", "EA", "ES", "RA", "CB"]] = None, # type: ignore
|
||||
avoidPaths: Union[List[Literal["SW", "EA", "ES", "RA", "CB"]], None] = None,
|
||||
|
||||
originWalk: Union[str, list] = None, # type: ignore
|
||||
originBike: Union[str, list] = None, # type: ignore
|
||||
originCar: Union[str, list] = None, # type: ignore
|
||||
originTaxi: Union[str, list] = None, # type: ignore
|
||||
originPark: Union[str, list] = None, # type: ignore
|
||||
originMeta: Union[str, list] = None, # type: ignore
|
||||
originWalk: Union[str, list, None] = None,
|
||||
originBike: Union[str, list, None] = None,
|
||||
originCar: Union[str, list, None] = None,
|
||||
originTaxi: Union[str, list, None] = None,
|
||||
originPark: Union[str, list, None] = None,
|
||||
originMeta: Union[str, list, None] = None,
|
||||
|
||||
destWalk: Union[str, list] = None, # type: ignore
|
||||
destBike: Union[str, list] = None, # type: ignore
|
||||
destCar: Union[str, list] = None, # type: ignore
|
||||
destTaxi: Union[str, list] = None, # type: ignore
|
||||
destPark: Union[str, list] = None, # type: ignore
|
||||
destMeta: Union[str, list] = None, # type: ignore
|
||||
destWalk: Union[str, list, None] = None,
|
||||
destBike: Union[str, list, None] = None,
|
||||
destCar: Union[str, list, None] = None,
|
||||
destTaxi: Union[str, list, None] = None,
|
||||
destPark: Union[str, list, None] = None,
|
||||
destMeta: Union[str, list, None] = None,
|
||||
|
||||
totalWalk: Union[str, list] = None, # type: ignore
|
||||
totalBike: Union[str, list] = None, # type: ignore
|
||||
totalCar: Union[str, list] = None, # type: ignore
|
||||
totalTaxi: Union[str, list] = None, # type: ignore
|
||||
totalMeta: Union[str, list] = None, # type: ignore
|
||||
totalWalk: Union[str, list, None] = None,
|
||||
totalBike: Union[str, list, None] = None,
|
||||
totalCar: Union[str, list, None] = None,
|
||||
totalTaxi: Union[str, list, None] = None,
|
||||
totalMeta: Union[str, list, None] = None,
|
||||
|
||||
gisProducts: str = None, # type: ignore
|
||||
gisProducts: Union[str, None] = None,
|
||||
|
||||
includeIv: bool = False,
|
||||
ivOnly: bool = False,
|
||||
|
||||
mobilityProfile: str = None, # type: ignore
|
||||
mobilityProfile: Union[str, None] = None,
|
||||
|
||||
bikeCarriage: bool = False,
|
||||
bikeCarriageType: Literal["SINGLEBIKES", "SMALLGROUPS", "LARGEGROUPS"] = None, # type: ignore
|
||||
bikeCarriageType: Union[Literal["SINGLEBIKES", "SMALLGROUPS", "LARGEGROUPS"], None] = None,
|
||||
|
||||
sleepingCar: bool = False,
|
||||
couchetteCoach: bool = False,
|
||||
@@ -102,24 +102,24 @@ def trip_find(accessId: str,
|
||||
|
||||
eco: bool = False,
|
||||
ecoCmp: bool = False,
|
||||
ecoParams: str = None, # type: ignore
|
||||
ecoParams: Union[str, None] = None,
|
||||
|
||||
rtMode: Literal["FULL", "INFOS", "OFF", "REALTIME", "SERVER_DEFAULT"] = None, # type: ignore
|
||||
rtMode: Union[Literal["FULL", "INFOS", "OFF", "REALTIME", "SERVER_DEFAULT"], None] = None,
|
||||
|
||||
unsharp: bool = False,
|
||||
trainFilter: str = None, # type: ignore
|
||||
trainFilter: Union[str, None] = None,
|
||||
economic: bool = False,
|
||||
groupFilter: str = None, # type: ignore
|
||||
groupFilter: Union[str, None] = None,
|
||||
|
||||
blockingList: str = None, # type: ignore
|
||||
blockedEdges: str = None, # type: ignore
|
||||
blockingList: Union[str, None] = None,
|
||||
blockedEdges: Union[str, None] = None,
|
||||
|
||||
trainComposition: bool = False,
|
||||
includeEarlier: bool = False,
|
||||
withICTAlternatives: bool = False,
|
||||
tariff: bool = None, # type: ignore
|
||||
tariff: Union[bool, None] = None,
|
||||
trafficMessages: bool = False,
|
||||
travellerProfileData: str = None, # type: ignore
|
||||
travellerProfileData: Union[str, None] = None,
|
||||
withFreq: bool = True
|
||||
) -> dict:
|
||||
"""The trip service calculates a trip from a specified origin to a specified destination. These might be
|
||||
|
@@ -14,31 +14,31 @@ def trip_recon(accessId: str,
|
||||
json: bool = True,
|
||||
poly: bool = False,
|
||||
polyEnc: Literal["DLT", "GPA", "N"] = "N",
|
||||
date: Union[str, datetime] = None, # type: ignore
|
||||
useCombinedComparison: bool = None, # type: ignore
|
||||
acceptGaps: bool = None, # type: ignore
|
||||
allowDummySections: bool = None, # type: ignore
|
||||
flagAllNonReachable: bool = None, # type: ignore
|
||||
matchCatStrict: bool = None, # type: ignore
|
||||
matchIdNonBlank: bool = None, # type: ignore
|
||||
matchIdStrict: bool = None, # type: ignore
|
||||
matchNumStrict: bool = None, # type: ignore
|
||||
matchRtType: bool = None, # type: ignore
|
||||
enableRtFullSearch: bool = None, # type: ignore
|
||||
enableReplacements: bool = None, # type: ignore
|
||||
arrL: int = None, # type: ignore
|
||||
arrU: int = None, # type: ignore
|
||||
depL: int = None, # type: ignore
|
||||
depU: int = None, # type: ignore
|
||||
date: Union[str, datetime, None] = None,
|
||||
useCombinedComparison: Union[bool, None] = None,
|
||||
acceptGaps: Union[bool, None] = None,
|
||||
allowDummySections: Union[bool, None] = None,
|
||||
flagAllNonReachable: Union[bool, None] = None,
|
||||
matchCatStrict: Union[bool, None] = None,
|
||||
matchIdNonBlank: Union[bool, None] = None,
|
||||
matchIdStrict: Union[bool, None] = None,
|
||||
matchNumStrict: Union[bool, None] = None,
|
||||
matchRtType: Union[bool, None] = None,
|
||||
enableRtFullSearch: Union[bool, None] = None,
|
||||
enableReplacements: Union[bool, None] = None,
|
||||
arrL: Union[int, None] = None,
|
||||
arrU: Union[int, None] = None,
|
||||
depL: Union[int, None] = None,
|
||||
depU: Union[int, None] = None,
|
||||
passlist: bool = False,
|
||||
showPassingPoints: bool = False,
|
||||
rtMode: Literal["FULL", "INFOS", "OFF", "REALTIME", "SERVER_DEFAULT"] = None, # type: ignore
|
||||
rtMode: Union[Literal["FULL", "INFOS", "OFF", "REALTIME", "SERVER_DEFAULT"], None] = None,
|
||||
eco: bool = False,
|
||||
ecoCmp: bool = False,
|
||||
ecoParams: str = None, # type: ignore
|
||||
tariff: bool = None, # type: ignore
|
||||
trafficMessages: bool = None, # type: ignore
|
||||
travellerProfileData: str = None # type: ignore
|
||||
ecoParams: Union[str, None] = None,
|
||||
tariff: Union[bool, None] = None,
|
||||
trafficMessages: Union[bool, None] = None,
|
||||
travellerProfileData: Union[str, None] = None
|
||||
) -> dict:
|
||||
"""Reconstructing a trip can be achieved using the reconstruction context provided by any trip result in the
|
||||
ctxRecon attribute of Trip element. The result will be a true copy of the original trip search result given
|
||||
|
Reference in New Issue
Block a user