Refactor after enabling pylint
This commit is contained in:
@@ -22,3 +22,10 @@ pip install georideapilib
|
|||||||
|
|
||||||
This library has been tested with python 3.7 and above, functionality for older python version cannot be guaranteed.
|
This library has been tested with python 3.7 and above, functionality for older python version cannot be guaranteed.
|
||||||
|
|
||||||
|
|
||||||
|
## Todo
|
||||||
|
- [ ] Add support of SocketIO connection
|
||||||
|
- [ ] Add support of "Get a shared trip" endpoint
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,63 +1,72 @@
|
|||||||
import api as GeorideApi
|
""" Example georideapilib code """
|
||||||
from objects import GeorideAccount
|
|
||||||
|
|
||||||
import datetime
|
|
||||||
import time
|
import time
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
from georideapilib.objects import GeorideAccount
|
||||||
|
import georideapilib.api as GeorideApi
|
||||||
|
|
||||||
|
|
||||||
""" If ypu out to reuse account """
|
def example():
|
||||||
|
""" simple example function """
|
||||||
|
token = "<your_token>"# pylint: disable=C0301
|
||||||
|
account = GeorideAccount(0, "<your_email>", False, token)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
account = GeorideAccount(<your_id>, <yout_email>, <is_admin>, <your_token>)
|
GeorideApi.getAuthorisationToken("<your_email>", "<your_password>")
|
||||||
|
print("token 1: ", account.auth_token)
|
||||||
|
""" # pylint: disable=W0105
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
account.auth_token = GeorideApi.renewToken(account.auth_token)
|
||||||
|
print("token 2: ", account.auth_token)
|
||||||
|
""" # pylint: disable=W0105
|
||||||
|
|
||||||
""" Get an acces token """
|
user = GeorideApi.get_user(account.auth_token)
|
||||||
account = GeorideApi.getAuthorisationToken("<your_email>", "<your_passord>")
|
print("User: ", user.first_name)
|
||||||
print("token 1: ", account.authToken)
|
|
||||||
|
|
||||||
|
trackers = GeorideApi.get_trackers(account.auth_token)
|
||||||
""" do not abuse, renew when previous token have almost reached time """
|
|
||||||
"""
|
|
||||||
account.authToken = GeorideApi.renewToken(account.authToken)
|
|
||||||
print("token 2: ", account.authToken)
|
|
||||||
"""
|
|
||||||
|
|
||||||
user = GeorideApi.getUser(account.authToken)
|
|
||||||
print("User: ", user.firstName)
|
|
||||||
|
|
||||||
trackers = GeorideApi.getTrackers(account.authToken)
|
|
||||||
tracker = trackers[0]
|
tracker = trackers[0]
|
||||||
print("Tracker name: ", tracker.trackerName)
|
print("Tracker name: ", tracker.tracker_name)
|
||||||
|
|
||||||
trips = GeorideApi.getTrips(account.authToken, tracker.trackerId, "2019-10-10", "2019-10-24")
|
trips = GeorideApi.get_trips(account.auth_token, tracker.tracker_id, "2019-10-10", "2019-10-24")
|
||||||
trip = trips[0];
|
trip = trips[0]
|
||||||
trip_date = datetime.datetime.strptime("2019-10-10T06:45:34.000Z", '%Y-%m-%dT%H:%M:%S.%fZ')
|
trip_date = datetime.datetime.strptime("2019-10-10T06:45:34.000Z", '%Y-%m-%dT%H:%M:%S.%fZ')
|
||||||
print("Trip date: {}, from: {}, to: {}".format(trip_date, trip.niceStartAddress, trip.niceEndAddress))
|
print("Trip date: {}, from: {}, to: {}".format(trip_date, trip.nice_start_address,
|
||||||
|
trip.nice_end_address))
|
||||||
|
|
||||||
positions = GeorideApi.getPositions(account.authToken, tracker.trackerId, "2019-10-10", "2019-10-24")
|
positions = GeorideApi.get_positions(account.auth_token, tracker.tracker_id,
|
||||||
position = positions[0];
|
"2019-10-10", "2019-10-24")
|
||||||
print("Position speed: {}, lon: {}, lat: {}".format(position.speed, position.longitude, position.latitude))
|
position = positions[0]
|
||||||
|
print("Position speed: {}, lon: {}, lat: {}".format(position.speed, position.longitude,
|
||||||
|
position.latitude))
|
||||||
|
|
||||||
|
|
||||||
tripShared = GeorideApi.shareATripByDate(account.authToken, tracker.trackerId, fromDate="2019-10-10", toDate="2019-10-24")
|
trip_shared = GeorideApi.share_a_trip_by_date(account.auth_token, tracker.tracker_id,
|
||||||
print("tripShared url: {}, id: {}".format(tripShared.url, tripShared.shareId))
|
"2019-10-10", "2019-10-24")
|
||||||
|
print("tripShared url: {}, id: {}".format(trip_shared.url, trip_shared.share_id))
|
||||||
|
|
||||||
time.sleep(30)
|
time.sleep(10)
|
||||||
haveBeenLocked = GeorideApi.lockTracker(account.authToken, tracker.trackerId)
|
have_been_locked = GeorideApi.lock_tracker(account.auth_token, tracker.tracker_id)
|
||||||
print("Tracker have been locked: ", haveBeenLocked)
|
print("Tracker have been locked: ", have_been_locked)
|
||||||
|
|
||||||
time.sleep(30)
|
time.sleep(10)
|
||||||
haveBeenUnlocked = GeorideApi.lockTracker(account.authToken, tracker.trackerId)
|
have_been_unlocked = GeorideApi.unlock_tracker(account.auth_token, tracker.tracker_id)
|
||||||
print("Tracker have been unlocked: ", haveBeenUnlocked)
|
print("Tracker have been unlocked: ", have_been_unlocked)
|
||||||
|
|
||||||
time.sleep(30)
|
time.sleep(10)
|
||||||
isLocked = GeorideApi.toogleLockTracker(account.authToken, tracker.trackerId)
|
is_locked = GeorideApi.toogle_lock_tracker(account.auth_token, tracker.tracker_id)
|
||||||
print("Tracker is locked: ", haveBeenUnlocked)
|
print("Tracker is locked: ", is_locked)
|
||||||
|
|
||||||
time.sleep(30)
|
time.sleep(10)
|
||||||
trackers = GeorideApi.getTrackers(account.authToken)
|
trackers = GeorideApi.get_trackers(account.auth_token)
|
||||||
tracker = trackers[0]
|
tracker = trackers[0]
|
||||||
print("Tracker name: ", tracker.trackerName, " is locked: ", tracker.isLocked)
|
print("Tracker name: ", tracker.tracker_name, " is locked: ", tracker.is_locked)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
GeorideApi.revokeToken(account.authToken)
|
GeorideApi.revokeToken(account.auth_token)
|
||||||
"""
|
""" # pylint: disable=W0105
|
||||||
|
|
||||||
|
example()
|
||||||
@@ -3,10 +3,17 @@ Georide api lib
|
|||||||
@author Matthieu DUVAL <matthieu@duval-dev.fr>
|
@author Matthieu DUVAL <matthieu@duval-dev.fr>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import urllib3
|
|
||||||
import json
|
import json
|
||||||
|
import urllib3
|
||||||
|
|
||||||
from objects import GeorideTracker, GeorideAccount, GeorideUser, GeorideTrackerTrip, GeorideTrackerPosition, GeorideSharedTrip
|
from georideapilib.objects import (
|
||||||
|
GeorideTracker,
|
||||||
|
GeorideAccount,
|
||||||
|
GeorideUser,
|
||||||
|
GeorideTrackerTrip,
|
||||||
|
GeorideTrackerPosition,
|
||||||
|
GeorideSharedTrip
|
||||||
|
)
|
||||||
|
|
||||||
GEORIDE_API_HOST = "https://api.georide.fr"
|
GEORIDE_API_HOST = "https://api.georide.fr"
|
||||||
GEORIDE_API_ENDPOINT_LOGIN = "/user/login"
|
GEORIDE_API_ENDPOINT_LOGIN = "/user/login"
|
||||||
@@ -22,7 +29,8 @@ GEORIDE_API_ENDPOINT_POSITIONS = "/tracker/:trackerId/trips/positions"
|
|||||||
GEORIDE_API_ENDPOINT_TRIP_SHARE = "/tracker/:trackerId/share/trip"
|
GEORIDE_API_ENDPOINT_TRIP_SHARE = "/tracker/:trackerId/share/trip"
|
||||||
|
|
||||||
|
|
||||||
def getAuthorisationToken(email, password):
|
def get_authorisation_token(email, password):
|
||||||
|
""" return an authorization token """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
data = {"email": email, "password": password}
|
data = {"email": email, "password": password}
|
||||||
encoded_data = json.dumps(data).encode('utf-8')
|
encoded_data = json.dumps(data).encode('utf-8')
|
||||||
@@ -32,11 +40,12 @@ def getAuthorisationToken(email, password):
|
|||||||
body=encoded_data,
|
body=encoded_data,
|
||||||
headers={'Content-Type': 'application/json'})
|
headers={'Content-Type': 'application/json'})
|
||||||
response_data = json.loads(response.data.decode('utf-8'))
|
response_data = json.loads(response.data.decode('utf-8'))
|
||||||
account = GeorideAccount.fromJson(response_data)
|
account = GeorideAccount.from_json(response_data)
|
||||||
return account
|
return account
|
||||||
|
|
||||||
|
|
||||||
def renewToken(token):
|
def renew_token(token):
|
||||||
|
""" renew the authorization token """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
headers = {"Authorization": "Bearer " + token}
|
headers = {"Authorization": "Bearer " + token}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
@@ -44,24 +53,25 @@ def renewToken(token):
|
|||||||
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_NEW_TOKEN,
|
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_NEW_TOKEN,
|
||||||
headers=headers)
|
headers=headers)
|
||||||
response_data = json.loads(response.data.decode('utf-8'))
|
response_data = json.loads(response.data.decode('utf-8'))
|
||||||
newToken = response_data['authToken']
|
new_token = response_data['authToken']
|
||||||
return newToken
|
return new_token
|
||||||
|
|
||||||
|
|
||||||
def revokeToken(token):
|
def revoke_token(token):
|
||||||
|
""" invalidate the authorization token """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
headers = {"Authorization": "Bearer " + token}
|
headers = {"Authorization": "Bearer " + token}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
'POST',
|
'POST',
|
||||||
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_LOGOUT,
|
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_LOGOUT,
|
||||||
headers=headers)
|
headers=headers)
|
||||||
if response.status == 204:
|
if response.status != 204:
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def getUser(token):
|
def get_user(token):
|
||||||
|
""" get the georide user info """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
headers = {"Authorization": "Bearer " + token}
|
headers = {"Authorization": "Bearer " + token}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
@@ -69,10 +79,11 @@ def getUser(token):
|
|||||||
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_USER,
|
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_USER,
|
||||||
headers=headers)
|
headers=headers)
|
||||||
response_data = json.loads(response.data.decode('utf-8'))
|
response_data = json.loads(response.data.decode('utf-8'))
|
||||||
account = GeorideUser.fromJson(response_data)
|
account = GeorideUser.from_json(response_data)
|
||||||
return account
|
return account
|
||||||
|
|
||||||
def getTrackers(token):
|
def get_trackers(token):
|
||||||
|
""" get user trackers """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
headers = {"Authorization": "Bearer " + token}
|
headers = {"Authorization": "Bearer " + token}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
@@ -83,57 +94,64 @@ def getTrackers(token):
|
|||||||
response_data = json.loads(response.data.decode('utf-8'))
|
response_data = json.loads(response.data.decode('utf-8'))
|
||||||
trackers = []
|
trackers = []
|
||||||
for json_tracker in response_data:
|
for json_tracker in response_data:
|
||||||
trackers.append(GeorideTracker.fromJson(json_tracker))
|
trackers.append(GeorideTracker.from_json(json_tracker))
|
||||||
return trackers
|
return trackers
|
||||||
|
|
||||||
|
|
||||||
def getTrips(token, trackerId, fromDate, toDate):
|
def get_trips(token, tracker_id, from_date, to_date):
|
||||||
|
""" return all trips between two dates """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
headers = {"Authorization": "Bearer " + token}
|
headers = {"Authorization": "Bearer " + token}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
'GET',
|
'GET',
|
||||||
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_TRIPS.replace(':trackerId', str(trackerId)),
|
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_TRIPS.replace(':trackerId', str(tracker_id)),
|
||||||
fields={'from': fromDate, 'to': toDate},
|
fields={'from': from_date, 'to': to_date},
|
||||||
headers=headers)
|
headers=headers)
|
||||||
|
|
||||||
response_data = json.loads(response.data.decode('utf-8'))
|
response_data = json.loads(response.data.decode('utf-8'))
|
||||||
trips = []
|
trips = []
|
||||||
for json_trip in response_data:
|
for json_trip in response_data:
|
||||||
trips.append(GeorideTrackerTrip.fromJson(json_trip))
|
trips.append(GeorideTrackerTrip.from_json(json_trip))
|
||||||
return trips
|
return trips
|
||||||
|
|
||||||
def getPositions(token, trackerId, fromDate, toDate):
|
def get_positions(token, tracker_id, from_date, to_date):
|
||||||
|
""" return all trips between two dates """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
headers = {"Authorization": "Bearer " + token}
|
headers = {"Authorization": "Bearer " + token}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
'GET',
|
'GET',
|
||||||
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_POSITIONS.replace(':trackerId', str(trackerId)),
|
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_POSITIONS.replace(':trackerId', str(tracker_id)),
|
||||||
fields={'from': fromDate, 'to': toDate},
|
fields={'from': from_date, 'to': to_date},
|
||||||
headers=headers)
|
headers=headers)
|
||||||
|
|
||||||
response_data = json.loads(response.data.decode('utf-8'))
|
response_data = json.loads(response.data.decode('utf-8'))
|
||||||
positions = []
|
positions = []
|
||||||
for json_position in response_data:
|
for json_position in response_data:
|
||||||
positions.append(GeorideTrackerPosition.fromJson(json_position))
|
positions.append(GeorideTrackerPosition.from_json(json_position))
|
||||||
return positions
|
return positions
|
||||||
|
|
||||||
def shareATripByTripId(token, trackerId, tripId):
|
def share_a_trip_by_trip_id(token, tracker_id, trip_id):
|
||||||
return _shareATrip(token, trackerId, tripId=tripId)
|
""" share trip by trip id """
|
||||||
|
return _share_a_trip(token, tracker_id, trip_id=trip_id)
|
||||||
|
|
||||||
def shareATripByDate(token, trackerId, fromDate, toDate):
|
def share_a_trip_by_date(token, tracker_id, from_date, to_date):
|
||||||
return _shareATrip(token, trackerId, fromDate=fromDate, toDate=toDate)
|
""" share trips between two dates """
|
||||||
|
return _share_a_trip(token, tracker_id, from_date=from_date, to_date=to_date)
|
||||||
|
|
||||||
def shareATripByTripMergeId(token, trackerId, tripMergedId):
|
def share_a_trip_by_trip_merge_id(token, tracker_id, trip_merged_id):
|
||||||
return _shareATrip(token, trackerId, tripMergedId=tripMergedId)
|
""" share trip by trip merged id """
|
||||||
|
return _share_a_trip(token, tracker_id, trip_merged_id=trip_merged_id)
|
||||||
|
|
||||||
def _shareATrip(token, trackerId, tripId=None, fromDate=None, toDate=None, tripMergedId=None):
|
def _share_a_trip(token, tracker_id, trip_id=None, from_date=None, # pylint: disable= R0913
|
||||||
|
to_date=None, trip_merged_id=None):
|
||||||
|
""" share trip by trib_id or between two dates or trip_merged_id """
|
||||||
data = None
|
data = None
|
||||||
if tripId != None:
|
if trip_id is not None:
|
||||||
data = {"tripId": tripId}
|
data = {"tripId": trip_id}
|
||||||
elif fromDate != None and toDate != None:
|
elif from_date is not None and to_date is not None:
|
||||||
data = {"from": fromDate, "to": toDate}
|
data = {"from": from_date, "to": to_date}
|
||||||
elif tripMergedId != None:
|
elif trip_merged_id is not None:
|
||||||
data = {"tripMergedId": tripMergedId}
|
data = {"tripMergedId": trip_merged_id}
|
||||||
|
|
||||||
encoded_data = json.dumps(data).encode('utf-8')
|
encoded_data = json.dumps(data).encode('utf-8')
|
||||||
print("Trip data: ", encoded_data)
|
print("Trip data: ", encoded_data)
|
||||||
@@ -145,48 +163,48 @@ def _shareATrip(token, trackerId, tripId=None, fromDate=None, toDate=None, tripM
|
|||||||
}
|
}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
'POST',
|
'POST',
|
||||||
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_TRIP_SHARE.replace(':trackerId', str(trackerId)),
|
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_TRIP_SHARE.replace(':trackerId', str(tracker_id)),
|
||||||
body=encoded_data,
|
body=encoded_data,
|
||||||
headers=headers)
|
headers=headers)
|
||||||
|
|
||||||
response_data = json.loads(response.data.decode('utf-8'))
|
response_data = json.loads(response.data.decode('utf-8'))
|
||||||
print("Trip data: ", response_data)
|
print("Trip data: ", response_data)
|
||||||
return GeorideSharedTrip.fromJson(response_data)
|
return GeorideSharedTrip.from_json(response_data)
|
||||||
|
|
||||||
def lockTracker(token, trackerId):
|
def lock_tracker(token, tracker_id):
|
||||||
|
""" used to lock a tracker """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
headers = {"Authorization": "Bearer " + token}
|
headers = {"Authorization": "Bearer " + token}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
'POST',
|
'POST',
|
||||||
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_LOCK.replace(':trackerId', str(trackerId)),
|
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_LOCK.replace(':trackerId', str(tracker_id)),
|
||||||
headers=headers)
|
headers=headers)
|
||||||
if response.status == 204:
|
if response.status != 204:
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def unlockTracker(token, trackerId):
|
def unlock_tracker(token, tracker_id):
|
||||||
|
""" used to unlock a tracker """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
headers = {"Authorization": "Bearer " + token}
|
headers = {"Authorization": "Bearer " + token}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
'POST',
|
'POST',
|
||||||
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_UNCLOCK.replace(':trackerId', str(trackerId)),
|
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_UNLOCK.replace(':trackerId', str(tracker_id)),
|
||||||
headers=headers)
|
headers=headers)
|
||||||
if response.status == 204:
|
if response.status != 204:
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
def toogleLockTracker(token, trackerId):
|
def toogle_lock_tracker(token, tracker_id):
|
||||||
|
""" used to toggle lock a tracker """
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
headers = {"Authorization": "Bearer " + token}
|
headers = {"Authorization": "Bearer " + token}
|
||||||
response = http.request(
|
response = http.request(
|
||||||
'POST',
|
'POST',
|
||||||
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_TOGGLE_LOCK.replace(':trackerId', str(trackerId)),
|
GEORIDE_API_HOST + GEORIDE_API_ENDPOINT_TOGGLE_LOCK.replace(':trackerId', str(tracker_id)),
|
||||||
headers=headers)
|
headers=headers)
|
||||||
response_data = json.loads(response.data.decode('utf-8'))
|
response_data = json.loads(response.data.decode('utf-8'))
|
||||||
return response_data['locked']
|
return response_data['locked']
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print("Not a main module")
|
print("Not a main module")
|
||||||
|
|
||||||
|
|||||||
@@ -4,109 +4,136 @@ Georide objects implementation
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
class GeorideSharedTrip:
|
class GeorideSharedTrip:
|
||||||
|
""" Shared trip object representation """
|
||||||
def __init__(self, url, shareId):
|
def __init__(self, url, shareId):
|
||||||
self._url = url
|
self._url = url
|
||||||
self._shareId = shareId
|
self._share_id = shareId
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def url(self):
|
def url(self):
|
||||||
|
""" shared trip url """
|
||||||
return self._url
|
return self._url
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def shareId(self):
|
def share_id(self):
|
||||||
return self._shareId
|
""" shared trip id """
|
||||||
|
return self._share_id
|
||||||
|
|
||||||
def fromJson(json):
|
@staticmethod
|
||||||
|
def from_json(json):
|
||||||
|
"""return new object fromjson"""
|
||||||
return GeorideSharedTrip(
|
return GeorideSharedTrip(
|
||||||
json['url'],
|
json['url'],
|
||||||
json['shareId']
|
json['shareId']
|
||||||
)
|
)
|
||||||
|
|
||||||
class GeorideTrackerTrip:
|
class GeorideTrackerTrip: # pylint: disable=too-many-instance-attributes
|
||||||
def __init__(self, tripId, trackerId, averageSpeed, maxSpeed, distance, duration, startAddress, niceStartAddress, startLat,
|
""" Trip object representation """
|
||||||
startLon, endAddress, niceEndAddress, endLat, endLon, startTime, endTime):
|
def __init__(self, trip_id, tracker_id, average_speed, max_speed, distance, duration, # pylint: disable=R0914, R0913
|
||||||
self._tripId = tripId
|
start_address, nice_start_address, start_lat, start_lon, end_address,
|
||||||
self._trackerId = trackerId
|
nice_end_address, end_lat, end_lon, start_time, end_time):
|
||||||
self._averageSpeed = averageSpeed
|
self._trip_id = trip_id
|
||||||
self._maxSpeed = maxSpeed
|
self._tracker_id = tracker_id
|
||||||
|
self._average_speed = average_speed
|
||||||
|
self._max_speed = max_speed
|
||||||
self._distance = distance
|
self._distance = distance
|
||||||
self._duration = duration
|
self._duration = duration
|
||||||
self._startAddress = startAddress
|
self._start_address = start_address
|
||||||
self._niceStartAddress = niceStartAddress
|
self._nice_start_address = nice_start_address
|
||||||
self._startLat = startLat
|
self._start_lat = start_lat
|
||||||
self._startLon = startLon
|
self._start_lon = start_lon
|
||||||
self._endAddress = endAddress
|
self._end_address = end_address
|
||||||
self._niceEndAddress = niceEndAddress
|
self._nice_end_address = nice_end_address
|
||||||
self._endLat = endLat
|
self._end_lat = end_lat
|
||||||
self._endLon = endLon
|
self._end_lon = end_lon
|
||||||
self._startTime = startTime
|
self._start_time = start_time
|
||||||
self._endTime = endTime
|
self._end_time = end_time
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tripId(self):
|
def trip_id(self):
|
||||||
return self._tripId
|
"""trip_id """
|
||||||
|
return self._trip_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def trackerId(self):
|
def tracker_id(self):
|
||||||
return self._trackerId
|
""" tracker_id """
|
||||||
|
return self._tracker_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def averageSpeed(self):
|
def average_speed(self):
|
||||||
return self._averageSpeed
|
""" average_speed """
|
||||||
|
return self._average_speed
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def maxSpeed(self):
|
def max_speed(self):
|
||||||
return self._maxSpeed
|
""" max_speed """
|
||||||
|
return self._max_speed
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def distance(self):
|
def distance(self):
|
||||||
|
""" distance """
|
||||||
return self._distance
|
return self._distance
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def duration(self):
|
def duration(self):
|
||||||
|
""" duration """
|
||||||
return self._duration
|
return self._duration
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def startAddress(self):
|
def start_address(self):
|
||||||
return self._startAddress
|
""" start_address """
|
||||||
|
return self._start_address
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def niceStartAddress(self):
|
def nice_start_address(self):
|
||||||
return self._niceStartAddress
|
""" nice_start_address """
|
||||||
|
return self._nice_start_address
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def startLat(self):
|
def start_lat(self):
|
||||||
return self._startLat
|
""" start_lat """
|
||||||
|
return self._start_lat
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def startLon(self):
|
def start_lon(self):
|
||||||
return self._startLon
|
""" start_lon """
|
||||||
|
return self._start_lon
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def endAddress(self):
|
def end_address(self):
|
||||||
return self._endAddress
|
""" end_address """
|
||||||
|
return self._end_address
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def niceEndAddress(self):
|
def nice_end_address(self):
|
||||||
return self._niceEndAddress
|
""" nice_end_address """
|
||||||
|
return self._nice_end_address
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def endLat(self):
|
def end_lat(self):
|
||||||
return self._endLat
|
"""end_lat """
|
||||||
|
return self._end_lat
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def endLon(self):
|
def end_lon(self):
|
||||||
return self._endLon
|
"""end_lon """
|
||||||
|
return self._end_lon
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def startTime(self):
|
def start_time(self):
|
||||||
return self._startTime
|
""" start_time """
|
||||||
|
return self._start_time
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def endTime(self):
|
def end_time(self):
|
||||||
return self._endTime
|
""" end_time """
|
||||||
|
return self._end_time
|
||||||
|
|
||||||
def fromJson(json):
|
|
||||||
|
@staticmethod
|
||||||
|
def from_json(json):
|
||||||
|
"""return new object from json"""
|
||||||
return GeorideTrackerTrip(
|
return GeorideTrackerTrip(
|
||||||
json['id'],
|
json['id'],
|
||||||
json['trackerId'],
|
json['trackerId'],
|
||||||
@@ -128,7 +155,8 @@ class GeorideTrackerTrip:
|
|||||||
|
|
||||||
|
|
||||||
class GeorideTrackerPosition:
|
class GeorideTrackerPosition:
|
||||||
def __init__(self, fixtime, latitude, longitude, altitude, speed, address):
|
""" Tracker position object representation """
|
||||||
|
def __init__(self, fixtime, latitude, longitude, altitude, speed, address): # pylint: disable= R0913
|
||||||
self._fixtime = fixtime
|
self._fixtime = fixtime
|
||||||
self._latitude = latitude
|
self._latitude = latitude
|
||||||
self._longitude = longitude
|
self._longitude = longitude
|
||||||
@@ -138,29 +166,37 @@ class GeorideTrackerPosition:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def fixtime(self):
|
def fixtime(self):
|
||||||
|
""" fixtime """
|
||||||
return self._fixtime
|
return self._fixtime
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def latitude(self):
|
def latitude(self):
|
||||||
|
""" latitude """
|
||||||
return self._latitude
|
return self._latitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def longitude(self):
|
def longitude(self):
|
||||||
|
""" longitude """
|
||||||
return self._longitude
|
return self._longitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def altitude(self):
|
def altitude(self):
|
||||||
|
""" altitude """
|
||||||
return self._altitude
|
return self._altitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def speed(self):
|
def speed(self):
|
||||||
|
""" speed (m/s) """
|
||||||
return self._speed
|
return self._speed
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def address(self):
|
def address(self):
|
||||||
|
""" address """
|
||||||
return self._address
|
return self._address
|
||||||
|
|
||||||
def fromJson(json):
|
@staticmethod
|
||||||
|
def from_json(json):
|
||||||
|
"""return new object fromjson"""
|
||||||
return GeorideTrackerPosition(
|
return GeorideTrackerPosition(
|
||||||
json['fixtime'],
|
json['fixtime'],
|
||||||
json['latitude'],
|
json['latitude'],
|
||||||
@@ -173,199 +209,242 @@ class GeorideTrackerPosition:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class GeorideTracker:
|
class GeorideTracker: # pylint: disable=R0904,R0902
|
||||||
def __init__(self, trackerId, trackerName, deviceButtonAction, deviceButtonDelay, vibrationLevel, isOldTracker, autoLockFreezedTo,
|
""" Tracker position object representation """
|
||||||
fixtime, role, lastPaymentDate, giftCardId, expires, activationDate, odometer, isStolen, isCrashed, crashDetectionDisabled,
|
def __init__(self, tracker_id, tracker_name, device_button_action, device_button_delay, # pylint: disable= R0913, R0914, R0915
|
||||||
speed, moving, positionId, latitude, longitude, altitude, lockedPositionId, lockedLatitude, lockedLongitude, isLocked,
|
vibration_level, is_old_tracker, auto_lock_freezed_to, fixtime, role,
|
||||||
canSeePosition, canLock, canUnlock, canShare, canUnshare, canCheckSpeed, canSeeStatistics, canSendBrokenDownSignal,
|
last_payment_date, gift_card_id, expires, activation_date, odometer, is_stolen,
|
||||||
canSendStolenSignal, status):
|
is_crashed, crash_detection_disabled, speed, moving, position_id, latitude,
|
||||||
self._trackerId = trackerId
|
longitude, altitude, locked_position_id, locked_latitude, locked_longitude,
|
||||||
self._trackerName = trackerName
|
is_locked, can_see_position, can_lock, can_unlock, can_share, can_unshare,
|
||||||
self._deviceButtonAction = deviceButtonAction
|
can_check_speed, can_see_statistics, can_send_broken_down_signal,
|
||||||
self._deviceButtonDelay = deviceButtonDelay
|
can_send_stolen_signal, status):
|
||||||
self._vibrationLevel = vibrationLevel
|
self._tracker_id = tracker_id
|
||||||
self._isOldTracker = isOldTracker
|
self._tracker_name = tracker_name
|
||||||
self._autoLockFreezedTo = autoLockFreezedTo
|
self._device_button_action = device_button_action
|
||||||
|
self._device_button_delay = device_button_delay
|
||||||
|
self._vibration_level = vibration_level
|
||||||
|
self._is_old_tracker = is_old_tracker
|
||||||
|
self._auto_lock_freezed_to = auto_lock_freezed_to
|
||||||
self._fixtime = fixtime
|
self._fixtime = fixtime
|
||||||
self._role = role
|
self._role = role
|
||||||
self._lastPaymentDate = lastPaymentDate
|
self._last_payment_date = last_payment_date
|
||||||
self._giftCardId = giftCardId
|
self._gift_card_id = gift_card_id
|
||||||
self._expires = expires
|
self._expires = expires
|
||||||
self._activationDate = activationDate
|
self._activation_date = activation_date
|
||||||
self._odometer = odometer
|
self._odometer = odometer
|
||||||
self._isStolen = isStolen
|
self._is_stolen = is_stolen
|
||||||
self._isCrashed = isCrashed
|
self._is_crashed = is_crashed
|
||||||
self._crashDetectionDisabled = crashDetectionDisabled
|
self._crash_detection_disabled = crash_detection_disabled
|
||||||
self._speed = speed
|
self._speed = speed
|
||||||
self._moving = moving
|
self._moving = moving
|
||||||
self._positionId = positionId
|
self._position_id = position_id
|
||||||
self._latitude = latitude
|
self._latitude = latitude
|
||||||
self._longitude = longitude
|
self._longitude = longitude
|
||||||
self._altitude = altitude
|
self._altitude = altitude
|
||||||
self._lockedPositionId = lockedPositionId
|
self._locked_position_id = locked_position_id
|
||||||
self._lockedLatitude = lockedLatitude
|
self._locked_latitude = locked_latitude
|
||||||
self._lockedLongitude = lockedLongitude
|
self._locked_longitude = locked_longitude
|
||||||
self._isLocked = isLocked
|
self._is_locked = is_locked
|
||||||
self._canSeePosition = canSeePosition
|
self._can_see_position = can_see_position
|
||||||
self._canLock = canLock
|
self._can_lock = can_lock
|
||||||
self._canUnlock = canUnlock
|
self._can_unlock = can_unlock
|
||||||
self._canShare = canShare
|
self._can_share = can_share
|
||||||
self._canUnshare = canUnshare
|
self._can_unshare = can_unshare
|
||||||
self._canCheckSpeed = canCheckSpeed
|
self._can_check_speed = can_check_speed
|
||||||
self._canSeeStatistics = canSeeStatistics
|
self._can_see_statistics = can_see_statistics
|
||||||
self._canSendBrokenDownSignal = canSendBrokenDownSignal
|
self._can_send_broken_down_signal = can_send_broken_down_signal
|
||||||
self._canSendStolenSignal = canSendStolenSignal
|
self._can_send_stolen_signal = can_send_stolen_signal
|
||||||
self._status = status
|
self._status = status
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def trackerId(self):
|
def tracker_id(self):
|
||||||
return self._trackerId
|
""" tracker_id """
|
||||||
|
return self._tracker_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def trackerName(self):
|
def tracker_name(self):
|
||||||
return self._trackerName
|
""" tracker_name """
|
||||||
|
return self._tracker_name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def deviceButtonAction(self):
|
def device_button_action(self):
|
||||||
return self._deviceButtonAction
|
""" device_button_action """
|
||||||
|
return self._device_button_action
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def deviceButtonDelay(self):
|
def device_button_delay(self):
|
||||||
return self._deviceButtonDelay
|
""" device_button_delay """
|
||||||
|
return self._device_button_delay
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def vibrationLevel(self):
|
def vibration_level(self):
|
||||||
return self._vibrationLevel
|
""" vibration_level """
|
||||||
|
return self._vibration_level
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def isOldTracker(self):
|
def is_old_tracker(self):
|
||||||
return self._isOldTracker
|
""" is_old_tracker """
|
||||||
|
return self._is_old_tracker
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def autoLockFreesedTo(self):
|
def auto_lock_freezed_to(self):
|
||||||
return self._autoLockFreesedTo
|
""" auto_lock_freezed_to """
|
||||||
|
return self._auto_lock_freezed_to
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def fixtime(self):
|
def fixtime(self):
|
||||||
|
""" fixtime """
|
||||||
return self._fixtime
|
return self._fixtime
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def role(self):
|
def role(self):
|
||||||
|
""" role """
|
||||||
return self._role
|
return self._role
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def lastPayementDate(self):
|
def last_payment_date(self):
|
||||||
return self._lastPayementDate
|
""" last_payment_date """
|
||||||
|
return self._last_payment_date
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def giftCardId(self):
|
def gift_card_id(self):
|
||||||
return self._giftCardId
|
""" gift_card_id """
|
||||||
|
return self._gift_card_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def expires(self):
|
def expires(self):
|
||||||
|
""" expires """
|
||||||
return self._expires
|
return self._expires
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def activationDate(self):
|
def activation_date(self):
|
||||||
return self._activationDate
|
""" activation_date """
|
||||||
|
return self._activation_date
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def odometer(self):
|
def odometer(self):
|
||||||
|
""" odometer """
|
||||||
return self._odometer
|
return self._odometer
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def isStolen(self):
|
def is_stolen(self):
|
||||||
return self._isStolen
|
""" is_stolen """
|
||||||
|
return self._is_stolen
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def isCrashed(self):
|
def is_crashed(self):
|
||||||
return self._isCrashed
|
""" is_crashed """
|
||||||
|
return self._is_crashed
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def crashDetectionDisabled(self):
|
def crash_detection_disabled(self):
|
||||||
return self._crashDetectionDisabled
|
""" crash_detection_disabled """
|
||||||
|
return self._crash_detection_disabled
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def speed(self):
|
def speed(self):
|
||||||
|
""" speed """
|
||||||
return self._speed
|
return self._speed
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def moving(self):
|
def moving(self):
|
||||||
|
""" moving """
|
||||||
return self._moving
|
return self._moving
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def positionId(self):
|
def position_id(self):
|
||||||
return self._positionId
|
""" position_id """
|
||||||
|
return self._position_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def latitude(self):
|
def latitude(self):
|
||||||
|
""" latitude """
|
||||||
return self._latitude
|
return self._latitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def longitude(self):
|
def longitude(self):
|
||||||
|
""" longitude """
|
||||||
return self._longitude
|
return self._longitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def altitude(self):
|
def altitude(self):
|
||||||
|
""" altitude """
|
||||||
return self._altitude
|
return self._altitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def lockedPositionId(self):
|
def locked_position_id(self):
|
||||||
return self._lockedPositionId
|
""" locked_position_id """
|
||||||
|
return self._locked_position_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def lockedLatitude(self):
|
def locked_latitude(self):
|
||||||
return self._lockedLatitude
|
""" locked_latitude """
|
||||||
|
return self._locked_latitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def lockedLongitude(self):
|
def locked_longitude(self):
|
||||||
return self._lockedLongitude
|
""" locked_longitude """
|
||||||
|
return self._locked_longitude
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def isLocked(self):
|
def is_locked(self):
|
||||||
return self._isLocked
|
""" is_locked """
|
||||||
|
return self._is_locked
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def canSeePosition(self):
|
def can_see_position(self):
|
||||||
return self._canSeePosition
|
""" can_see_position """
|
||||||
|
return self._can_see_position
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def canLock(self):
|
def can_lock(self):
|
||||||
return self._canLock
|
""" can_lock """
|
||||||
|
return self._can_lock
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def canUnlock(self):
|
def can_unlock(self):
|
||||||
return self._canUnlock
|
""" can_unlock """
|
||||||
|
return self._can_unlock
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def canShare(self):
|
def can_share(self):
|
||||||
return self._canShare
|
""" can_share """
|
||||||
|
return self._can_share
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def canUnshare(self):
|
def can_unshare(self):
|
||||||
return self._canUnshare
|
""" can_unshare """
|
||||||
|
return self._can_unshare
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def canCheckSpeed(self):
|
def can_check_speed(self):
|
||||||
return self._canCheckSpeed
|
""" can_check_speed """
|
||||||
|
return self._can_check_speed
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def canSeeStatistics(self):
|
def can_see_statistics(self):
|
||||||
return self._canSeeStatistics
|
""" can_see_statistics """
|
||||||
|
return self._can_see_statistics
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def canSendBrokenDownSignal(self):
|
def can_send_broken_down_signal(self):
|
||||||
return self._canSendBrokenDownSignal
|
""" can_send_broken_down_signal """
|
||||||
|
return self._can_send_broken_down_signal
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def canSendStolenSignal(self):
|
def can_send_stolen_signal(self):
|
||||||
return self._canSendStolenSignal
|
""" can_send_stolen_signal """
|
||||||
|
return self._can_send_stolen_signal
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def status(self):
|
def status(self):
|
||||||
|
""" status """
|
||||||
return self._status
|
return self._status
|
||||||
|
|
||||||
def fromJson(json):
|
@staticmethod
|
||||||
|
def from_json(json):
|
||||||
|
"""return new object fromjson"""
|
||||||
return GeorideTracker(
|
return GeorideTracker(
|
||||||
json['trackerId'],
|
json['trackerId'],
|
||||||
json['trackerName'],
|
json['trackerName'],
|
||||||
@@ -408,33 +487,41 @@ class GeorideTracker:
|
|||||||
|
|
||||||
|
|
||||||
class GeorideAccount:
|
class GeorideAccount:
|
||||||
def __init__(self, account_id, email, isAdmin, authToken):
|
""" Account object representation """
|
||||||
|
def __init__(self, account_id, email, is_admin, auth_token):
|
||||||
self._account_id = account_id
|
self._account_id = account_id
|
||||||
self._email = email
|
self._email = email
|
||||||
self._isAdmin = isAdmin
|
self._is_admin = is_admin
|
||||||
self._authToken = authToken
|
self._auth_token = auth_token
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def account_id(self):
|
def account_id(self):
|
||||||
|
""" account_id """
|
||||||
return self._account_id
|
return self._account_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def email(self):
|
def email(self):
|
||||||
|
""" email """
|
||||||
return self._email
|
return self._email
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def isAdmin(self):
|
def is_admin(self):
|
||||||
return self._isAdmin
|
""" is_admin """
|
||||||
|
return self._is_admin
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def authToken(self):
|
def auth_token(self):
|
||||||
return self._authToken
|
""" auth_token """
|
||||||
|
return self._auth_token
|
||||||
|
|
||||||
@authToken.setter
|
@auth_token.setter
|
||||||
def authToken(self, newToken):
|
def auth_token(self, new_token):
|
||||||
self._authToken = newToken
|
""" change auth_token """
|
||||||
|
self._auth_token = new_token
|
||||||
|
|
||||||
def fromJson(json):
|
@staticmethod
|
||||||
|
def from_json(json):
|
||||||
|
"""return new object from_json"""
|
||||||
return GeorideAccount(
|
return GeorideAccount(
|
||||||
json['id'],
|
json['id'],
|
||||||
json['email'],
|
json['email'],
|
||||||
@@ -443,50 +530,62 @@ class GeorideAccount:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class GeorideUser:
|
class GeorideUser: # pylint: disable= R0902
|
||||||
def __init__(self, account_id, email, firstName, createdAt, phoneNumberp, pushUserToken, legal, dateOfBirth):
|
""" User object representation """
|
||||||
self._account_id = account_id
|
def __init__(self, user_id, email, first_name, created_at, phone_number, # pylint: disable= R0913
|
||||||
|
push_user_token, legal, date_of_birth):
|
||||||
|
self._user_id = user_id
|
||||||
self._email = email
|
self._email = email
|
||||||
self._firstName = firstName
|
self._first_name = first_name
|
||||||
self._createdAt = createdAt
|
self._created_at = created_at
|
||||||
self._phoneNumberp = phoneNumberp
|
self._phone_number = phone_number
|
||||||
self._pushUserToken = pushUserToken
|
self._push_user_token = push_user_token
|
||||||
self._legal = legal
|
self._legal = legal
|
||||||
self._dateOfBirth = dateOfBirth
|
self._date_of_birth = date_of_birth
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def user_id(self):
|
def user_id(self):
|
||||||
|
""" user_id """
|
||||||
return self._user_id
|
return self._user_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def email(self):
|
def email(self):
|
||||||
|
""" email """
|
||||||
return self._email
|
return self._email
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def firstName(self):
|
def first_name(self):
|
||||||
return self._firstName
|
""" first_name """
|
||||||
|
return self._first_name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def createdAt(self):
|
def created_at(self):
|
||||||
return self._createdAt
|
""" created_at """
|
||||||
|
return self._created_at
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def phoneNumber(self):
|
def phone_number(self):
|
||||||
return self._phoneNumber
|
""" phone_number """
|
||||||
|
return self._phone_number
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def pushUserToken(self):
|
def push_user_token(self):
|
||||||
return self._pushUserToken
|
""" push_user_token """
|
||||||
|
return self._push_user_token
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def legal(self):
|
def legal(self):
|
||||||
|
""" legal """
|
||||||
return self._legal
|
return self._legal
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dateOfBirth(self):
|
def date_of_birth(self):
|
||||||
return self._dateOfBirth
|
""" date_ofo_birth """
|
||||||
|
return self._date_of_birth
|
||||||
|
|
||||||
def fromJson(json):
|
@staticmethod
|
||||||
|
def from_json(json):
|
||||||
|
"""return new object fromjson"""
|
||||||
return GeorideUser(
|
return GeorideUser(
|
||||||
json['id'],
|
json['id'],
|
||||||
json['email'],
|
json['email'],
|
||||||
@@ -497,8 +596,3 @@ class GeorideUser:
|
|||||||
json['legal'],
|
json['legal'],
|
||||||
json['dateOfBirth']
|
json['dateOfBirth']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
print("Not a main module")
|
|
||||||
Reference in New Issue
Block a user