diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a81c8ee --- /dev/null +++ b/.gitignore @@ -0,0 +1,138 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ diff --git a/ChargeControl.py b/ChargeControl.py new file mode 100644 index 0000000..d3f7e7c --- /dev/null +++ b/ChargeControl.py @@ -0,0 +1,94 @@ +import json +import threading +from copy import copy +from datetime import datetime, timedelta +from hashlib import md5 + +from MyPSACC import MyPSACC + +class ChargeControls: + def __init__(self): + self.list: dict = {} + self._confighash = None + + def saveconfig(self,name="charge_config.json",force=False): + chd = {} + for key, el in self.list.items(): + chd[el.vin] = {"percentage_threshold": el.percentage_threshold, "stop_hour": el._stop_hour} + config_str = json.dumps(chd, sort_keys=True, indent=4).encode('utf-8') + new_hash = md5(config_str).hexdigest() + if force or self._confighash != new_hash : + with open(name, "wb") as f: + f.write(config_str) + self._confighash = new_hash + print("save config change") + + def load_config(psacc:MyPSACC, name="charge_config.json"): + with open(name, "r") as f: + str = f.read() + chd = json.loads(str) + charge_control_list = ChargeControls() + for vin, el in chd.items(): + charge_control_list.list[vin] = ChargeControl(psacc,vin,**el) + return charge_control_list + def get(self,vin): + try: + return self.list[vin] + except KeyError: + return None + + def start(self): + for vin, charge_control in self.list.items(): + charge_control.start() + + +class ChargeControl: + def __init__(self, psacc:MyPSACC, vin, percentage_threshold, stop_hour): + self.vin = vin + self.percentage_threshold = percentage_threshold + self.set_stop_hour(stop_hour) + self.psacc = psacc + self.retry_count = 0 + + def set_stop_hour(self,stop_hour): + if stop_hour == [0, 0]: + self._stop_hour = None + self._next_stop_hour = None + else: + self._stop_hour = stop_hour + self._next_stop_hour = datetime.now().replace(hour=stop_hour[0], minute=stop_hour[1], second=0) + if self._next_stop_hour < datetime.now(): + self._next_stop_hour += timedelta(days=1) + + def start(self): + periodicity = 60 * 1 + now = datetime.now() + if self._next_stop_hour is not None and self._next_stop_hour < now: + stop_charge = True + self._next_stop_hour += timedelta(days=1) + print("stop charge") + else : + stop_charge = False + + if self.percentage_threshold != 100 or stop_charge: + res = self.psacc.getVehiculeinfo(self.vin) + status = res.energy[0]['charging']['status'] + print(f"charging status of {self.vin} is {status}") + if status == "InProgress": + level = res.energy[0]["level"] + if (level >= self.percentage_threshold or stop_charge) and self.retry_count < 3: + self.psacc.charge_now(self.vin,False) + self.retry_count += 1 + periodicity = 60 * 1 + if self._next_stop_hour is not None: + next_in_second = (self._next_stop_hour- now).total_seconds() + if next_in_second < periodicity: + periodicity = next_in_second + else: + self.retry_count = 0 + threading.Timer(periodicity, self.start).start() + + def get_dict(self): + chd = copy(self.__dict__) + chd.pop("psacc") + return chd \ No newline at end of file diff --git a/MyPSACC.py b/MyPSACC.py new file mode 100644 index 0000000..54a6e9f --- /dev/null +++ b/MyPSACC.py @@ -0,0 +1,341 @@ +import json +import re +import traceback +import uuid +from copy import copy +from datetime import datetime +from http import HTTPStatus +from json import JSONEncoder +from hashlib import md5 +from oauth2_client.credentials_manager import CredentialManager, ServiceInformation +import paho.mqtt.client as mqtt +from requests import Response +import psa_connectedcar as psac +from psa_connectedcar import ApiClient +from psa_connectedcar.rest import ApiException + +oauhth_url = "https://idpcvs.peugeot.com/am/oauth2/access_token" +remote_url = "https://api.groupe-psa.com/connectedcar/v4/virtualkey/remoteaccess/token?client_id=" +scopes = ['openid profile'] +realm = "clientsB2CPeugeot" + + +class OpenIdCredentialManager(CredentialManager): + def _grant_password_request(self, login: str, password: str, realm: str) -> dict: + return dict(grant_type='password', + username=login, + scope=' '.join(self.service_information.scopes), + password=password, realm=realm) + + def init_with_user_credentials(self, login: str, password: str, realm: str): + self._token_request(self._grant_password_request(login, password, realm), True) + + @staticmethod + def _is_token_expired(response: Response) -> bool: + if response.status_code == HTTPStatus.UNAUTHORIZED.value: + print("token expired, renew") + try: + json_data = response.json() + return json_data.get('moreInformation') == 'Token is invalid' + except ValueError: + return False + else: + return False + +class Oauth2PSACCApiConfig(psac.Configuration): + def set_refresh_callback(self,callback): + self.refresh_callback = callback + + +class OauthAPIClient(ApiClient): + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + for x in range(0,2): + try: + if not async_req: + return self._ApiClient__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + except ApiException as e: + if e.reason == 'Unauthorized': + self.configuration.refresh_callback() + else: + raise e + +def correlation_id(date): + date_str = date.strftime("%Y%m%d%H%M%S%f")[:-3] + uuid_str = str(uuid.uuid4()).replace("-", "") + correlation_id = uuid_str + date_str + return correlation_id + + +class MyPSACC: + vehicles_url = "https://idpcvs.peugeot.com/api/connectedcar/v2/oauth/authorize" + headers = { + "x-introspect-realm": realm, + "accept": "application/hal+json", + } + + def connect(self, user, password): + self.manager.init_with_user_credentials(user, password, realm) + + def __init__(self, refresh_token, client_id, client_secret, remote_refresh_token, customer_id, proxies=None, realm=realm): + self.service_information = ServiceInformation('', + oauhth_url, + client_id, + client_secret, + scopes, False) + self.client_id = client_id + self.manager = OpenIdCredentialManager(self.service_information) + self.api_config = Oauth2PSACCApiConfig() + self.api_config.set_refresh_callback(self.manager._refresh_token) + self.manager.refresh_token = refresh_token + self.remote_refresh_token = remote_refresh_token + self.remote_access_token = None + self.vehicles_list = None + self.setProxies(proxies) + self.customer_id = customer_id + self._confighash = None + self.realm = realm + self.api_config.verify_ssl = False + self.api_config.api_key['client_id'] = self.client_id + self.api_config.api_key['x-introspect-realm'] = self.realm + + def refresh_token(self): + self.manager._refresh_token() + + def api(self) -> psac.VehiclesApi : + self.api_config.access_token = self.manager._access_token + api_instance = psac.VehiclesApi(OauthAPIClient(self.api_config)) + return api_instance + + def setProxies(self, proxies): + if proxies is None: + self._proxies = dict(http='', https='') + self.api_config.proxy = None + else: + self._proxies = proxies + self.api_config.proxy = proxies['http'] + self.manager.proxies = self._proxies + + def getVehiculeinfo(self, vin): + res = self.api().get_vehicle_status(self.get_vehicle_id_with_vin(vin)) + return res + + def newMonitor(self,vin,body): + res = self.manager.post("https://api.groupe-psa.com/connectedcar/v4/user/vehicles/" + self.vehicles_list[vin][ + "id"] + "/status?client_id=" + self.client_id, headers=MyPSACC.headers, data=body) + data = res.json() + return data + def get_vehicles(self): + + res =self.api().get_vehicles_by_device() + self.vehicles_list = {} + for vehicle in res.embedded.vehicles: + vin = vehicle.vin + self.vehicles_list[vin] = {"id":vehicle.id} + return self.vehicles_list + + def get_vehicle_id_with_vin(self, vin): + return self.vehicles_list[vin]["id"] + + def getVIN(self): + if self.vehicles_list is None: + self.get_vehicles() + return list(self.vehicles_list.keys()) + + def get_remote_access_token(self, password): + res = self.manager.post(remote_url + self.client_id, + json={"grant_type": "password", "password": password}, + headers=self.headers) + data = res.json() + self.remote_access_token = data["access_token"] + self.remote_refresh_token = data["refresh_token"] + return res + + def refresh_remote_token(self): + res = self.manager.post(remote_url + self.client_id, + json={"grant_type": "refresh_token", "refresh_token": self.remote_refresh_token}, + headers=self.headers) + data = res.json() + print(data) + self.remote_access_token = data["access_token"] + self.remote_refresh_token = data["refresh_token"] + return data["access_token"], data["refresh_token"] + + def on_mqtt_connect(self, client, userdata, rc, a): + try: + print("Connected with result code " + str(rc)) + topics = ["psa/RemoteServices/to/cid/" + self.customer_id + "/#" ] + for vin in self.getVIN(): + topics.append("psa/RemoteServices/events/MPHRTServices/" + vin + "/#") + for topic in topics: + client.subscribe(topic) + print("subscribe to "+topic) + except: + traceback.print_exc() + + def on_mqtt_disconnect(self, client, userdata, rc): + try: + print("Disconnected with result code " + str(rc)) + # Subscribing in on_connect() means that if we lose the connection and + # reconnect then subscriptions will be renewed. + print(mqtt.error_string(rc)) + except: + traceback.print_exc() + + def on_mqtt_message(self, client, userdata, msg): + print(msg.topic + " " + str(msg.payload)) + try: + data = json.loads(msg.payload) + if data["return_code"] == 400: + self.manager._refresh_token() + self.refresh_remote_token() + print("retry last request") + except: + print("mqtt msg hasn't return code") + + def startmqtt(self): + self.refresh_remote_token() + self.mqtt_client = mqtt.Client(clean_session=True, protocol=mqtt.MQTTv311) + self.mqtt_client.tls_set_context() + self.mqtt_client.on_connect = self.on_mqtt_connect + self.mqtt_client.on_message = self.on_mqtt_message + self.mqtt_client.on_disconnect = self.on_mqtt_disconnect + self.mqtt_client.username_pw_set("IMA_OAUTH_ACCESS_TOKEN", self.remote_access_token) + self.mqtt_client.connect("mwa.mpsa.com", 8885, 60) + self.mqtt_client.loop_start() + return self.mqtt_client.is_connected() + def mqtt_request(self, vin, req_parameters): + date = datetime.now() + date_f = "%Y-%m-%dT%H:%M:%SZ" + date_str = date.strftime(date_f) + data = {"access_token": self.remote_access_token, "customer_id": self.customer_id, + "correlation_id": correlation_id(date), "req_date": date_str, "vin": vin, + "req_parameters": req_parameters} + print(f"send mqtt msg: {data}") + return json.dumps(data) + + def get_charge_hour(self, vin): + reg = r"PT([0-9]{1,2})H([0-9]{1,2})?" + data = self.getVehiculeinfo(vin) + hour_str = data.energy[0]['charging']['nextDelayedTime'] + hour = re.findall(reg, hour_str)[0] + h = int(hour[0]) + if hour[1] == '': + m = 0 + else: + m = hour[1] + return h, m + + def get_charge_status(self, vin): + data = self.getVehiculeinfo(vin) + status = data["energy"][0]['charging']['status'] + return status + + def veh_charge_request(self, vin, hour, miinute, charge_type): + # todo consider actual state before change the hour + msg = self.mqtt_request(vin, {"program": {"hour": hour, "minute": miinute}, "type": charge_type}) + print(msg) + self.mqtt_client.publish("psa/RemoteServices/from/cid/" + self.customer_id + "/VehCharge", msg) + + def change_charge_hour(self, vin, hour, miinute): + # todo consider actual state before change the hour + self.veh_charge_request(vin, hour, miinute, "delayed") + return True + + def charge_now(self, vin, now): + if now: + charge_type = "immediate" + else: + charge_type = "delayed" + hour, minute = self.get_charge_hour(vin) + self.veh_charge_request(vin, hour, minute, charge_type) + return True + + def horn(self, vin, count): + msg = self.mqtt_request(vin, {"nb_horn": count, "action": "activate"}) + print(msg) + self.mqtt_client.publish("psa/RemoteServices/from/cid/" + self.customer_id + "/Horn", msg) + + def lights(self, vin, duration: int): + msg = self.mqtt_request(vin, {"action": "activate", "duration": duration}) + print(msg) + self.mqtt_client.publish("psa/RemoteServices/from/cid/" + self.customer_id + "/Lights", msg) + + def wakeup(self, vin): + msg = self.mqtt_request(vin, {"action": "state"}) + print(msg) + self.mqtt_client.publish("psa/RemoteServices/from/cid/" + self.customer_id + "/VehCharge/state", msg) + return True + + def lock_door(self, vin, lock: bool): + if lock: + value = "lock" + else: + value = "unlock" + + msg = self.mqtt_request(vin, {"action": value}) + print(msg) + self.mqtt_client.publish("psa/RemoteServices/from/cid/" + self.customer_id + "/Doors", msg) + return True + + def preconditioning(self, vin, activate: bool): + if activate: + value = "activate" + else: + value = "deactivate" + msg = self.mqtt_request(vin, {"asap": value, "programs": { + "program1": {"day": [0, 0, 0, 0, 0, 0, 0], "hour": 34, "minute": 7, "on": 0}, + "program2": {"day": [0, 0, 0, 0, 0, 0, 0], "hour": 34, "minute": 7, "on": 0}, + "program3": {"day": [0, 0, 0, 0, 0, 0, 0], "hour": 34, "minute": 7, "on": 0}, + "program4": {"day": [0, 0, 0, 0, 0, 0, 0], "hour": 34, "minute": 7, "on": 0}}}) + print(msg) + self.mqtt_client.publish("psa/RemoteServices/from/cid/" + self.customer_id + "/ThermalPrecond", msg) + return True + + + def saveconfig(self,name="config.json",force=False): + config_str = json.dumps(self, cls=MyPuegeotEncoder, sort_keys=True, indent=4).encode("utf8") + new_hash = md5(config_str).hexdigest() + if force or self._confighash != new_hash : + with open(name, "wb") as f: + f.write(config_str) + self._confighash = new_hash + print("save config change") + + def loadconfig(name="config.json"): + with open(name, "r") as f: + str = f.read() + return MyPSACC(**json.loads(str)) + + +class MyPuegeotEncoder(JSONEncoder): + def default(self, mp: MyPSACC): + mpd = copy(mp.__dict__) + mpd["proxies"] = mpd["_proxies"] + mpd["refresh_token"] = mp.manager.refresh_token + mpd["client_secret"] = mp.service_information.client_secret + for el in ["service_information", "manager", "mqtt_client", "vehicles_list", "_proxies", "remote_access_token","_confighash","api_config"]: + if el in mpd: + mpd.pop(el) + return mpd + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..14a4baf --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ +# Remote Control of PSA car +### This is a python program to control a psa car with connected_car v4 api. Using android app to retrieve credentials. +I test it with a Peugeot e-208 but it should work with others PSA vehicles. + +With this app you will be able to : + - get the status of the car (battery level for electric vehicle, position ... ) + - start and stop the charge + - set a charge threshold to limit the battery level to a certain percentage + - set a stop hour to charge your vehicle only on off-peak hours + +## I. Get all credendtials +1. Backup MyPeugeot app + + 1.1 MyPeugeot app doesn't allow backup by default so you need to modify it. + To do that you can follow this guide: https://forum.xda-developers.com/android/software-hacking/guide-how-to-enable-adb-backup-app-t3495117 + + 1.2 Uninstall the original app + + 1.3 Install the modified app + + 1.4 Enable developer mode on your android phone + + 1.5 enable password for backup in developer option of your android phone (for some smartphone it is mandatory to sucessfuly backup app) + + 1.6 backup MyPeugeot app : + + ``` adb backup -f backup.ab -noapk com.psa.mym.mypeugeot ``` + +2. Retrieve credentials in the backup + + ``` + python3 app_decoder.py backup.ab + Calculated MK checksum (use UTF-8: true): XXXXXXXXXXXXX + 0% 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% 11% 12% 13% 14% 15% 25% 26% 100% + 235687424 bytes written to backup.tar. + mypeugeot email: + mypeugeot password: + What is the car api realm : clientsB2CPeugeot, clientsB2CDS, clientsB2COpel, clientsB2CVauxhall + clientsB2CPeugeot + save config change + + Your vehicles: {'VINNUBMER': {'id': 'vehicule id'}} + ``` + 3. If it works you will have VIN of your vehicles and there ids in the last line. The script generate a test.json file with all credentials needed. + + ## II. Use the app + 1. start the app: + ``python3 server.py -f test.json`` + + 2. Test it + + 2.1 Get the car state : + http://localhost:5000/get_vehiculeinfo/YOURVIN + + 2.2 Stop charge + http://localhost:5000/charge_now/YOURVIN/0 + + 2.3 Set hour to stop the charge to 6am + http://localhost:5000/charge_control?vin=yourvin&hour=6&minute=0 + + 2.4 Change car charge threshold to 80 percent + http://localhost:5000/charge_control?vin=YOURVIN&percentage=80 + \ No newline at end of file diff --git a/abe-all.jar b/abe-all.jar new file mode 100644 index 0000000..3175577 Binary files /dev/null and b/abe-all.jar differ diff --git a/app_decoder.py b/app_decoder.py new file mode 100644 index 0000000..7ffcdb9 --- /dev/null +++ b/app_decoder.py @@ -0,0 +1,67 @@ +import json +import os +import shutil +import xml.etree.ElementTree as ET +import base64 + +from ChargeControl import ChargeControl, ChargeControls +from MyPSACC import MyPSACC +from sys import argv +import tarfile + + +def getxmlvalue(root, name): + for child in root.findall("*[@name='" + name + "']"): + return child.text + + +current_dir = os.getcwd() +script_dir = dir_path = os.path.dirname(os.path.realpath(__file__)) + +if len(argv) > 2: + password = argv[2] +else: + password = "" + +os.system(f"java -jar {script_dir}/abe-all.jar unpack {argv[1]} backup.tar {password}") +my_tar = tarfile.open('backup.tar') +my_tar.extractall() + +dir = "apps/com.psa.mym.mypeugeot" +os.chdir(dir + "/sp") + +psa_pref = "com.psa.mym.mypeugeot_preferences.xml" +root = ET.parse(psa_pref).getroot() +client_secret = getxmlvalue(root, "CEA_CLIENT_SECRET") +client_id = getxmlvalue(root, "CEA_CLIENT_ID") + +remote_info_file = "BASIC_AUTH_CVS.xml" +root = ET.parse(remote_info_file).getroot() +customer_id_enc = getxmlvalue(root, "CRYPTED_CUSTOMER_ID") +customer_id = base64.b64decode(customer_id_enc).decode('utf-8') + +root = ET.parse("HUTokenManager.xml").getroot() +remote_enc = root[0].text +remote_refresh_token = json.loads(base64.b64decode(remote_enc))["refresh_token"] + + + +client_email = input("mypeugeot email: ") +client_paswword = input("mypeugeot password: ") +client_realm = input("What is the car api realm : clientsB2CPeugeot, clientsB2CDS, clientsB2COpel, clientsB2CVauxhall\n") +psacc = MyPSACC(None, client_id, client_secret, remote_refresh_token, customer_id, realm=client_realm) +psacc.connect(client_email, client_paswword) + +os.chdir(current_dir) +psacc.saveconfig(name="test.json") +res = psacc.get_vehicles() +print(f"\nYour vehicles: {res}") + +os.remove("backup.tar") +shutil.rmtree('apps') +charge_controls = ChargeControls() +for vin,vehicle in res.items(): + chc = ChargeControl(None,vin,100,[0,0]) + charge_controls.list[vin] = chc +charge_controls.saveconfig(name="charge_config1.json") + diff --git a/psa_connectedcar/__init__.py b/psa_connectedcar/__init__.py new file mode 100644 index 0000000..84b8f78 --- /dev/null +++ b/psa_connectedcar/__init__.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import apis into sdk package +from psa_connectedcar.api.trips_api import TripsApi +from psa_connectedcar.api.user_api import UserApi +from psa_connectedcar.api.vehicles_api import VehiclesApi + +# import ApiClient +from psa_connectedcar.api_client import ApiClient +from psa_connectedcar.configuration import Configuration +# import models into sdk package +from psa_connectedcar.models.adas import Adas +from psa_connectedcar.models.adas_park_assist import AdasParkAssist +from psa_connectedcar.models.alert import Alert +from psa_connectedcar.models.alert_end_position import AlertEndPosition +from psa_connectedcar.models.alert_links import AlertLinks +from psa_connectedcar.models.alert_msg_enum import AlertMsgEnum +from psa_connectedcar.models.alerts import Alerts +from psa_connectedcar.models.alerts_embedded import AlertsEmbedded +from psa_connectedcar.models.battery import Battery +from psa_connectedcar.models.bounded_program import BoundedProgram +from psa_connectedcar.models.charging_status_enum import ChargingStatusEnum +from psa_connectedcar.models.circle_zone import CircleZone +from psa_connectedcar.models.circle_zone_coordinates import CircleZoneCoordinates +from psa_connectedcar.models.collection_result import CollectionResult +from psa_connectedcar.models.collision import Collision +from psa_connectedcar.models.collision_links import CollisionLinks +from psa_connectedcar.models.collision_obj import CollisionObj +from psa_connectedcar.models.collision_obj_front import CollisionObjFront +from psa_connectedcar.models.collisions import Collisions +from psa_connectedcar.models.collisions_embedded import CollisionsEmbedded +from psa_connectedcar.models.created_at_field import CreatedAtField +from psa_connectedcar.models.data_monitor_trigger import DataMonitorTrigger +from psa_connectedcar.models.data_trigger import DataTrigger +from psa_connectedcar.models.default_alert_push import DefaultAlertPush +from psa_connectedcar.models.default_alert_push_attributes import DefaultAlertPushAttributes +from psa_connectedcar.models.doors_state import DoorsState +from psa_connectedcar.models.doors_state_opening import DoorsStateOpening +from psa_connectedcar.models.e_coaching import ECoaching +from psa_connectedcar.models.e_coaching_links import ECoachingLinks +from psa_connectedcar.models.e_coaching_scores import ECoachingScores +from psa_connectedcar.models.energy import Energy +from psa_connectedcar.models.engine import Engine +from psa_connectedcar.models.engine_oil import EngineOil +from psa_connectedcar.models.environment import Environment +from psa_connectedcar.models.environment_luminosity import EnvironmentLuminosity +from psa_connectedcar.models.event import Event +from psa_connectedcar.models.event_links import EventLinks +from psa_connectedcar.models.extension import Extension +from psa_connectedcar.models.extension_type import ExtensionType +from psa_connectedcar.models.geometry import Geometry +from psa_connectedcar.models.ignition import Ignition +from psa_connectedcar.models.index_range import IndexRange +from psa_connectedcar.models.kinetic import Kinetic +from psa_connectedcar.models.lighting import Lighting +from psa_connectedcar.models.link import Link +from psa_connectedcar.models.maintenance import Maintenance +from psa_connectedcar.models.maintenance_links import MaintenanceLinks +from psa_connectedcar.models.maintenance_obj import MaintenanceObj +from psa_connectedcar.models.monitor import Monitor +from psa_connectedcar.models.monitor_id import MonitorId +from psa_connectedcar.models.monitor_links import MonitorLinks +from psa_connectedcar.models.monitor_parameter import MonitorParameter +from psa_connectedcar.models.monitor_parameter_trigger_param import MonitorParameterTriggerParam +from psa_connectedcar.models.monitor_ref import MonitorRef +from psa_connectedcar.models.monitor_ref_links import MonitorRefLinks +from psa_connectedcar.models.monitor_status import MonitorStatus +from psa_connectedcar.models.monitor_status_setter import MonitorStatusSetter +from psa_connectedcar.models.monitor_subscribe import MonitorSubscribe +from psa_connectedcar.models.monitor_subscribe_batch_notify import MonitorSubscribeBatchNotify +from psa_connectedcar.models.monitor_subscribe_retry_policy import MonitorSubscribeRetryPolicy +from psa_connectedcar.models.monitor_trigger import MonitorTrigger +from psa_connectedcar.models.monitor_webhook import MonitorWebhook +from psa_connectedcar.models.monitor_webhook_attributes import MonitorWebhookAttributes +from psa_connectedcar.models.monitors import Monitors +from psa_connectedcar.models.monitors_embedded import MonitorsEmbedded +from psa_connectedcar.models.overall_autonomy import OverallAutonomy +from psa_connectedcar.models.point import Point +from psa_connectedcar.models.polygon_zone import PolygonZone +from psa_connectedcar.models.position import Position +from psa_connectedcar.models.position_properties import PositionProperties +from psa_connectedcar.models.preconditioning import Preconditioning +from psa_connectedcar.models.preconditioning_air_conditioning import PreconditioningAirConditioning +from psa_connectedcar.models.preconditioning_program import PreconditioningProgram +from psa_connectedcar.models.privacy import Privacy +from psa_connectedcar.models.program import Program +from psa_connectedcar.models.program_occurence import ProgramOccurence +from psa_connectedcar.models.safety import Safety +from psa_connectedcar.models.service_type import ServiceType +from psa_connectedcar.models.status import Status +from psa_connectedcar.models.status_embedded import StatusEmbedded +from psa_connectedcar.models.status_extension_type import StatusExtensionType +from psa_connectedcar.models.status_links import StatusLinks +from psa_connectedcar.models.tab_links import TabLinks +from psa_connectedcar.models.telemetry import Telemetry +from psa_connectedcar.models.telemetry_embedded import TelemetryEmbedded +from psa_connectedcar.models.telemetry_enum import TelemetryEnum +from psa_connectedcar.models.telemetry_extension import TelemetryExtension +from psa_connectedcar.models.telemetry_extension_type import TelemetryExtensionType +from psa_connectedcar.models.telemetry_message import TelemetryMessage +from psa_connectedcar.models.telemetry_message_embedded import TelemetryMessageEmbedded +from psa_connectedcar.models.telemetry_message_vehicle import TelemetryMessageVehicle +from psa_connectedcar.models.telemetry_message_vehicle_braking_system import TelemetryMessageVehicleBrakingSystem +from psa_connectedcar.models.telemetry_message_vehicle_transmission import TelemetryMessageVehicleTransmission +from psa_connectedcar.models.telemetry_message_vehicle_transmission_gearbox import TelemetryMessageVehicleTransmissionGearbox +from psa_connectedcar.models.telemetry_message_vehicle_transmission_gearbox_gear import TelemetryMessageVehicleTransmissionGearboxGear +from psa_connectedcar.models.telemetry_message_vehicle_transmission_gearbox_mode import TelemetryMessageVehicleTransmissionGearboxMode +from psa_connectedcar.models.time_monitor_trigger import TimeMonitorTrigger +from psa_connectedcar.models.time_range import TimeRange +from psa_connectedcar.models.time_stamped import TimeStamped +from psa_connectedcar.models.time_trigger import TimeTrigger +from psa_connectedcar.models.time_zone_monitor_trigger import TimeZoneMonitorTrigger +from psa_connectedcar.models.time_zone_trigger import TimeZoneTrigger +from psa_connectedcar.models.trip import Trip +from psa_connectedcar.models.trip_avg_consumption import TripAvgConsumption +from psa_connectedcar.models.trip_links import TripLinks +from psa_connectedcar.models.trips import Trips +from psa_connectedcar.models.trips_embedded import TripsEmbedded +from psa_connectedcar.models.updated_field import UpdatedField +from psa_connectedcar.models.url import Url +from psa_connectedcar.models.user import User +from psa_connectedcar.models.user_embedded import UserEmbedded +from psa_connectedcar.models.user_links import UserLinks +from psa_connectedcar.models.vect2_d import Vect2D +from psa_connectedcar.models.vehicle import Vehicle +from psa_connectedcar.models.vehicle_engine import VehicleEngine +from psa_connectedcar.models.vehicle_links import VehicleLinks +from psa_connectedcar.models.vehicle_odometer import VehicleOdometer +from psa_connectedcar.models.vehicles import Vehicles +from psa_connectedcar.models.vehicles_embedded import VehiclesEmbedded +from psa_connectedcar.models.way_points import WayPoints +from psa_connectedcar.models.way_points_embedded import WayPointsEmbedded +from psa_connectedcar.models.x_error import XError +from psa_connectedcar.models.zone_monitor_trigger import ZoneMonitorTrigger +from psa_connectedcar.models.zone_trigger import ZoneTrigger +from psa_connectedcar.models.zone_trigger_place import ZoneTriggerPlace +from psa_connectedcar.models.zone_trigger_place_center import ZoneTriggerPlaceCenter diff --git a/psa_connectedcar/api/__init__.py b/psa_connectedcar/api/__init__.py new file mode 100644 index 0000000..a73e183 --- /dev/null +++ b/psa_connectedcar/api/__init__.py @@ -0,0 +1,8 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from psa_connectedcar.api.trips_api import TripsApi +from psa_connectedcar.api.user_api import UserApi +from psa_connectedcar.api.vehicles_api import VehiclesApi diff --git a/psa_connectedcar/api/trips_api.py b/psa_connectedcar/api/trips_api.py new file mode 100644 index 0000000..9d49381 --- /dev/null +++ b/psa_connectedcar/api/trips_api.py @@ -0,0 +1,2001 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from psa_connectedcar.api_client import ApiClient + + +class TripsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_path_for_trip(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Gives the wayPoints for a specified User Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_path_for_trip(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :return: WayPoints + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_path_for_trip_with_http_info(tid, **kwargs) # noqa: E501 + else: + (data) = self.get_path_for_trip_with_http_info(tid, **kwargs) # noqa: E501 + return data + + def get_path_for_trip_with_http_info(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Gives the wayPoints for a specified User Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_path_for_trip_with_http_info(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :return: WayPoints + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tid', 'index_range'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_path_for_trip" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_path_for_trip`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_path_for_trip`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/trips/{tid}/wayPoints', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WayPoints', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_path_for_trip_0(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Gives the Vehicle's wayPoints for a specified Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_path_for_trip_0(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param float tolerance: Tolerance factor is expressed in length KM unit and is used to simplify path by reducing the total number of points by is using Douglas-Peucker algorithme to find a similar curve with fewer points (find more info here: [Ramer_Douglas_Peucker_algorithm](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm#Algorithm) ). + :return: WayPoints + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_path_for_trip_0_with_http_info(id, tid, **kwargs) # noqa: E501 + else: + (data) = self.get_path_for_trip_0_with_http_info(id, tid, **kwargs) # noqa: E501 + return data + + def get_path_for_trip_0_with_http_info(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Gives the Vehicle's wayPoints for a specified Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_path_for_trip_0_with_http_info(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param float tolerance: Tolerance factor is expressed in length KM unit and is used to simplify path by reducing the total number of points by is using Douglas-Peucker algorithme to find a similar curve with fewer points (find more info here: [Ramer_Douglas_Peucker_algorithm](https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm#Algorithm) ). + :return: WayPoints + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'tid', 'index_range', 'timestamps', 'tolerance'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_path_for_trip_0" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_path_for_trip_0`") # noqa: E501 + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_path_for_trip_0`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_path_for_trip_0`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'tolerance' in params: + query_params.append(('tolerance', params['tolerance'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/trips/{tid}/wayPoints', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WayPoints', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_telemetry_for_trip(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Telemetry values that occurred for a given vehicle (id) and a speific Trip (tid) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_telemetry_for_trip(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param list[str] type: Results will only contain Telemetry messages of this kind. You can add more than one message type. + :param list[str] extension: Additional data set that will be included in embedded field * _Disclaimer_: **Enabling ```maintenance``` extension will automatically disable ```Kinetic``` telemetry message** + :return: Telemetry + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_telemetry_for_trip_with_http_info(tid, **kwargs) # noqa: E501 + else: + (data) = self.get_telemetry_for_trip_with_http_info(tid, **kwargs) # noqa: E501 + return data + + def get_telemetry_for_trip_with_http_info(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Telemetry values that occurred for a given vehicle (id) and a speific Trip (tid) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_telemetry_for_trip_with_http_info(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param list[str] type: Results will only contain Telemetry messages of this kind. You can add more than one message type. + :param list[str] extension: Additional data set that will be included in embedded field * _Disclaimer_: **Enabling ```maintenance``` extension will automatically disable ```Kinetic``` telemetry message** + :return: Telemetry + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tid', 'timestamps', 'index_range', 'locale', 'type', 'extension'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_telemetry_for_trip" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_telemetry_for_trip`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_telemetry_for_trip`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + collection_formats['type'] = 'multi' # noqa: E501 + if 'extension' in params: + query_params.append(('extension', params['extension'])) # noqa: E501 + collection_formats['extension'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/trips/{tid}/telemetry', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Telemetry', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_telemetry_for_trip_0(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Telemetry values that occurred for a given vehicle (id) and a speific Trip (tid) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_telemetry_for_trip_0(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param list[str] type: Results will only contain Telemetry messages of this kind. You can add more than one message type. + :param list[str] extension: Additional data set that will be included in embedded field * _Disclaimer_: **Enabling ```maintenance``` extension will automatically disable ```Kinetic``` telemetry message** + :return: Telemetry + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_telemetry_for_trip_0_with_http_info(id, tid, **kwargs) # noqa: E501 + else: + (data) = self.get_telemetry_for_trip_0_with_http_info(id, tid, **kwargs) # noqa: E501 + return data + + def get_telemetry_for_trip_0_with_http_info(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Telemetry values that occurred for a given vehicle (id) and a speific Trip (tid) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_telemetry_for_trip_0_with_http_info(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param list[str] type: Results will only contain Telemetry messages of this kind. You can add more than one message type. + :param list[str] extension: Additional data set that will be included in embedded field * _Disclaimer_: **Enabling ```maintenance``` extension will automatically disable ```Kinetic``` telemetry message** + :return: Telemetry + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'tid', 'timestamps', 'index_range', 'locale', 'type', 'extension'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_telemetry_for_trip_0" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_telemetry_for_trip_0`") # noqa: E501 + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_telemetry_for_trip_0`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_telemetry_for_trip_0`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + collection_formats['type'] = 'multi' # noqa: E501 + if 'extension' in params: + query_params.append(('extension', params['extension'])) # noqa: E501 + collection_formats['extension'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/trips/{tid}/telemetry', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Telemetry', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_trip_by_vehicle(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + This method returns the Trip that matches the Trip id (tid) a given Vehicle (id) has taken. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trip_by_vehicle(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :return: Trip + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_trip_by_vehicle_with_http_info(id, tid, **kwargs) # noqa: E501 + else: + (data) = self.get_trip_by_vehicle_with_http_info(id, tid, **kwargs) # noqa: E501 + return data + + def get_trip_by_vehicle_with_http_info(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + This method returns the Trip that matches the Trip id (tid) a given Vehicle (id) has taken. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trip_by_vehicle_with_http_info(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :return: Trip + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'tid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_trip_by_vehicle" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_trip_by_vehicle`") # noqa: E501 + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_trip_by_vehicle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/trips/{tid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Trip', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_trips_by_vehicle(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + This method returns the Trip that matches the Trip id (tid) User has taken. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trips_by_vehicle(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :return: Trip + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_trips_by_vehicle_with_http_info(tid, **kwargs) # noqa: E501 + else: + (data) = self.get_trips_by_vehicle_with_http_info(tid, **kwargs) # noqa: E501 + return data + + def get_trips_by_vehicle_with_http_info(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + This method returns the Trip that matches the Trip id (tid) User has taken. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trips_by_vehicle_with_http_info(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :return: Trip + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_trips_by_vehicle" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_trips_by_vehicle`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/trips/{tid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Trip', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_trips_by_vehicle_0(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Return the User Trip ECoaching evaluation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trips_by_vehicle_0(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: ECoaching + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_trips_by_vehicle_0_with_http_info(tid, **kwargs) # noqa: E501 + else: + (data) = self.get_trips_by_vehicle_0_with_http_info(tid, **kwargs) # noqa: E501 + return data + + def get_trips_by_vehicle_0_with_http_info(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Return the User Trip ECoaching evaluation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trips_by_vehicle_0_with_http_info(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: ECoaching + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tid', 'locale'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_trips_by_vehicle_0" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_trips_by_vehicle_0`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/trips/{tid}/ecoaching', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ECoaching', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_trips_by_vehicle_1(self, id, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + This method returns a list of all Trips that a given Vehicle has taken. This will NOT include Trips that have not yet been completed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trips_by_vehicle_1(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Trips + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_trips_by_vehicle_1_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_trips_by_vehicle_1_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_trips_by_vehicle_1_with_http_info(self, id, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + This method returns a list of all Trips that a given Vehicle has taken. This will NOT include Trips that have not yet been completed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trips_by_vehicle_1_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Trips + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'timestamps', 'index_range', 'page_size', 'page_token'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_trips_by_vehicle_1" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_trips_by_vehicle_1`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_trips_by_vehicle_1`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_trips_by_vehicle_1`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/trips', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Trips', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_trips_by_vehicle_2(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Return the Trip ECoaching evaluation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trips_by_vehicle_2(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: ECoaching + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_trips_by_vehicle_2_with_http_info(id, tid, **kwargs) # noqa: E501 + else: + (data) = self.get_trips_by_vehicle_2_with_http_info(id, tid, **kwargs) # noqa: E501 + return data + + def get_trips_by_vehicle_2_with_http_info(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Return the Trip ECoaching evaluation. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_trips_by_vehicle_2_with_http_info(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: ECoaching + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'tid', 'locale'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_trips_by_vehicle_2" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_trips_by_vehicle_2`") # noqa: E501 + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_trips_by_vehicle_2`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/trips/{tid}/ecoaching', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ECoaching', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_collision_by_tip_by_id(self, tid, cid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the Collision(cid) that occurred for a given vehicle(id) during a Trip(tid) . # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_collision_by_tip_by_id(tid, cid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param str cid: Results will only contain the Collision related to this Collision *id*. (required) + :return: Collision + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_collision_by_tip_by_id_with_http_info(tid, cid, **kwargs) # noqa: E501 + else: + (data) = self.get_user_collision_by_tip_by_id_with_http_info(tid, cid, **kwargs) # noqa: E501 + return data + + def get_user_collision_by_tip_by_id_with_http_info(self, tid, cid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the Collision(cid) that occurred for a given vehicle(id) during a Trip(tid) . # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_collision_by_tip_by_id_with_http_info(tid, cid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param str cid: Results will only contain the Collision related to this Collision *id*. (required) + :return: Collision + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tid', 'cid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_collision_by_tip_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_user_collision_by_tip_by_id`") # noqa: E501 + # verify the required parameter 'cid' is set + if ('cid' not in params or + params['cid'] is None): + raise ValueError("Missing the required parameter `cid` when calling `get_user_collision_by_tip_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + if 'cid' in params: + path_params['cid'] = params['cid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/trips/{tid}/collisions/{cid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Collision', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_collisions_by_trip_id(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Collisions that occurred for a given vehicle (id) and a speific Trip (tid) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_collisions_by_trip_id(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Collisions + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_collisions_by_trip_id_with_http_info(tid, **kwargs) # noqa: E501 + else: + (data) = self.get_user_collisions_by_trip_id_with_http_info(tid, **kwargs) # noqa: E501 + return data + + def get_user_collisions_by_trip_id_with_http_info(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Collisions that occurred for a given vehicle (id) and a speific Trip (tid) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_collisions_by_trip_id_with_http_info(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Collisions + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tid', 'timestamps', 'index_range', 'page_size', 'page_token'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_collisions_by_trip_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_user_collisions_by_trip_id`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_user_collisions_by_trip_id`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_user_collisions_by_trip_id`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/trips/{tid}/collisions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Collisions', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_trip_alert_by_aid(self, tid, aid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns information about a specific alert messages for a given Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_trip_alert_by_aid(tid, aid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param str aid: id of the alert. (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: Alert + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_trip_alert_by_aid_with_http_info(tid, aid, **kwargs) # noqa: E501 + else: + (data) = self.get_user_trip_alert_by_aid_with_http_info(tid, aid, **kwargs) # noqa: E501 + return data + + def get_user_trip_alert_by_aid_with_http_info(self, tid, aid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns information about a specific alert messages for a given Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_trip_alert_by_aid_with_http_info(tid, aid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param str aid: id of the alert. (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: Alert + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tid', 'aid', 'locale'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_trip_alert_by_aid" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_user_trip_alert_by_aid`") # noqa: E501 + # verify the required parameter 'aid' is set + if ('aid' not in params or + params['aid'] is None): + raise ValueError("Missing the required parameter `aid` when calling `get_user_trip_alert_by_aid`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + if 'aid' in params: + path_params['aid'] = params['aid'] # noqa: E501 + + query_params = [] + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/trips/{tid}/alerts/{aid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Alert', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_trip_alerts(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the latest alert messages during a Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_trip_alerts(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. + :return: Alerts + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_trip_alerts_with_http_info(tid, **kwargs) # noqa: E501 + else: + (data) = self.get_user_trip_alerts_with_http_info(tid, **kwargs) # noqa: E501 + return data + + def get_user_trip_alerts_with_http_info(self, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the latest alert messages during a Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_trip_alerts_with_http_info(tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. + :return: Alerts + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['tid', 'timestamps', 'index_range', 'page_size', 'page_token', 'locale'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_trip_alerts" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_user_trip_alerts`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_user_trip_alerts`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_user_trip_alerts`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/trips/{tid}/alerts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Alerts', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_user_trips(self, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + This method returns a list of all Trips the User has taken. This will NOT include Trips that have not yet been completed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_trips(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Trips + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_trips_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_user_trips_with_http_info(**kwargs) # noqa: E501 + return data + + def get_user_trips_with_http_info(self, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + This method returns a list of all Trips the User has taken. This will NOT include Trips that have not yet been completed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_trips_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Trips + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['timestamps', 'index_range', 'page_size', 'page_token'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_trips" % key + ) + params[key] = val + del params['kwargs'] + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_user_trips`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_user_trips`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/trips', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Trips', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_collision_by_tip_by_id(self, id, tid, cid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the Collision(cid) that occurred for a given vehicle(id) during a Trip(tid) . # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_collision_by_tip_by_id(id, tid, cid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param str cid: Results will only contain the Collision related to this Collision *id*. (required) + :return: Collision + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_collision_by_tip_by_id_with_http_info(id, tid, cid, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_collision_by_tip_by_id_with_http_info(id, tid, cid, **kwargs) # noqa: E501 + return data + + def get_vehicle_collision_by_tip_by_id_with_http_info(self, id, tid, cid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the Collision(cid) that occurred for a given vehicle(id) during a Trip(tid) . # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_collision_by_tip_by_id_with_http_info(id, tid, cid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param str cid: Results will only contain the Collision related to this Collision *id*. (required) + :return: Collision + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'tid', 'cid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_collision_by_tip_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_collision_by_tip_by_id`") # noqa: E501 + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_vehicle_collision_by_tip_by_id`") # noqa: E501 + # verify the required parameter 'cid' is set + if ('cid' not in params or + params['cid'] is None): + raise ValueError("Missing the required parameter `cid` when calling `get_vehicle_collision_by_tip_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + if 'cid' in params: + path_params['cid'] = params['cid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/trips/{tid}/collisions/{cid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Collision', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_collisions_by_trip_id(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Collisions that occurred for a given vehicle (id) and a speific Trip (tid) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_collisions_by_trip_id(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Collisions + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_collisions_by_trip_id_with_http_info(id, tid, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_collisions_by_trip_id_with_http_info(id, tid, **kwargs) # noqa: E501 + return data + + def get_vehicle_collisions_by_trip_id_with_http_info(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Collisions that occurred for a given vehicle (id) and a speific Trip (tid) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_collisions_by_trip_id_with_http_info(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Collisions + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'tid', 'timestamps', 'index_range', 'page_size', 'page_token'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_collisions_by_trip_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_collisions_by_trip_id`") # noqa: E501 + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_vehicle_collisions_by_trip_id`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_vehicle_collisions_by_trip_id`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_vehicle_collisions_by_trip_id`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/trips/{tid}/collisions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Collisions', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_trip_alert_by_aid(self, id, tid, aid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns information about a specific alert messages for a given Vehicle and Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_trip_alert_by_aid(id, tid, aid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param str aid: id of the alert. (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: Alert + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_trip_alert_by_aid_with_http_info(id, tid, aid, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_trip_alert_by_aid_with_http_info(id, tid, aid, **kwargs) # noqa: E501 + return data + + def get_vehicle_trip_alert_by_aid_with_http_info(self, id, tid, aid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns information about a specific alert messages for a given Vehicle and Trip. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_trip_alert_by_aid_with_http_info(id, tid, aid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param str aid: id of the alert. (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: Alert + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'tid', 'aid', 'locale'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_trip_alert_by_aid" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_trip_alert_by_aid`") # noqa: E501 + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_vehicle_trip_alert_by_aid`") # noqa: E501 + # verify the required parameter 'aid' is set + if ('aid' not in params or + params['aid'] is None): + raise ValueError("Missing the required parameter `aid` when calling `get_vehicle_trip_alert_by_aid`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + if 'aid' in params: + path_params['aid'] = params['aid'] # noqa: E501 + + query_params = [] + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/trips/{tid}/alerts/{aid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Alert', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_trip_alerts(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the latest alert messages for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_trip_alerts(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. + :return: Alerts + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_trip_alerts_with_http_info(id, tid, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_trip_alerts_with_http_info(id, tid, **kwargs) # noqa: E501 + return data + + def get_vehicle_trip_alerts_with_http_info(self, id, tid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the latest alert messages for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_trip_alerts_with_http_info(id, tid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str tid: the *id* of Trip (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. + :return: Alerts + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'tid', 'timestamps', 'index_range', 'page_size', 'page_token', 'locale'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_trip_alerts" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_trip_alerts`") # noqa: E501 + # verify the required parameter 'tid' is set + if ('tid' not in params or + params['tid'] is None): + raise ValueError("Missing the required parameter `tid` when calling `get_vehicle_trip_alerts`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_vehicle_trip_alerts`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_vehicle_trip_alerts`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'tid' in params: + path_params['tid'] = params['tid'] # noqa: E501 + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/trips/{tid}/alerts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Alerts', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/psa_connectedcar/api/user_api.py b/psa_connectedcar/api/user_api.py new file mode 100644 index 0000000..b6be478 --- /dev/null +++ b/psa_connectedcar/api/user_api.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from psa_connectedcar.api_client import ApiClient + + +class UserApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def get_user(self, **kwargs): # noqa: E501 + """User's information # noqa: E501 + + Returns the User's information. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: User + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_user_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_user_with_http_info(**kwargs) # noqa: E501 + return data + + def get_user_with_http_info(self, **kwargs): # noqa: E501 + """User's information # noqa: E501 + + Returns the User's information. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_user_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: User + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json', 'application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/psa_connectedcar/api/vehicles_api.py b/psa_connectedcar/api/vehicles_api.py new file mode 100644 index 0000000..aba9e0a --- /dev/null +++ b/psa_connectedcar/api/vehicles_api.py @@ -0,0 +1,1731 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from psa_connectedcar.api_client import ApiClient + + +class VehiclesApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def delete_monitordd(self, id, mid, **kwargs): # noqa: E501 + """Delete a Monitor. OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Stop (disable) an existing Monitor. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_monitordd(id, mid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str mid: id of the alert. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.delete_monitordd_with_http_info(id, mid, **kwargs) # noqa: E501 + else: + (data) = self.delete_monitordd_with_http_info(id, mid, **kwargs) # noqa: E501 + return data + + def delete_monitordd_with_http_info(self, id, mid, **kwargs): # noqa: E501 + """Delete a Monitor. OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Stop (disable) an existing Monitor. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.delete_monitordd_with_http_info(id, mid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str mid: id of the alert. (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'mid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_monitordd" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `delete_monitordd`") # noqa: E501 + # verify the required parameter 'mid' is set + if ('mid' not in params or + params['mid'] is None): + raise ValueError("Missing the required parameter `mid` when calling `delete_monitordd`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'mid' in params: + path_params['mid'] = params['mid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/monitors/{mid}', 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_car_last_position(self, id, **kwargs): # noqa: E501 + """Last position identified # noqa: E501 + + Returns the latest GPS Position of the Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_car_last_position(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :return: Position + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_car_last_position_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_car_last_position_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_car_last_position_with_http_info(self, id, **kwargs): # noqa: E501 + """Last position identified # noqa: E501 + + Returns the latest GPS Position of the Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_car_last_position_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :return: Position + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_car_last_position" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_car_last_position`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/vnd.geo+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/lastPosition', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Position', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_telemetry(self, id, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the latest Telemetry messages that occurred during a selective timestamp-ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_telemetry(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[str] type: Results will only contain Telemetry messages of this kind. You can add more than one message type. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param list[str] extension: Additional data set that will be included in embedded field * _Disclaimer_: **Enabling ```maintenance``` extension will automatically disable ```Kinetic``` telemetry message** + :return: Telemetry + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_telemetry_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_telemetry_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_telemetry_with_http_info(self, id, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the latest Telemetry messages that occurred during a selective timestamp-ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_telemetry_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[str] type: Results will only contain Telemetry messages of this kind. You can add more than one message type. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param list[str] extension: Additional data set that will be included in embedded field * _Disclaimer_: **Enabling ```maintenance``` extension will automatically disable ```Kinetic``` telemetry message** + :return: Telemetry + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'type', 'index_range', 'page_size', 'page_token', 'locale', 'extension'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_telemetry" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_telemetry`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_telemetry`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_telemetry`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'type' in params: + query_params.append(('type', params['type'])) # noqa: E501 + collection_formats['type'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + if 'extension' in params: + query_params.append(('extension', params['extension'])) # noqa: E501 + collection_formats['extension'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/telemetry', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Telemetry', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_alerts(self, id, **kwargs): # noqa: E501 + """get_vehicle_alerts # noqa: E501 + + Returns the latest alert messages for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_alerts(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param str locale2: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. + :return: Alerts + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_alerts_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_alerts_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_vehicle_alerts_with_http_info(self, id, **kwargs): # noqa: E501 + """get_vehicle_alerts # noqa: E501 + + Returns the latest alert messages for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_alerts_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param str locale2: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. + :return: Alerts + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'timestamps', 'index_range', 'page_size', 'page_token', 'locale', 'locale2'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_alerts" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_alerts`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_vehicle_alerts`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_vehicle_alerts`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + if 'locale2' in params: + query_params.append(('locale', params['locale2'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/alerts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Alerts', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_alerts_by_id(self, id, aid, **kwargs): # noqa: E501 + """get_vehicle_alerts_by_id # noqa: E501 + + Returns information about a specific alert messages for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_alerts_by_id(id, aid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str aid: id of the alert. (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: Alert + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_alerts_by_id_with_http_info(id, aid, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_alerts_by_id_with_http_info(id, aid, **kwargs) # noqa: E501 + return data + + def get_vehicle_alerts_by_id_with_http_info(self, id, aid, **kwargs): # noqa: E501 + """get_vehicle_alerts_by_id # noqa: E501 + + Returns information about a specific alert messages for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_alerts_by_id_with_http_info(id, aid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str aid: id of the alert. (required) + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :return: Alert + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'aid', 'locale'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_alerts_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_alerts_by_id`") # noqa: E501 + # verify the required parameter 'aid' is set + if ('aid' not in params or + params['aid'] is None): + raise ValueError("Missing the required parameter `aid` when calling `get_vehicle_alerts_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'aid' in params: + path_params['aid'] = params['aid'] # noqa: E501 + + query_params = [] + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/alerts/{aid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Alert', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_byid(self, id, **kwargs): # noqa: E501 + """Details of vehicule # noqa: E501 + + Returns detailed information about a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_byid(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :return: Vehicle + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_byid_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_byid_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_vehicle_byid_with_http_info(self, id, **kwargs): # noqa: E501 + """Details of vehicule # noqa: E501 + + Returns detailed information about a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_byid_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :return: Vehicle + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_byid" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_byid`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json ']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Vehicle', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_collision(self, id, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Collisions that occurred for a given vehicle (id) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_collision(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Collisions + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_collision_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_collision_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_vehicle_collision_with_http_info(self, id, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the set of Collisions that occurred for a given vehicle (id) during the timestamp ranges and bounded by an index range. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_collision_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[TimeRange] timestamps: Array of **\"timestamp\"** ranges. Results will contain results whose timestamps are included in those date-time ranges (see **timestamp** data model).**\"timestamp\"** items should be expressed as in '[RFC3339](https://www.ietf.org/rfc/rfc3339.txt)'. + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Collisions + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'timestamps', 'index_range', 'page_size', 'page_token'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_collision" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_collision`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_vehicle_collision`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_vehicle_collision`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'timestamps' in params: + query_params.append(('timestamps', params['timestamps'])) # noqa: E501 + collection_formats['timestamps'] = 'multi' # noqa: E501 + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/collisions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Collisions', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_collision_by_id(self, id, cid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the Collision that matches the vehicle id and the Collision cid. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_collision_by_id(id, cid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str cid: Results will only contain the Collision related to this Collision *id*. (required) + :return: Collision + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_collision_by_id_with_http_info(id, cid, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_collision_by_id_with_http_info(id, cid, **kwargs) # noqa: E501 + return data + + def get_vehicle_collision_by_id_with_http_info(self, id, cid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the Collision that matches the vehicle id and the Collision cid. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_collision_by_id_with_http_info(id, cid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str cid: Results will only contain the Collision related to this Collision *id*. (required) + :return: Collision + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'cid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_collision_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_collision_by_id`") # noqa: E501 + # verify the required parameter 'cid' is set + if ('cid' not in params or + params['cid'] is None): + raise ValueError("Missing the required parameter `cid` when calling `get_vehicle_collision_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'cid' in params: + path_params['cid'] = params['cid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/collisions/{cid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Collision', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_maintenance(self, id, **kwargs): # noqa: E501 + """get_vehicle_maintenance # noqa: E501 + + Returns the latest Maintenance information for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_maintenance(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :return: Maintenance + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_maintenance_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_maintenance_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_vehicle_maintenance_with_http_info(self, id, **kwargs): # noqa: E501 + """get_vehicle_maintenance # noqa: E501 + + Returns the latest Maintenance information for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_maintenance_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :return: Maintenance + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_maintenance" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_maintenance`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/maintenance', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Maintenance', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_monitors(self, id, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the list of subscribed Monitors for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_monitors(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Monitors + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_monitors_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_monitors_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_vehicle_monitors_with_http_info(self, id, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns the list of subscribed Monitors for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_monitors_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Monitors + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'index_range', 'page_size', 'page_token'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_monitors" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_monitors`") # noqa: E501 + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_vehicle_monitors`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_vehicle_monitors`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/monitors', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Monitors', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_monitors_by_id(self, id, mid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns information about a specific Monitor for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_monitors_by_id(id, mid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str mid: id of the alert. (required) + :return: MonitorParameter + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_monitors_by_id_with_http_info(id, mid, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_monitors_by_id_with_http_info(id, mid, **kwargs) # noqa: E501 + return data + + def get_vehicle_monitors_by_id_with_http_info(self, id, mid, **kwargs): # noqa: E501 + """OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Returns information about a specific Monitor for a Vehicle. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_monitors_by_id_with_http_info(id, mid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str mid: id of the alert. (required) + :return: MonitorParameter + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'mid'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_monitors_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_monitors_by_id`") # noqa: E501 + # verify the required parameter 'mid' is set + if ('mid' not in params or + params['mid'] is None): + raise ValueError("Missing the required parameter `mid` when calling `get_vehicle_monitors_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'mid' in params: + path_params['mid'] = params['mid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/monitors/{mid}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MonitorParameter', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicle_status(self, id, **kwargs): # noqa: E501 + """Vehicle status. # noqa: E501 + + Returns the latest vehicle status. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_status(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[str] extension: Additional data set that will be included in embedded field * _Disclaimer_: **Enabling ```odometer``` extension will automatically disable ```kinetic``` telemetry message** + :return: Status + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicle_status_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_vehicle_status_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_vehicle_status_with_http_info(self, id, **kwargs): # noqa: E501 + """Vehicle status. # noqa: E501 + + Returns the latest vehicle status. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicle_status_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param list[str] extension: Additional data set that will be included in embedded field * _Disclaimer_: **Enabling ```odometer``` extension will automatically disable ```kinetic``` telemetry message** + :return: Status + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'extension'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicle_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_vehicle_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'extension' in params: + query_params.append(('extension', params['extension'])) # noqa: E501 + collection_formats['extension'] = 'multi' # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/status', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Status', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_vehicles_by_device(self, **kwargs): # noqa: E501 + """List of vehicules # noqa: E501 + + Returns the Vehicles associated with the User. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicles_by_device(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Vehicles + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_vehicles_by_device_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_vehicles_by_device_with_http_info(**kwargs) # noqa: E501 + return data + + def get_vehicles_by_device_with_http_info(self, **kwargs): # noqa: E501 + """List of vehicules # noqa: E501 + + Returns the Vehicles associated with the User. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_vehicles_by_device_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str index_range: Results indexes will be included in this range (see **indexRange** model). default: 0- example: 0-, 0-5 + :param int page_size: The maximum number of results (for a collection results response) to return per page. When not set, at most 60 results will be returned. + :param str locale: Locale is used for rendering text, correctly displaying regional monetary values, time and date formats. Respect REGEX \\w(-\\w)? + :param str page_token: Start-Page marker, the token for continuing a previous list request on the next page. It is built and used **only** by the server. + :return: Vehicles + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['index_range', 'page_size', 'locale', 'page_token'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_vehicles_by_device" % key + ) + params[key] = val + del params['kwargs'] + + if 'index_range' in params and not re.search(r'\\d+-\\d*', params['index_range']): # noqa: E501 + raise ValueError("Invalid value for parameter `index_range` when calling `get_vehicles_by_device`, must conform to the pattern `/\\d+-\\d*/`") # noqa: E501 + if 'page_size' in params and params['page_size'] < 1: # noqa: E501 + raise ValueError("Invalid value for parameter `page_size` when calling `get_vehicles_by_device`, must be a value greater than or equal to `1`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'index_range' in params: + query_params.append(('indexRange', params['index_range'])) # noqa: E501 + if 'page_size' in params: + query_params.append(('pageSize', params['page_size'])) # noqa: E501 + if 'locale' in params: + query_params.append(('locale', params['locale'])) # noqa: E501 + if 'page_token' in params: + query_params.append(('pageToken', params['page_token'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json ']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='Vehicles', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def set_fleet_vehicle_monitor_status(self, id, mid, **kwargs): # noqa: E501 + """Set a new monitor status. OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Set monitor status. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_fleet_vehicle_monitor_status(id, mid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str mid: id of the alert. (required) + :param MonitorStatusSetter body: + :return: MonitorRef + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.set_fleet_vehicle_monitor_status_with_http_info(id, mid, **kwargs) # noqa: E501 + else: + (data) = self.set_fleet_vehicle_monitor_status_with_http_info(id, mid, **kwargs) # noqa: E501 + return data + + def set_fleet_vehicle_monitor_status_with_http_info(self, id, mid, **kwargs): # noqa: E501 + """Set a new monitor status. OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Set monitor status. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_fleet_vehicle_monitor_status_with_http_info(id, mid, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param str mid: id of the alert. (required) + :param MonitorStatusSetter body: + :return: MonitorRef + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'mid', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method set_fleet_vehicle_monitor_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `set_fleet_vehicle_monitor_status`") # noqa: E501 + # verify the required parameter 'mid' is set + if ('mid' not in params or + params['mid'] is None): + raise ValueError("Missing the required parameter `mid` when calling `set_fleet_vehicle_monitor_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + if 'mid' in params: + path_params['mid'] = params['mid'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/monitors/{mid}/status', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MonitorRef', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def set_vehicle_monitor(self, id, **kwargs): # noqa: E501 + """Create a new Monitor. OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + >Create a Monitor for a Vehicle. This is a kind of vehicle monitor that generates an event following the transition state of one of the (monitored) data of the vehicles. As for example the fuel level, the moving out of a defined geographical area. >When the the trigger occurs, the built event expressed as a JSON object will be sent over the callback. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_vehicle_monitor(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param MonitorParameter body: + :return: MonitorParameter + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.set_vehicle_monitor_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.set_vehicle_monitor_with_http_info(id, **kwargs) # noqa: E501 + return data + + def set_vehicle_monitor_with_http_info(self, id, **kwargs): # noqa: E501 + """Create a new Monitor. OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + >Create a Monitor for a Vehicle. This is a kind of vehicle monitor that generates an event following the transition state of one of the (monitored) data of the vehicles. As for example the fuel level, the moving out of a defined geographical area. >When the the trigger occurs, the built event expressed as a JSON object will be sent over the callback. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_vehicle_monitor_with_http_info(id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str id: Results will only be related to this Vehicle *id*. (required) + :param MonitorParameter body: + :return: MonitorParameter + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method set_vehicle_monitor" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `set_vehicle_monitor`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/hal+json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['Vehicle_auth', 'client_id', 'realm'] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/monitors', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MonitorParameter', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def update_fleet_vehicle_monitor(self, mid, id, **kwargs): # noqa: E501 + """Update and existing Monitor. OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Update an existing ```Monitor``` that has been posted (and accepted previously) for this vehicle. The monitor object (body) provided should be complete because the aggregation is not supported for the update of the ```monitor```. you can retrieve this object using the ```GET /monitor/{mid}``` API then modify it and finally publish it (via this ```PUT API```) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_fleet_vehicle_monitor(mid, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str mid: id of the alert. (required) + :param str id: Results will only be related to this Vehicle *id*. (required) + :param MonitorParameter body: + :return: MonitorRef + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.update_fleet_vehicle_monitor_with_http_info(mid, id, **kwargs) # noqa: E501 + else: + (data) = self.update_fleet_vehicle_monitor_with_http_info(mid, id, **kwargs) # noqa: E501 + return data + + def update_fleet_vehicle_monitor_with_http_info(self, mid, id, **kwargs): # noqa: E501 + """Update and existing Monitor. OUT OF 1ST RELEASE (R-LEV 1.1) SCOPE # noqa: E501 + + Update an existing ```Monitor``` that has been posted (and accepted previously) for this vehicle. The monitor object (body) provided should be complete because the aggregation is not supported for the update of the ```monitor```. you can retrieve this object using the ```GET /monitor/{mid}``` API then modify it and finally publish it (via this ```PUT API```) # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.update_fleet_vehicle_monitor_with_http_info(mid, id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str mid: id of the alert. (required) + :param str id: Results will only be related to this Vehicle *id*. (required) + :param MonitorParameter body: + :return: MonitorRef + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['mid', 'id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_fleet_vehicle_monitor" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'mid' is set + if ('mid' not in params or + params['mid'] is None): + raise ValueError("Missing the required parameter `mid` when calling `update_fleet_vehicle_monitor`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `update_fleet_vehicle_monitor`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'mid' in params: + path_params['mid'] = params['mid'] # noqa: E501 + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/user/vehicles/{id}/monitors/{mid}', 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MonitorRef', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/psa_connectedcar/api_client.py b/psa_connectedcar/api_client.py new file mode 100644 index 0000000..4eda0c1 --- /dev/null +++ b/psa_connectedcar/api_client.py @@ -0,0 +1,638 @@ +# coding: utf-8 +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from psa_connectedcar.configuration import Configuration +import psa_connectedcar.models +from psa_connectedcar import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + # Use the pool property to lazily initialize the ThreadPool. + self._pool = None + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/4.0/python' + + def __del__(self): + if self._pool is not None: + self._pool.close() + self._pool.join() + + @property + def pool(self): + if self._pool is None: + self._pool = ThreadPool() + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(psa_connectedcar.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if (not klass.swagger_types and + not self.__hasattr(klass, 'get_real_child_model')): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/psa_connectedcar/configuration.py b/psa_connectedcar/configuration.py new file mode 100644 index 0000000..d83f138 --- /dev/null +++ b/psa_connectedcar/configuration.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class Configuration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + _default = None + + def __init__(self): + """Constructor""" + if self._default: + for key in self._default.__dict__.keys(): + self.__dict__[key] = copy.copy(self._default.__dict__[key]) + return + + # Default Base url + self.host = "https://api.groupe-psa.com/connectedcar/v4" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + + # access token for OAuth + self.access_token = "" + + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("psa_connectedcar") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @classmethod + def set_default(cls, default): + cls._default = default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + + 'Vehicle_auth': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + 'client_id': + { + 'type': 'api_key', + 'in': 'query', + 'key': 'client_id', + 'value': self.get_api_key_with_prefix('client_id') + }, + 'realm': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'x-introspect-realm', + 'value': self.get_api_key_with_prefix('x-introspect-realm') + }, + + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 4.0\n"\ + "SDK Package Version: 4.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/psa_connectedcar/models/__init__.py b/psa_connectedcar/models/__init__.py new file mode 100644 index 0000000..94991ed --- /dev/null +++ b/psa_connectedcar/models/__init__.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +# flake8: noqa +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import models into model package +from psa_connectedcar.models.adas import Adas +from psa_connectedcar.models.adas_park_assist import AdasParkAssist +from psa_connectedcar.models.alert import Alert +from psa_connectedcar.models.alert_end_position import AlertEndPosition +from psa_connectedcar.models.alert_links import AlertLinks +from psa_connectedcar.models.alert_msg_enum import AlertMsgEnum +from psa_connectedcar.models.alerts import Alerts +from psa_connectedcar.models.alerts_embedded import AlertsEmbedded +from psa_connectedcar.models.battery import Battery +from psa_connectedcar.models.bounded_program import BoundedProgram +from psa_connectedcar.models.charging_status_enum import ChargingStatusEnum +from psa_connectedcar.models.circle_zone import CircleZone +from psa_connectedcar.models.circle_zone_coordinates import CircleZoneCoordinates +from psa_connectedcar.models.collection_result import CollectionResult +from psa_connectedcar.models.collision import Collision +from psa_connectedcar.models.collision_links import CollisionLinks +from psa_connectedcar.models.collision_obj import CollisionObj +from psa_connectedcar.models.collision_obj_front import CollisionObjFront +from psa_connectedcar.models.collisions import Collisions +from psa_connectedcar.models.collisions_embedded import CollisionsEmbedded +from psa_connectedcar.models.created_at_field import CreatedAtField +from psa_connectedcar.models.data_monitor_trigger import DataMonitorTrigger +from psa_connectedcar.models.data_trigger import DataTrigger +from psa_connectedcar.models.default_alert_push import DefaultAlertPush +from psa_connectedcar.models.default_alert_push_attributes import DefaultAlertPushAttributes +from psa_connectedcar.models.doors_state import DoorsState +from psa_connectedcar.models.doors_state_opening import DoorsStateOpening +from psa_connectedcar.models.e_coaching import ECoaching +from psa_connectedcar.models.e_coaching_links import ECoachingLinks +from psa_connectedcar.models.e_coaching_scores import ECoachingScores +from psa_connectedcar.models.energy import Energy +from psa_connectedcar.models.engine import Engine +from psa_connectedcar.models.engine_oil import EngineOil +from psa_connectedcar.models.environment import Environment +from psa_connectedcar.models.environment_luminosity import EnvironmentLuminosity +from psa_connectedcar.models.event import Event +from psa_connectedcar.models.event_links import EventLinks +from psa_connectedcar.models.extension import Extension +from psa_connectedcar.models.extension_type import ExtensionType +from psa_connectedcar.models.geometry import Geometry +from psa_connectedcar.models.ignition import Ignition +from psa_connectedcar.models.index_range import IndexRange +from psa_connectedcar.models.kinetic import Kinetic +from psa_connectedcar.models.lighting import Lighting +from psa_connectedcar.models.link import Link +from psa_connectedcar.models.maintenance import Maintenance +from psa_connectedcar.models.maintenance_links import MaintenanceLinks +from psa_connectedcar.models.maintenance_obj import MaintenanceObj +from psa_connectedcar.models.monitor import Monitor +from psa_connectedcar.models.monitor_id import MonitorId +from psa_connectedcar.models.monitor_links import MonitorLinks +from psa_connectedcar.models.monitor_parameter import MonitorParameter +from psa_connectedcar.models.monitor_parameter_trigger_param import MonitorParameterTriggerParam +from psa_connectedcar.models.monitor_ref import MonitorRef +from psa_connectedcar.models.monitor_ref_links import MonitorRefLinks +from psa_connectedcar.models.monitor_status import MonitorStatus +from psa_connectedcar.models.monitor_status_setter import MonitorStatusSetter +from psa_connectedcar.models.monitor_subscribe import MonitorSubscribe +from psa_connectedcar.models.monitor_subscribe_batch_notify import MonitorSubscribeBatchNotify +from psa_connectedcar.models.monitor_subscribe_retry_policy import MonitorSubscribeRetryPolicy +from psa_connectedcar.models.monitor_trigger import MonitorTrigger +from psa_connectedcar.models.monitor_webhook import MonitorWebhook +from psa_connectedcar.models.monitor_webhook_attributes import MonitorWebhookAttributes +from psa_connectedcar.models.monitors import Monitors +from psa_connectedcar.models.monitors_embedded import MonitorsEmbedded +from psa_connectedcar.models.overall_autonomy import OverallAutonomy +from psa_connectedcar.models.point import Point +from psa_connectedcar.models.polygon_zone import PolygonZone +from psa_connectedcar.models.position import Position +from psa_connectedcar.models.position_properties import PositionProperties +from psa_connectedcar.models.preconditioning import Preconditioning +from psa_connectedcar.models.preconditioning_air_conditioning import PreconditioningAirConditioning +from psa_connectedcar.models.preconditioning_program import PreconditioningProgram +from psa_connectedcar.models.privacy import Privacy +from psa_connectedcar.models.program import Program +from psa_connectedcar.models.program_occurence import ProgramOccurence +from psa_connectedcar.models.safety import Safety +from psa_connectedcar.models.service_type import ServiceType +from psa_connectedcar.models.status import Status +from psa_connectedcar.models.status_embedded import StatusEmbedded +from psa_connectedcar.models.status_extension_type import StatusExtensionType +from psa_connectedcar.models.status_links import StatusLinks +from psa_connectedcar.models.tab_links import TabLinks +from psa_connectedcar.models.telemetry import Telemetry +from psa_connectedcar.models.telemetry_embedded import TelemetryEmbedded +from psa_connectedcar.models.telemetry_enum import TelemetryEnum +from psa_connectedcar.models.telemetry_extension import TelemetryExtension +from psa_connectedcar.models.telemetry_extension_type import TelemetryExtensionType +from psa_connectedcar.models.telemetry_message import TelemetryMessage +from psa_connectedcar.models.telemetry_message_embedded import TelemetryMessageEmbedded +from psa_connectedcar.models.telemetry_message_vehicle import TelemetryMessageVehicle +from psa_connectedcar.models.telemetry_message_vehicle_braking_system import TelemetryMessageVehicleBrakingSystem +from psa_connectedcar.models.telemetry_message_vehicle_transmission import TelemetryMessageVehicleTransmission +from psa_connectedcar.models.telemetry_message_vehicle_transmission_gearbox import TelemetryMessageVehicleTransmissionGearbox +from psa_connectedcar.models.telemetry_message_vehicle_transmission_gearbox_gear import TelemetryMessageVehicleTransmissionGearboxGear +from psa_connectedcar.models.telemetry_message_vehicle_transmission_gearbox_mode import TelemetryMessageVehicleTransmissionGearboxMode +from psa_connectedcar.models.time_monitor_trigger import TimeMonitorTrigger +from psa_connectedcar.models.time_range import TimeRange +from psa_connectedcar.models.time_stamped import TimeStamped +from psa_connectedcar.models.time_trigger import TimeTrigger +from psa_connectedcar.models.time_zone_monitor_trigger import TimeZoneMonitorTrigger +from psa_connectedcar.models.time_zone_trigger import TimeZoneTrigger +from psa_connectedcar.models.trip import Trip +from psa_connectedcar.models.trip_avg_consumption import TripAvgConsumption +from psa_connectedcar.models.trip_links import TripLinks +from psa_connectedcar.models.trips import Trips +from psa_connectedcar.models.trips_embedded import TripsEmbedded +from psa_connectedcar.models.updated_field import UpdatedField +from psa_connectedcar.models.url import Url +from psa_connectedcar.models.user import User +from psa_connectedcar.models.user_embedded import UserEmbedded +from psa_connectedcar.models.user_links import UserLinks +from psa_connectedcar.models.vect2_d import Vect2D +from psa_connectedcar.models.vehicle import Vehicle +from psa_connectedcar.models.vehicle_engine import VehicleEngine +from psa_connectedcar.models.vehicle_links import VehicleLinks +from psa_connectedcar.models.vehicle_odometer import VehicleOdometer +from psa_connectedcar.models.vehicles import Vehicles +from psa_connectedcar.models.vehicles_embedded import VehiclesEmbedded +from psa_connectedcar.models.way_points import WayPoints +from psa_connectedcar.models.way_points_embedded import WayPointsEmbedded +from psa_connectedcar.models.x_error import XError +from psa_connectedcar.models.zone_monitor_trigger import ZoneMonitorTrigger +from psa_connectedcar.models.zone_trigger import ZoneTrigger +from psa_connectedcar.models.zone_trigger_place import ZoneTriggerPlace +from psa_connectedcar.models.zone_trigger_place_center import ZoneTriggerPlaceCenter diff --git a/psa_connectedcar/models/adas.py b/psa_connectedcar/models/adas.py new file mode 100644 index 0000000..64996da --- /dev/null +++ b/psa_connectedcar/models/adas.py @@ -0,0 +1,523 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Adas(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'abs': 'bool', + 'accr': 'str', + 'aebs': 'str', + 'afil': 'str', + 'artiv': 'str', + 'bsm': 'str', + 'esp': 'bool', + 'fse': 'bool', + 'lrka': 'str', + 'lvv': 'bool', + 'park_assist': 'AdasParkAssist', + 'rlka': 'str', + 'rvv': 'str', + 'sli': 'int' + } + + attribute_map = { + 'abs': 'abs', + 'accr': 'accr', + 'aebs': 'aebs', + 'afil': 'afil', + 'artiv': 'artiv', + 'bsm': 'bsm', + 'esp': 'esp', + 'fse': 'fse', + 'lrka': 'lrka', + 'lvv': 'lvv', + 'park_assist': 'parkAssist', + 'rlka': 'rlka', + 'rvv': 'rvv', + 'sli': 'sli' + } + + def __init__(self, abs=None, accr=None, aebs=None, afil=None, artiv='unavailable', bsm=None, esp=None, fse=None, lrka=None, lvv=None, park_assist=None, rlka=None, rvv=None, sli=None): # noqa: E501 + """Adas - a model defined in Swagger""" # noqa: E501 + + self._abs = None + self._accr = None + self._aebs = None + self._afil = None + self._artiv = None + self._bsm = None + self._esp = None + self._fse = None + self._lrka = None + self._lvv = None + self._park_assist = None + self._rlka = None + self._rvv = None + self._sli = None + self.discriminator = None + + if abs is not None: + self.abs = abs + if accr is not None: + self.accr = accr + if aebs is not None: + self.aebs = aebs + if afil is not None: + self.afil = afil + if artiv is not None: + self.artiv = artiv + if bsm is not None: + self.bsm = bsm + if esp is not None: + self.esp = esp + if fse is not None: + self.fse = fse + if lrka is not None: + self.lrka = lrka + if lvv is not None: + self.lvv = lvv + if park_assist is not None: + self.park_assist = park_assist + if rlka is not None: + self.rlka = rlka + if rvv is not None: + self.rvv = rvv + if sli is not None: + self.sli = sli + + @property + def abs(self): + """Gets the abs of this Adas. # noqa: E501 + + Anti-lock braking system # noqa: E501 + + :return: The abs of this Adas. # noqa: E501 + :rtype: bool + """ + return self._abs + + @abs.setter + def abs(self, abs): + """Sets the abs of this Adas. + + Anti-lock braking system # noqa: E501 + + :param abs: The abs of this Adas. # noqa: E501 + :type: bool + """ + + self._abs = abs + + @property + def accr(self): + """Gets the accr of this Adas. # noqa: E501 + + Adaptive Cruise Control Regulation # noqa: E501 + + :return: The accr of this Adas. # noqa: E501 + :rtype: str + """ + return self._accr + + @accr.setter + def accr(self, accr): + """Sets the accr of this Adas. + + Adaptive Cruise Control Regulation # noqa: E501 + + :param accr: The accr of this Adas. # noqa: E501 + :type: str + """ + allowed_values = ["Activated", "Fault", "Hold", "HoldWithOverSpeeding", "Off"] # noqa: E501 + if accr not in allowed_values: + raise ValueError( + "Invalid value for `accr` ({0}), must be one of {1}" # noqa: E501 + .format(accr, allowed_values) + ) + + self._accr = accr + + @property + def aebs(self): + """Gets the aebs of this Adas. # noqa: E501 + + Advanced Emergency Braking System # noqa: E501 + + :return: The aebs of this Adas. # noqa: E501 + :rtype: str + """ + return self._aebs + + @aebs.setter + def aebs(self, aebs): + """Sets the aebs of this Adas. + + Advanced Emergency Braking System # noqa: E501 + + :param aebs: The aebs of this Adas. # noqa: E501 + :type: str + """ + allowed_values = ["off", "Fixed", "OnFlashing"] # noqa: E501 + if aebs not in allowed_values: + raise ValueError( + "Invalid value for `aebs` ({0}), must be one of {1}" # noqa: E501 + .format(aebs, allowed_values) + ) + + self._aebs = aebs + + @property + def afil(self): + """Gets the afil of this Adas. # noqa: E501 + + Lane Departure Warning System # noqa: E501 + + :return: The afil of this Adas. # noqa: E501 + :rtype: str + """ + return self._afil + + @afil.setter + def afil(self, afil): + """Sets the afil of this Adas. + + Lane Departure Warning System # noqa: E501 + + :param afil: The afil of this Adas. # noqa: E501 + :type: str + """ + allowed_values = ["FlashingFault", "FlashingWarning", "Off", "OnFixed"] # noqa: E501 + if afil not in allowed_values: + raise ValueError( + "Invalid value for `afil` ({0}), must be one of {1}" # noqa: E501 + .format(afil, allowed_values) + ) + + self._afil = afil + + @property + def artiv(self): + """Gets the artiv of this Adas. # noqa: E501 + + Respect of inter vehicle time assist (ARTIV) # noqa: E501 + + :return: The artiv of this Adas. # noqa: E501 + :rtype: str + """ + return self._artiv + + @artiv.setter + def artiv(self, artiv): + """Sets the artiv of this Adas. + + Respect of inter vehicle time assist (ARTIV) # noqa: E501 + + :param artiv: The artiv of this Adas. # noqa: E501 + :type: str + """ + allowed_values = ["NotSelected", "Selected", "Unavailable"] # noqa: E501 + if artiv not in allowed_values: + raise ValueError( + "Invalid value for `artiv` ({0}), must be one of {1}" # noqa: E501 + .format(artiv, allowed_values) + ) + + self._artiv = artiv + + @property + def bsm(self): + """Gets the bsm of this Adas. # noqa: E501 + + Blink SpotMonitoring # noqa: E501 + + :return: The bsm of this Adas. # noqa: E501 + :rtype: str + """ + return self._bsm + + @bsm.setter + def bsm(self, bsm): + """Sets the bsm of this Adas. + + Blink SpotMonitoring # noqa: E501 + + :param bsm: The bsm of this Adas. # noqa: E501 + :type: str + """ + allowed_values = ["Active", "Inactive", "Disabled"] # noqa: E501 + if bsm not in allowed_values: + raise ValueError( + "Invalid value for `bsm` ({0}), must be one of {1}" # noqa: E501 + .format(bsm, allowed_values) + ) + + self._bsm = bsm + + @property + def esp(self): + """Gets the esp of this Adas. # noqa: E501 + + Electronic Stability Programme # noqa: E501 + + :return: The esp of this Adas. # noqa: E501 + :rtype: bool + """ + return self._esp + + @esp.setter + def esp(self, esp): + """Sets the esp of this Adas. + + Electronic Stability Programme # noqa: E501 + + :param esp: The esp of this Adas. # noqa: E501 + :type: bool + """ + + self._esp = esp + + @property + def fse(self): + """Gets the fse of this Adas. # noqa: E501 + + Electric brake service # noqa: E501 + + :return: The fse of this Adas. # noqa: E501 + :rtype: bool + """ + return self._fse + + @fse.setter + def fse(self, fse): + """Sets the fse of this Adas. + + Electric brake service # noqa: E501 + + :param fse: The fse of this Adas. # noqa: E501 + :type: bool + """ + + self._fse = fse + + @property + def lrka(self): + """Gets the lrka of this Adas. # noqa: E501 + + Lane Keeping Assist left # noqa: E501 + + :return: The lrka of this Adas. # noqa: E501 + :rtype: str + """ + return self._lrka + + @lrka.setter + def lrka(self, lrka): + """Sets the lrka of this Adas. + + Lane Keeping Assist left # noqa: E501 + + :param lrka: The lrka of this Adas. # noqa: E501 + :type: str + """ + allowed_values = ["Authorized", "CorrectionInProgress", "NotAuthorized", "NotSelected"] # noqa: E501 + if lrka not in allowed_values: + raise ValueError( + "Invalid value for `lrka` ({0}), must be one of {1}" # noqa: E501 + .format(lrka, allowed_values) + ) + + self._lrka = lrka + + @property + def lvv(self): + """Gets the lvv of this Adas. # noqa: E501 + + + :return: The lvv of this Adas. # noqa: E501 + :rtype: bool + """ + return self._lvv + + @lvv.setter + def lvv(self, lvv): + """Sets the lvv of this Adas. + + + :param lvv: The lvv of this Adas. # noqa: E501 + :type: bool + """ + + self._lvv = lvv + + @property + def park_assist(self): + """Gets the park_assist of this Adas. # noqa: E501 + + + :return: The park_assist of this Adas. # noqa: E501 + :rtype: AdasParkAssist + """ + return self._park_assist + + @park_assist.setter + def park_assist(self, park_assist): + """Sets the park_assist of this Adas. + + + :param park_assist: The park_assist of this Adas. # noqa: E501 + :type: AdasParkAssist + """ + + self._park_assist = park_assist + + @property + def rlka(self): + """Gets the rlka of this Adas. # noqa: E501 + + Lane Keeping Assist right # noqa: E501 + + :return: The rlka of this Adas. # noqa: E501 + :rtype: str + """ + return self._rlka + + @rlka.setter + def rlka(self, rlka): + """Sets the rlka of this Adas. + + Lane Keeping Assist right # noqa: E501 + + :param rlka: The rlka of this Adas. # noqa: E501 + :type: str + """ + allowed_values = ["Authorized", "CorrectionInProgress", "NotAuthorized", "NotSelected"] # noqa: E501 + if rlka not in allowed_values: + raise ValueError( + "Invalid value for `rlka` ({0}), must be one of {1}" # noqa: E501 + .format(rlka, allowed_values) + ) + + self._rlka = rlka + + @property + def rvv(self): + """Gets the rvv of this Adas. # noqa: E501 + + + :return: The rvv of this Adas. # noqa: E501 + :rtype: str + """ + return self._rvv + + @rvv.setter + def rvv(self, rvv): + """Sets the rvv of this Adas. + + + :param rvv: The rvv of this Adas. # noqa: E501 + :type: str + """ + allowed_values = ["off", "Inactive", "Active", "SpeedExceeded", "Disabled", "DisabledBySystem", "MaxSpeedExceed", "SpeedDeltaExceed", "ReducedVisibility", "Learning"] # noqa: E501 + if rvv not in allowed_values: + raise ValueError( + "Invalid value for `rvv` ({0}), must be one of {1}" # noqa: E501 + .format(rvv, allowed_values) + ) + + self._rvv = rvv + + @property + def sli(self): + """Gets the sli of this Adas. # noqa: E501 + + Speed Limit Information # noqa: E501 + + :return: The sli of this Adas. # noqa: E501 + :rtype: int + """ + return self._sli + + @sli.setter + def sli(self, sli): + """Sets the sli of this Adas. + + Speed Limit Information # noqa: E501 + + :param sli: The sli of this Adas. # noqa: E501 + :type: int + """ + + self._sli = sli + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Adas, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Adas): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/adas_park_assist.py b/psa_connectedcar/models/adas_park_assist.py new file mode 100644 index 0000000..96bbb2b --- /dev/null +++ b/psa_connectedcar/models/adas_park_assist.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AdasParkAssist(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'front': 'list[str]', + 'rear': 'list[str]' + } + + attribute_map = { + 'front': 'front', + 'rear': 'rear' + } + + def __init__(self, front=None, rear=None): # noqa: E501 + """AdasParkAssist - a model defined in Swagger""" # noqa: E501 + + self._front = None + self._rear = None + self.discriminator = None + + if front is not None: + self.front = front + if rear is not None: + self.rear = rear + + @property + def front(self): + """Gets the front of this AdasParkAssist. # noqa: E501 + + + :return: The front of this AdasParkAssist. # noqa: E501 + :rtype: list[str] + """ + return self._front + + @front.setter + def front(self, front): + """Sets the front of this AdasParkAssist. + + + :param front: The front of this AdasParkAssist. # noqa: E501 + :type: list[str] + """ + allowed_values = ["Fault", "DriverInhibition", "Active", "Wait", "OutOfService"] # noqa: E501 + if not set(front).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `front` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(front) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._front = front + + @property + def rear(self): + """Gets the rear of this AdasParkAssist. # noqa: E501 + + + :return: The rear of this AdasParkAssist. # noqa: E501 + :rtype: list[str] + """ + return self._rear + + @rear.setter + def rear(self, rear): + """Sets the rear of this AdasParkAssist. + + + :param rear: The rear of this AdasParkAssist. # noqa: E501 + :type: list[str] + """ + allowed_values = ["Fault", "DriverInhibition", "Active", "Wait", "OutOfService"] # noqa: E501 + if not set(rear).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `rear` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(rear) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._rear = rear + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AdasParkAssist, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AdasParkAssist): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/alert.py b/psa_connectedcar/models/alert.py new file mode 100644 index 0000000..5f5cab8 --- /dev/null +++ b/psa_connectedcar/models/alert.py @@ -0,0 +1,327 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Alert(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime', + 'links': 'AlertLinks', + 'active': 'bool', + 'end_at': 'datetime', + 'end_position': 'AlertEndPosition', + 'id': 'str', + 'start_position': 'AlertEndPosition', + 'started_at': 'datetime', + 'type': 'AlertMsgEnum' + } + + attribute_map = { + 'created_at': 'createdAt', + 'links': '_links', + 'active': 'active', + 'end_at': 'endAt', + 'end_position': 'endPosition:', + 'id': 'id', + 'start_position': 'startPosition', + 'started_at': 'startedAt', + 'type': 'type' + } + + def __init__(self, created_at=None, links=None, active=None, end_at=None, end_position=None, id=None, start_position=None, started_at=None, type=None): # noqa: E501 + """Alert - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self._links = None + self._active = None + self._end_at = None + self._end_position = None + self._id = None + self._start_position = None + self._started_at = None + self._type = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if links is not None: + self.links = links + if active is not None: + self.active = active + if end_at is not None: + self.end_at = end_at + if end_position is not None: + self.end_position = end_position + if id is not None: + self.id = id + if start_position is not None: + self.start_position = start_position + if started_at is not None: + self.started_at = started_at + if type is not None: + self.type = type + + @property + def created_at(self): + """Gets the created_at of this Alert. # noqa: E501 + + Date when the resource has been created. # noqa: E501 + + :return: The created_at of this Alert. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this Alert. + + Date when the resource has been created. # noqa: E501 + + :param created_at: The created_at of this Alert. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def links(self): + """Gets the links of this Alert. # noqa: E501 + + + :return: The links of this Alert. # noqa: E501 + :rtype: AlertLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Alert. + + + :param links: The links of this Alert. # noqa: E501 + :type: AlertLinks + """ + + self._links = links + + @property + def active(self): + """Gets the active of this Alert. # noqa: E501 + + + :return: The active of this Alert. # noqa: E501 + :rtype: bool + """ + return self._active + + @active.setter + def active(self, active): + """Sets the active of this Alert. + + + :param active: The active of this Alert. # noqa: E501 + :type: bool + """ + + self._active = active + + @property + def end_at(self): + """Gets the end_at of this Alert. # noqa: E501 + + + :return: The end_at of this Alert. # noqa: E501 + :rtype: datetime + """ + return self._end_at + + @end_at.setter + def end_at(self, end_at): + """Sets the end_at of this Alert. + + + :param end_at: The end_at of this Alert. # noqa: E501 + :type: datetime + """ + + self._end_at = end_at + + @property + def end_position(self): + """Gets the end_position of this Alert. # noqa: E501 + + + :return: The end_position of this Alert. # noqa: E501 + :rtype: AlertEndPosition + """ + return self._end_position + + @end_position.setter + def end_position(self, end_position): + """Sets the end_position of this Alert. + + + :param end_position: The end_position of this Alert. # noqa: E501 + :type: AlertEndPosition + """ + + self._end_position = end_position + + @property + def id(self): + """Gets the id of this Alert. # noqa: E501 + + + :return: The id of this Alert. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Alert. + + + :param id: The id of this Alert. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def start_position(self): + """Gets the start_position of this Alert. # noqa: E501 + + + :return: The start_position of this Alert. # noqa: E501 + :rtype: AlertEndPosition + """ + return self._start_position + + @start_position.setter + def start_position(self, start_position): + """Sets the start_position of this Alert. + + + :param start_position: The start_position of this Alert. # noqa: E501 + :type: AlertEndPosition + """ + + self._start_position = start_position + + @property + def started_at(self): + """Gets the started_at of this Alert. # noqa: E501 + + Date # noqa: E501 + + :return: The started_at of this Alert. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this Alert. + + Date # noqa: E501 + + :param started_at: The started_at of this Alert. # noqa: E501 + :type: datetime + """ + + self._started_at = started_at + + @property + def type(self): + """Gets the type of this Alert. # noqa: E501 + + + :return: The type of this Alert. # noqa: E501 + :rtype: AlertMsgEnum + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Alert. + + + :param type: The type of this Alert. # noqa: E501 + :type: AlertMsgEnum + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Alert, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Alert): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/alert_end_position.py b/psa_connectedcar/models/alert_end_position.py new file mode 100644 index 0000000..8a08024 --- /dev/null +++ b/psa_connectedcar/models/alert_end_position.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AlertEndPosition(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AlertEndPosition - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AlertEndPosition, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AlertEndPosition): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/alert_links.py b/psa_connectedcar/models/alert_links.py new file mode 100644 index 0000000..fec84f2 --- /dev/null +++ b/psa_connectedcar/models/alert_links.py @@ -0,0 +1,193 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AlertLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'position': 'Link', + '_self': 'Link', + 'trip': 'Link', + 'vehicle': 'Link' + } + + attribute_map = { + 'position': 'position', + '_self': 'self', + 'trip': 'trip', + 'vehicle': 'vehicle' + } + + def __init__(self, position=None, _self=None, trip=None, vehicle=None): # noqa: E501 + """AlertLinks - a model defined in Swagger""" # noqa: E501 + + self._position = None + self.__self = None + self._trip = None + self._vehicle = None + self.discriminator = None + + if position is not None: + self.position = position + if _self is not None: + self._self = _self + if trip is not None: + self.trip = trip + if vehicle is not None: + self.vehicle = vehicle + + @property + def position(self): + """Gets the position of this AlertLinks. # noqa: E501 + + + :return: The position of this AlertLinks. # noqa: E501 + :rtype: Link + """ + return self._position + + @position.setter + def position(self, position): + """Sets the position of this AlertLinks. + + + :param position: The position of this AlertLinks. # noqa: E501 + :type: Link + """ + + self._position = position + + @property + def _self(self): + """Gets the _self of this AlertLinks. # noqa: E501 + + + :return: The _self of this AlertLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this AlertLinks. + + + :param _self: The _self of this AlertLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + @property + def trip(self): + """Gets the trip of this AlertLinks. # noqa: E501 + + + :return: The trip of this AlertLinks. # noqa: E501 + :rtype: Link + """ + return self._trip + + @trip.setter + def trip(self, trip): + """Sets the trip of this AlertLinks. + + + :param trip: The trip of this AlertLinks. # noqa: E501 + :type: Link + """ + + self._trip = trip + + @property + def vehicle(self): + """Gets the vehicle of this AlertLinks. # noqa: E501 + + + :return: The vehicle of this AlertLinks. # noqa: E501 + :rtype: Link + """ + return self._vehicle + + @vehicle.setter + def vehicle(self, vehicle): + """Sets the vehicle of this AlertLinks. + + + :param vehicle: The vehicle of this AlertLinks. # noqa: E501 + :type: Link + """ + + self._vehicle = vehicle + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AlertLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AlertLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/alert_msg_enum.py b/psa_connectedcar/models/alert_msg_enum.py new file mode 100644 index 0000000..e09b564 --- /dev/null +++ b/psa_connectedcar/models/alert_msg_enum.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AlertMsgEnum(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ALERTOILPRESSURE = "alertOilPressure" + ALERTCOOLANTTEMP = "alertCoolantTemp" + CHARGINGSYSTEMFAULT = "chargingSystemFault" + ALERTBRAKEFLUID = "alertBrakeFluid" + STEERINGFAULT = "steeringFault" + ALERTCOOLANTLEVEL = "alertCoolantLevel" + LANEDEPARTUREWARNINGSYSTEMFAULT = "laneDepartureWarningSystemFault" + FRONTLEFTDOOROPENHIGHSPEED = "frontLeftDoorOpenHighSpeed" + FRONTRIGHTDOOROPENHIGHSPEED = "frontRightDoorOpenHighSpeed" + REARLEFTDOOROPENHIGHSPEED = "rearLeftDoorOpenHighSpeed" + REARRIGHTDOOROPENHIGHSPEED = "rearRightDoorOpenHighSpeed" + TRUNKOPENHIGHSPEED = "trunkOpenHighSpeed" + TRUNKWINDOWOPEN = "trunkWindowOpen" + ESPFAULT = "espFault" + BATTERYLEVELFAULT = "batteryLevelFault" + WATERINGASOIL = "waterInGasoil" + PADWEARFAULT = "padWearFault" + FUELLEVELALARM = "fuelLevelAlarm" + AIRBAGORSEATBELTFAULT = "airbagOrSeatbeltFault" + ENGINEFAULT = "engineFault" + ABSFAULT = "absFault" + RISKOFPARTICLEFILTERBLOCKAGE = "riskOfParticleFilterBlockage" + PARTICLEFILTERADDITIVETOOLOW = "particleFilterAdditiveTooLow" + SUSPENSIONFAULT = "suspensionFault" + PREAHEATINGDEACTIVATEDBATTERYTOOLOW = "preaheatingDeactivatedBatteryTooLow" + PREAHEATINGDEACTIVATEDFUELLEVELTOOLOW = "preaheatingDeactivatedFuelLevelTooLow" + CHECKTHEBRAKELAMP = "checkTheBrakeLamp" + RETRACTABLEROOFMECHANISMFAULT = "retractableRoofMechanismFault" + ALERTSTEERINGLOCK = "alertSteeringLock" + ELECTRONICIMMOBILISERFAULT = "electronicImmobiliserFault" + ROOFOPERATIONIMPOSSIBLETEMPERATURETOOHIGH = "roofOperationImpossibleTemperatureTooHigh" + ROOFOPERATIONIMPOSSIBLESTARTENGINE = "roofOperationImpossibleStartEngine" + ROOFOPERATIONIMPOSSIBLEAPPLYPARKINGBREAK = "roofOperationImpossibleApplyParkingBreak" + HYBRIDSYSTEMFAULT = "hybridSystemFault" + AUTOMATICHEADLAMPFAULT = "automaticHeadlampFault" + HYBRIDSYSTEMFAULTREPAIREDTHEVEHICLE = "hybridSystemFaultRepairedTheVehicle" + WASHERLEVELALARM = "washerLevelAlarm" + BATTERYKEYALARM = "batteryKeyAlarm" + PREAHEATINGDEACTIVATEDSETTHECLOCK = "preaheatingDeactivatedSetTheClock" + TRAILERCONNECTIONFAULT = "trailerConnectionFault" + UNDERINFLATIONTYREFAULT = "underInflationTyreFault" + LIMITEDVISIBILITYAIDSCAMERA = "limitedVisibilityAidsCamera" + ELECTRICMODENOTAVAILABLE = "electricModeNotAvailable" + WHEELPRESSUREFAULT = "wheelPressureFault" + CHECKSIDELAMPS = "checkSideLamps" + CHECKRIGHTBRAKELAMP = "checkRightBrakeLamp" + CHECKLEFTBRAKELAMP = "checkLeftBrakeLamp" + FRONTFOGLIGHTFAULT = "frontFoglightFault" + REARFOGLIGHTFAULT = "rearFoglightFault" + CHECKDIRECTIONINDICATOR = "checkDirectionIndicator" + CHECKREVERSINGLAMP = "checkReversingLamp" + PARKINGASSISTANCEFAULT = "parkingAssistanceFault" + ADJUSTTYREPRESSURE = "adjustTyrePressure" + ANTIPOLLUTIONFAULT = "antipollutionFault" + PLACEGEARBOXTOP = "placeGearBoxToP" + RISKOFICE = "riskOfIce" + FRONTRIGHTDOOROPEN = "frontRightDoorOpen" + FRONTLEFTDOOROPEN = "frontLeftDoorOpen" + REARRIGHTDOOROPEN = "rearRightDoorOpen" + REARLEFTDOOROPEN = "rearLeftDoorOpen" + TRUNKOPEN = "trunkOpen" + BOOTOPEN = "bootOpen" + REARSCREENOPEN = "rearScreenOpen" + PARKINGBREAKFAULT = "parkingBreakFault" + ACTIVESPOILERFAULT = "activeSpoilerFault" + AUTOMATICBREAKINGSYSTEMFAULT = "automaticBreakingSystemFault" + DIRECTIONALHEADLAMPSFAULT = "directionalHeadlampsFault" + AUTOMATICGEARBOXFAULT = "automaticGearboxFault" + ENGINEFAULT_2 = "engineFault" + SUSPENSIONFAULTLIMITTO90KM = "suspensionFaultLimitTo90km" + FRONTLEFTTYRENOTMONITORED = "frontLeftTyreNotMonitored" + FRONTRIGHTTYRENOTMONITORED = "frontRightTyreNotMonitored" + REARRIGHTTYRENOTMONITORED = "rearRightTyreNotMonitored" + REARLEFTTYRENOTMONITORED = "rearLeftTyreNotMonitored" + SUSPENSIONFAULT_2 = "suspensionFault" + SUSPENSIONFAULT_3 = "suspensionFault" + POWERSTEERINGFAULT = "powerSteeringFault" + ENGINEFAULT_3 = "engineFault" + LANEDEPARTUREFAULT = "laneDepartureFault" + TYREUNDERINFLATION = "tyreUnderInflation" + SPAREWHEELFITTEDDRIVINGAIDSDEACTIVATED = "spareWheelFittedDrivingAidsDeactivated" + AUTOMATICBREAKINGDEACTIVED = "automaticBreakingDeactived" + TUPUPADBLUE = "tupUpAdBlue" + LONGPUSHTOUNLOCKTANKFAULT = "longPushToUnlockTankFault" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """AlertMsgEnum - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AlertMsgEnum, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AlertMsgEnum): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/alerts.py b/psa_connectedcar/models/alerts.py new file mode 100644 index 0000000..afe3a80 --- /dev/null +++ b/psa_connectedcar/models/alerts.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Alerts(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'AlertsEmbedded' + } + + attribute_map = { + 'embedded': '_embedded' + } + + def __init__(self, embedded=None): # noqa: E501 + """Alerts - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + + @property + def embedded(self): + """Gets the embedded of this Alerts. # noqa: E501 + + + :return: The embedded of this Alerts. # noqa: E501 + :rtype: AlertsEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Alerts. + + + :param embedded: The embedded of this Alerts. # noqa: E501 + :type: AlertsEmbedded + """ + + self._embedded = embedded + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Alerts, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Alerts): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/alerts_embedded.py b/psa_connectedcar/models/alerts_embedded.py new file mode 100644 index 0000000..77f55c4 --- /dev/null +++ b/psa_connectedcar/models/alerts_embedded.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class AlertsEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'alerts': 'list[Alert]' + } + + attribute_map = { + 'alerts': 'alerts' + } + + def __init__(self, alerts=None): # noqa: E501 + """AlertsEmbedded - a model defined in Swagger""" # noqa: E501 + + self._alerts = None + self.discriminator = None + + if alerts is not None: + self.alerts = alerts + + @property + def alerts(self): + """Gets the alerts of this AlertsEmbedded. # noqa: E501 + + + :return: The alerts of this AlertsEmbedded. # noqa: E501 + :rtype: list[Alert] + """ + return self._alerts + + @alerts.setter + def alerts(self, alerts): + """Sets the alerts of this AlertsEmbedded. + + + :param alerts: The alerts of this AlertsEmbedded. # noqa: E501 + :type: list[Alert] + """ + + self._alerts = alerts + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(AlertsEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, AlertsEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/battery.py b/psa_connectedcar/models/battery.py new file mode 100644 index 0000000..cd6524d --- /dev/null +++ b/psa_connectedcar/models/battery.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Battery(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'current': 'float', + 'voltage': 'float' + } + + attribute_map = { + 'current': 'current', + 'voltage': 'voltage' + } + + def __init__(self, current=None, voltage=None): # noqa: E501 + """Battery - a model defined in Swagger""" # noqa: E501 + + self._current = None + self._voltage = None + self.discriminator = None + + if current is not None: + self.current = current + if voltage is not None: + self.voltage = voltage + + @property + def current(self): + """Gets the current of this Battery. # noqa: E501 + + + :return: The current of this Battery. # noqa: E501 + :rtype: float + """ + return self._current + + @current.setter + def current(self, current): + """Sets the current of this Battery. + + + :param current: The current of this Battery. # noqa: E501 + :type: float + """ + + self._current = current + + @property + def voltage(self): + """Gets the voltage of this Battery. # noqa: E501 + + + :return: The voltage of this Battery. # noqa: E501 + :rtype: float + """ + return self._voltage + + @voltage.setter + def voltage(self, voltage): + """Sets the voltage of this Battery. + + + :param voltage: The voltage of this Battery. # noqa: E501 + :type: float + """ + + self._voltage = voltage + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Battery, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Battery): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/bounded_program.py b/psa_connectedcar/models/bounded_program.py new file mode 100644 index 0000000..3315976 --- /dev/null +++ b/psa_connectedcar/models/bounded_program.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class BoundedProgram(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'duration': 'str' + } + + attribute_map = { + 'duration': 'duration' + } + + def __init__(self, duration=None): # noqa: E501 + """BoundedProgram - a model defined in Swagger""" # noqa: E501 + + self._duration = None + self.discriminator = None + + self.duration = duration + + @property + def duration(self): + """Gets the duration of this BoundedProgram. # noqa: E501 + + Duration of the monitor action expressed using [ISO-8601 Duration spec](https://en.wikipedia.org/wiki/ISO_8601#Durations) # noqa: E501 + + :return: The duration of this BoundedProgram. # noqa: E501 + :rtype: str + """ + return self._duration + + @duration.setter + def duration(self, duration): + """Sets the duration of this BoundedProgram. + + Duration of the monitor action expressed using [ISO-8601 Duration spec](https://en.wikipedia.org/wiki/ISO_8601#Durations) # noqa: E501 + + :param duration: The duration of this BoundedProgram. # noqa: E501 + :type: str + """ + if duration is None: + raise ValueError("Invalid value for `duration`, must not be `None`") # noqa: E501 + + self._duration = duration + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(BoundedProgram, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, BoundedProgram): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/charging_status_enum.py b/psa_connectedcar/models/charging_status_enum.py new file mode 100644 index 0000000..b218453 --- /dev/null +++ b/psa_connectedcar/models/charging_status_enum.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ChargingStatusEnum(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + DISCONNECTED = "Disconnected" + INPROGRESS = "InProgress" + FAILURE = "Failure" + STOPPED = "Stopped" + FINISHED = "Finished" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ChargingStatusEnum - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ChargingStatusEnum, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ChargingStatusEnum): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/circle_zone.py b/psa_connectedcar/models/circle_zone.py new file mode 100644 index 0000000..6ba7278 --- /dev/null +++ b/psa_connectedcar/models/circle_zone.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CircleZone(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'coordinates': 'CircleZoneCoordinates', + 'type': 'str' + } + + attribute_map = { + 'coordinates': 'coordinates', + 'type': 'type' + } + + def __init__(self, coordinates=None, type='extCircle'): # noqa: E501 + """CircleZone - a model defined in Swagger""" # noqa: E501 + + self._coordinates = None + self._type = None + self.discriminator = None + + if coordinates is not None: + self.coordinates = coordinates + if type is not None: + self.type = type + + @property + def coordinates(self): + """Gets the coordinates of this CircleZone. # noqa: E501 + + + :return: The coordinates of this CircleZone. # noqa: E501 + :rtype: CircleZoneCoordinates + """ + return self._coordinates + + @coordinates.setter + def coordinates(self, coordinates): + """Sets the coordinates of this CircleZone. + + + :param coordinates: The coordinates of this CircleZone. # noqa: E501 + :type: CircleZoneCoordinates + """ + + self._coordinates = coordinates + + @property + def type(self): + """Gets the type of this CircleZone. # noqa: E501 + + + :return: The type of this CircleZone. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this CircleZone. + + + :param type: The type of this CircleZone. # noqa: E501 + :type: str + """ + allowed_values = ["ExtCircle"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CircleZone, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CircleZone): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/circle_zone_coordinates.py b/psa_connectedcar/models/circle_zone_coordinates.py new file mode 100644 index 0000000..476f7a2 --- /dev/null +++ b/psa_connectedcar/models/circle_zone_coordinates.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CircleZoneCoordinates(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'center': 'Point', + 'radius': 'float' + } + + attribute_map = { + 'center': 'center', + 'radius': 'radius' + } + + def __init__(self, center=None, radius=None): # noqa: E501 + """CircleZoneCoordinates - a model defined in Swagger""" # noqa: E501 + + self._center = None + self._radius = None + self.discriminator = None + + self.center = center + self.radius = radius + + @property + def center(self): + """Gets the center of this CircleZoneCoordinates. # noqa: E501 + + + :return: The center of this CircleZoneCoordinates. # noqa: E501 + :rtype: Point + """ + return self._center + + @center.setter + def center(self, center): + """Sets the center of this CircleZoneCoordinates. + + + :param center: The center of this CircleZoneCoordinates. # noqa: E501 + :type: Point + """ + if center is None: + raise ValueError("Invalid value for `center`, must not be `None`") # noqa: E501 + + self._center = center + + @property + def radius(self): + """Gets the radius of this CircleZoneCoordinates. # noqa: E501 + + + :return: The radius of this CircleZoneCoordinates. # noqa: E501 + :rtype: float + """ + return self._radius + + @radius.setter + def radius(self, radius): + """Sets the radius of this CircleZoneCoordinates. + + + :param radius: The radius of this CircleZoneCoordinates. # noqa: E501 + :type: float + """ + if radius is None: + raise ValueError("Invalid value for `radius`, must not be `None`") # noqa: E501 + + self._radius = radius + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CircleZoneCoordinates, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CircleZoneCoordinates): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/collection_result.py b/psa_connectedcar/models/collection_result.py new file mode 100644 index 0000000..a6331a3 --- /dev/null +++ b/psa_connectedcar/models/collection_result.py @@ -0,0 +1,223 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CollectionResult(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'object', + 'links': 'TabLinks', + 'current_page': 'int', + 'total': 'int', + 'total_page': 'int' + } + + attribute_map = { + 'embedded': '_embedded', + 'links': '_links', + 'current_page': 'currentPage', + 'total': 'total', + 'total_page': 'totalPage' + } + + def __init__(self, embedded=None, links=None, current_page=None, total=None, total_page=None): # noqa: E501 + """CollectionResult - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self._links = None + self._current_page = None + self._total = None + self._total_page = None + self.discriminator = None + + self.embedded = embedded + if links is not None: + self.links = links + self.current_page = current_page + self.total = total + self.total_page = total_page + + @property + def embedded(self): + """Gets the embedded of this CollectionResult. # noqa: E501 + + + :return: The embedded of this CollectionResult. # noqa: E501 + :rtype: object + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this CollectionResult. + + + :param embedded: The embedded of this CollectionResult. # noqa: E501 + :type: object + """ + if embedded is None: + raise ValueError("Invalid value for `embedded`, must not be `None`") # noqa: E501 + + self._embedded = embedded + + @property + def links(self): + """Gets the links of this CollectionResult. # noqa: E501 + + + :return: The links of this CollectionResult. # noqa: E501 + :rtype: TabLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this CollectionResult. + + + :param links: The links of this CollectionResult. # noqa: E501 + :type: TabLinks + """ + + self._links = links + + @property + def current_page(self): + """Gets the current_page of this CollectionResult. # noqa: E501 + + + :return: The current_page of this CollectionResult. # noqa: E501 + :rtype: int + """ + return self._current_page + + @current_page.setter + def current_page(self, current_page): + """Sets the current_page of this CollectionResult. + + + :param current_page: The current_page of this CollectionResult. # noqa: E501 + :type: int + """ + if current_page is None: + raise ValueError("Invalid value for `current_page`, must not be `None`") # noqa: E501 + + self._current_page = current_page + + @property + def total(self): + """Gets the total of this CollectionResult. # noqa: E501 + + + :return: The total of this CollectionResult. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this CollectionResult. + + + :param total: The total of this CollectionResult. # noqa: E501 + :type: int + """ + if total is None: + raise ValueError("Invalid value for `total`, must not be `None`") # noqa: E501 + + self._total = total + + @property + def total_page(self): + """Gets the total_page of this CollectionResult. # noqa: E501 + + + :return: The total_page of this CollectionResult. # noqa: E501 + :rtype: int + """ + return self._total_page + + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this CollectionResult. + + + :param total_page: The total_page of this CollectionResult. # noqa: E501 + :type: int + """ + if total_page is None: + raise ValueError("Invalid value for `total_page`, must not be `None`") # noqa: E501 + + self._total_page = total_page + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CollectionResult, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollectionResult): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/collision.py b/psa_connectedcar/models/collision.py new file mode 100644 index 0000000..151e51a --- /dev/null +++ b/psa_connectedcar/models/collision.py @@ -0,0 +1,349 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Collision(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime', + 'embedded': 'object', + 'front': 'CollisionObjFront', + 'id': 'str', + 'lateral': 'CollisionObjFront', + 'pedestrian': 'bool', + 'rear': 'CollisionObjFront', + 'roll_over': 'bool', + 'updated_at': 'datetime', + 'links': 'CollisionLinks' + } + + attribute_map = { + 'created_at': 'createdAt', + 'embedded': '_embedded', + 'front': 'front', + 'id': 'id', + 'lateral': 'lateral', + 'pedestrian': 'pedestrian', + 'rear': 'rear', + 'roll_over': 'rollOver', + 'updated_at': 'updatedAt', + 'links': '_links' + } + + def __init__(self, created_at=None, embedded=None, front=None, id=None, lateral=None, pedestrian=None, rear=None, roll_over=None, updated_at=None, links=None): # noqa: E501 + """Collision - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self._embedded = None + self._front = None + self._id = None + self._lateral = None + self._pedestrian = None + self._rear = None + self._roll_over = None + self._updated_at = None + self._links = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if embedded is not None: + self.embedded = embedded + if front is not None: + self.front = front + if id is not None: + self.id = id + if lateral is not None: + self.lateral = lateral + if pedestrian is not None: + self.pedestrian = pedestrian + if rear is not None: + self.rear = rear + if roll_over is not None: + self.roll_over = roll_over + if updated_at is not None: + self.updated_at = updated_at + if links is not None: + self.links = links + + @property + def created_at(self): + """Gets the created_at of this Collision. # noqa: E501 + + + :return: The created_at of this Collision. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this Collision. + + + :param created_at: The created_at of this Collision. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def embedded(self): + """Gets the embedded of this Collision. # noqa: E501 + + + :return: The embedded of this Collision. # noqa: E501 + :rtype: object + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Collision. + + + :param embedded: The embedded of this Collision. # noqa: E501 + :type: object + """ + + self._embedded = embedded + + @property + def front(self): + """Gets the front of this Collision. # noqa: E501 + + + :return: The front of this Collision. # noqa: E501 + :rtype: CollisionObjFront + """ + return self._front + + @front.setter + def front(self, front): + """Sets the front of this Collision. + + + :param front: The front of this Collision. # noqa: E501 + :type: CollisionObjFront + """ + + self._front = front + + @property + def id(self): + """Gets the id of this Collision. # noqa: E501 + + + :return: The id of this Collision. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Collision. + + + :param id: The id of this Collision. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def lateral(self): + """Gets the lateral of this Collision. # noqa: E501 + + + :return: The lateral of this Collision. # noqa: E501 + :rtype: CollisionObjFront + """ + return self._lateral + + @lateral.setter + def lateral(self, lateral): + """Sets the lateral of this Collision. + + + :param lateral: The lateral of this Collision. # noqa: E501 + :type: CollisionObjFront + """ + + self._lateral = lateral + + @property + def pedestrian(self): + """Gets the pedestrian of this Collision. # noqa: E501 + + + :return: The pedestrian of this Collision. # noqa: E501 + :rtype: bool + """ + return self._pedestrian + + @pedestrian.setter + def pedestrian(self, pedestrian): + """Sets the pedestrian of this Collision. + + + :param pedestrian: The pedestrian of this Collision. # noqa: E501 + :type: bool + """ + + self._pedestrian = pedestrian + + @property + def rear(self): + """Gets the rear of this Collision. # noqa: E501 + + + :return: The rear of this Collision. # noqa: E501 + :rtype: CollisionObjFront + """ + return self._rear + + @rear.setter + def rear(self, rear): + """Sets the rear of this Collision. + + + :param rear: The rear of this Collision. # noqa: E501 + :type: CollisionObjFront + """ + + self._rear = rear + + @property + def roll_over(self): + """Gets the roll_over of this Collision. # noqa: E501 + + + :return: The roll_over of this Collision. # noqa: E501 + :rtype: bool + """ + return self._roll_over + + @roll_over.setter + def roll_over(self, roll_over): + """Sets the roll_over of this Collision. + + + :param roll_over: The roll_over of this Collision. # noqa: E501 + :type: bool + """ + + self._roll_over = roll_over + + @property + def updated_at(self): + """Gets the updated_at of this Collision. # noqa: E501 + + + :return: The updated_at of this Collision. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this Collision. + + + :param updated_at: The updated_at of this Collision. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + @property + def links(self): + """Gets the links of this Collision. # noqa: E501 + + + :return: The links of this Collision. # noqa: E501 + :rtype: CollisionLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Collision. + + + :param links: The links of this Collision. # noqa: E501 + :type: CollisionLinks + """ + + self._links = links + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Collision, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Collision): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/collision_links.py b/psa_connectedcar/models/collision_links.py new file mode 100644 index 0000000..7ba6c63 --- /dev/null +++ b/psa_connectedcar/models/collision_links.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CollisionLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_self': 'Link', + 'trip': 'Link', + 'vehicle': 'Link' + } + + attribute_map = { + '_self': 'self', + 'trip': 'trip', + 'vehicle': 'vehicle' + } + + def __init__(self, _self=None, trip=None, vehicle=None): # noqa: E501 + """CollisionLinks - a model defined in Swagger""" # noqa: E501 + + self.__self = None + self._trip = None + self._vehicle = None + self.discriminator = None + + if _self is not None: + self._self = _self + if trip is not None: + self.trip = trip + if vehicle is not None: + self.vehicle = vehicle + + @property + def _self(self): + """Gets the _self of this CollisionLinks. # noqa: E501 + + + :return: The _self of this CollisionLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this CollisionLinks. + + + :param _self: The _self of this CollisionLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + @property + def trip(self): + """Gets the trip of this CollisionLinks. # noqa: E501 + + + :return: The trip of this CollisionLinks. # noqa: E501 + :rtype: Link + """ + return self._trip + + @trip.setter + def trip(self, trip): + """Sets the trip of this CollisionLinks. + + + :param trip: The trip of this CollisionLinks. # noqa: E501 + :type: Link + """ + + self._trip = trip + + @property + def vehicle(self): + """Gets the vehicle of this CollisionLinks. # noqa: E501 + + + :return: The vehicle of this CollisionLinks. # noqa: E501 + :rtype: Link + """ + return self._vehicle + + @vehicle.setter + def vehicle(self, vehicle): + """Sets the vehicle of this CollisionLinks. + + + :param vehicle: The vehicle of this CollisionLinks. # noqa: E501 + :type: Link + """ + + self._vehicle = vehicle + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CollisionLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollisionLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/collision_obj.py b/psa_connectedcar/models/collision_obj.py new file mode 100644 index 0000000..d0e81a6 --- /dev/null +++ b/psa_connectedcar/models/collision_obj.py @@ -0,0 +1,297 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CollisionObj(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'object', + 'front': 'CollisionObjFront', + 'id': 'str', + 'lateral': 'CollisionObjFront', + 'pedestrian': 'bool', + 'rear': 'CollisionObjFront', + 'roll_over': 'bool', + 'updated_at': 'datetime' + } + + attribute_map = { + 'embedded': '_embedded', + 'front': 'front', + 'id': 'id', + 'lateral': 'lateral', + 'pedestrian': 'pedestrian', + 'rear': 'rear', + 'roll_over': 'rollOver', + 'updated_at': 'updatedAt' + } + + def __init__(self, embedded=None, front=None, id=None, lateral=None, pedestrian=None, rear=None, roll_over=None, updated_at=None): # noqa: E501 + """CollisionObj - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self._front = None + self._id = None + self._lateral = None + self._pedestrian = None + self._rear = None + self._roll_over = None + self._updated_at = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + if front is not None: + self.front = front + if id is not None: + self.id = id + if lateral is not None: + self.lateral = lateral + if pedestrian is not None: + self.pedestrian = pedestrian + if rear is not None: + self.rear = rear + if roll_over is not None: + self.roll_over = roll_over + if updated_at is not None: + self.updated_at = updated_at + + @property + def embedded(self): + """Gets the embedded of this CollisionObj. # noqa: E501 + + + :return: The embedded of this CollisionObj. # noqa: E501 + :rtype: object + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this CollisionObj. + + + :param embedded: The embedded of this CollisionObj. # noqa: E501 + :type: object + """ + + self._embedded = embedded + + @property + def front(self): + """Gets the front of this CollisionObj. # noqa: E501 + + + :return: The front of this CollisionObj. # noqa: E501 + :rtype: CollisionObjFront + """ + return self._front + + @front.setter + def front(self, front): + """Sets the front of this CollisionObj. + + + :param front: The front of this CollisionObj. # noqa: E501 + :type: CollisionObjFront + """ + + self._front = front + + @property + def id(self): + """Gets the id of this CollisionObj. # noqa: E501 + + + :return: The id of this CollisionObj. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this CollisionObj. + + + :param id: The id of this CollisionObj. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def lateral(self): + """Gets the lateral of this CollisionObj. # noqa: E501 + + + :return: The lateral of this CollisionObj. # noqa: E501 + :rtype: CollisionObjFront + """ + return self._lateral + + @lateral.setter + def lateral(self, lateral): + """Sets the lateral of this CollisionObj. + + + :param lateral: The lateral of this CollisionObj. # noqa: E501 + :type: CollisionObjFront + """ + + self._lateral = lateral + + @property + def pedestrian(self): + """Gets the pedestrian of this CollisionObj. # noqa: E501 + + + :return: The pedestrian of this CollisionObj. # noqa: E501 + :rtype: bool + """ + return self._pedestrian + + @pedestrian.setter + def pedestrian(self, pedestrian): + """Sets the pedestrian of this CollisionObj. + + + :param pedestrian: The pedestrian of this CollisionObj. # noqa: E501 + :type: bool + """ + + self._pedestrian = pedestrian + + @property + def rear(self): + """Gets the rear of this CollisionObj. # noqa: E501 + + + :return: The rear of this CollisionObj. # noqa: E501 + :rtype: CollisionObjFront + """ + return self._rear + + @rear.setter + def rear(self, rear): + """Sets the rear of this CollisionObj. + + + :param rear: The rear of this CollisionObj. # noqa: E501 + :type: CollisionObjFront + """ + + self._rear = rear + + @property + def roll_over(self): + """Gets the roll_over of this CollisionObj. # noqa: E501 + + + :return: The roll_over of this CollisionObj. # noqa: E501 + :rtype: bool + """ + return self._roll_over + + @roll_over.setter + def roll_over(self, roll_over): + """Sets the roll_over of this CollisionObj. + + + :param roll_over: The roll_over of this CollisionObj. # noqa: E501 + :type: bool + """ + + self._roll_over = roll_over + + @property + def updated_at(self): + """Gets the updated_at of this CollisionObj. # noqa: E501 + + + :return: The updated_at of this CollisionObj. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this CollisionObj. + + + :param updated_at: The updated_at of this CollisionObj. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CollisionObj, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollisionObj): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/collision_obj_front.py b/psa_connectedcar/models/collision_obj_front.py new file mode 100644 index 0000000..647a063 --- /dev/null +++ b/psa_connectedcar/models/collision_obj_front.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CollisionObjFront(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'level': 'str' + } + + attribute_map = { + 'level': 'level' + } + + def __init__(self, level='none'): # noqa: E501 + """CollisionObjFront - a model defined in Swagger""" # noqa: E501 + + self._level = None + self.discriminator = None + + if level is not None: + self.level = level + + @property + def level(self): + """Gets the level of this CollisionObjFront. # noqa: E501 + + + :return: The level of this CollisionObjFront. # noqa: E501 + :rtype: str + """ + return self._level + + @level.setter + def level(self, level): + """Sets the level of this CollisionObjFront. + + + :param level: The level of this CollisionObjFront. # noqa: E501 + :type: str + """ + allowed_values = ["none", "low", "medium", "high", "fixable"] # noqa: E501 + if level not in allowed_values: + raise ValueError( + "Invalid value for `level` ({0}), must be one of {1}" # noqa: E501 + .format(level, allowed_values) + ) + + self._level = level + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CollisionObjFront, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollisionObjFront): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/collisions.py b/psa_connectedcar/models/collisions.py new file mode 100644 index 0000000..e708d4f --- /dev/null +++ b/psa_connectedcar/models/collisions.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Collisions(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'CollisionsEmbedded' + } + + attribute_map = { + 'embedded': '_embedded' + } + + def __init__(self, embedded=None): # noqa: E501 + """Collisions - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + + @property + def embedded(self): + """Gets the embedded of this Collisions. # noqa: E501 + + + :return: The embedded of this Collisions. # noqa: E501 + :rtype: CollisionsEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Collisions. + + + :param embedded: The embedded of this Collisions. # noqa: E501 + :type: CollisionsEmbedded + """ + + self._embedded = embedded + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Collisions, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Collisions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/collisions_embedded.py b/psa_connectedcar/models/collisions_embedded.py new file mode 100644 index 0000000..7dd32b4 --- /dev/null +++ b/psa_connectedcar/models/collisions_embedded.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CollisionsEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'collisions': 'list[Collision]' + } + + attribute_map = { + 'collisions': 'Collisions' + } + + def __init__(self, collisions=None): # noqa: E501 + """CollisionsEmbedded - a model defined in Swagger""" # noqa: E501 + + self._collisions = None + self.discriminator = None + + if collisions is not None: + self.collisions = collisions + + @property + def collisions(self): + """Gets the collisions of this CollisionsEmbedded. # noqa: E501 + + + :return: The collisions of this CollisionsEmbedded. # noqa: E501 + :rtype: list[Collision] + """ + return self._collisions + + @collisions.setter + def collisions(self, collisions): + """Sets the collisions of this CollisionsEmbedded. + + + :param collisions: The collisions of this CollisionsEmbedded. # noqa: E501 + :type: list[Collision] + """ + + self._collisions = collisions + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CollisionsEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CollisionsEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/created_at_field.py b/psa_connectedcar/models/created_at_field.py new file mode 100644 index 0000000..dfbcb63 --- /dev/null +++ b/psa_connectedcar/models/created_at_field.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class CreatedAtField(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime' + } + + attribute_map = { + 'created_at': 'createdAt' + } + + def __init__(self, created_at=None): # noqa: E501 + """CreatedAtField - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + + @property + def created_at(self): + """Gets the created_at of this CreatedAtField. # noqa: E501 + + Date when the resource has been created. # noqa: E501 + + :return: The created_at of this CreatedAtField. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this CreatedAtField. + + Date when the resource has been created. # noqa: E501 + + :param created_at: The created_at of this CreatedAtField. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(CreatedAtField, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, CreatedAtField): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/data_monitor_trigger.py b/psa_connectedcar/models/data_monitor_trigger.py new file mode 100644 index 0000000..cf2e23f --- /dev/null +++ b/psa_connectedcar/models/data_monitor_trigger.py @@ -0,0 +1,185 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DataMonitorTrigger(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'str', + 'op': 'str', + 'value': 'object' + } + + attribute_map = { + 'data': 'data', + 'op': 'op', + 'value': 'value' + } + + def __init__(self, data=None, op=None, value=None): # noqa: E501 + """DataMonitorTrigger - a model defined in Swagger""" # noqa: E501 + + self._data = None + self._op = None + self._value = None + self.discriminator = None + + if data is not None: + self.data = data + if op is not None: + self.op = op + if value is not None: + self.value = value + + @property + def data(self): + """Gets the data of this DataMonitorTrigger. # noqa: E501 + + the left operand of the trigger function. # noqa: E501 + + :return: The data of this DataMonitorTrigger. # noqa: E501 + :rtype: str + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this DataMonitorTrigger. + + the left operand of the trigger function. # noqa: E501 + + :param data: The data of this DataMonitorTrigger. # noqa: E501 + :type: str + """ + allowed_values = ["vehicle.alert", "vehicle.odometer", "vehicle.moving", "vehicle.running", "vehicle.engines.oil.temp", "vehicle.energy.level", "vehicle.energy.consumption", "vehicle.energy.autonomy", "vehicle.doorsState.lockedState", "vehicle.doorsState.opening", "vehicle.energy.charging.status", "vehicle.energy.charging.plugged", "vehicle.speed", "vehicle.autonomy", "vehicle.energy.fuel.level", "vehicle.energy.electric.level", "vehicle.new.trip", "passenger.seatbelt.unbuckled", "environment.air.temp"] # noqa: E501 + if data not in allowed_values: + raise ValueError( + "Invalid value for `data` ({0}), must be one of {1}" # noqa: E501 + .format(data, allowed_values) + ) + + self._data = data + + @property + def op(self): + """Gets the op of this DataMonitorTrigger. # noqa: E501 + + the operator of the trigger function. # noqa: E501 + + :return: The op of this DataMonitorTrigger. # noqa: E501 + :rtype: str + """ + return self._op + + @op.setter + def op(self, op): + """Sets the op of this DataMonitorTrigger. + + the operator of the trigger function. # noqa: E501 + + :param op: The op of this DataMonitorTrigger. # noqa: E501 + :type: str + """ + allowed_values = ["eqaualsTo", "greaterThan", "lowerThan", "includedIn"] # noqa: E501 + if op not in allowed_values: + raise ValueError( + "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 + .format(op, allowed_values) + ) + + self._op = op + + @property + def value(self): + """Gets the value of this DataMonitorTrigger. # noqa: E501 + + the right operand of the trigger function. # noqa: E501 + + :return: The value of this DataMonitorTrigger. # noqa: E501 + :rtype: object + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this DataMonitorTrigger. + + the right operand of the trigger function. # noqa: E501 + + :param value: The value of this DataMonitorTrigger. # noqa: E501 + :type: object + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DataMonitorTrigger, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DataMonitorTrigger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/data_trigger.py b/psa_connectedcar/models/data_trigger.py new file mode 100644 index 0000000..713e815 --- /dev/null +++ b/psa_connectedcar/models/data_trigger.py @@ -0,0 +1,187 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DataTrigger(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'str', + 'op': 'str', + 'value': 'list[str]' + } + + attribute_map = { + 'data': 'data', + 'op': 'op', + 'value': 'value' + } + + def __init__(self, data=None, op=None, value=None): # noqa: E501 + """DataTrigger - a model defined in Swagger""" # noqa: E501 + + self._data = None + self._op = None + self._value = None + self.discriminator = None + + self.data = data + self.op = op + if value is not None: + self.value = value + + @property + def data(self): + """Gets the data of this DataTrigger. # noqa: E501 + + The left operand of the trigger function. The following Table details for each operand data its type, the supported operator and the possibly retruned value: |**Data**|**Type**|**Op**|**Value**| |---|---| ---:| ---:| | Vehicle.alert | List of value | OnChange (at least one)/IncludedIn/EqualTo | Value (ObjetAlert) | | Vehicle.odometer | Integer | equalTo/greaterThan/lowerThan/ | Value | | vehicle.engines.running (boolean) | Boolean | OnChange/equalTo | Value (true/false) | | vehicle.engines.thermic.oil.temp | Integer | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.electric.level | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.electric.autonomy | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.fuel.level | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.fuel.autonomy | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.autonomy (global) | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.charging.status | Enum(ChargingStatusEnum) | OnChange/equalTo | Value | | vehicle.energy.charging.plugged | Boolean | OnChange/equalTo | Value | | vehicle.doorsState.lockedState | N/A | OnChange | Value | | vehicle.doorsState.opening | N/A | OnChange | Value | | vehicle.kinetic.moving| Boolean | OnChange/equalTo | Value (true/false) | | vehicle.kinetic.speed | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.trip| Literal | OnChange| Value(IDTRIP) | | vehicle.maintenance.daysBeforeMaintenance, | Number | OnChange/equalTo/ greaterThan/ lowerThan/ | Value | | vehicle.maintenance.mileageBeforeMaintenance| Number | OnChange/equalTo/ greaterThan/ lowerThan/ | Value | | vehicle.safety.beltWarning | Enum(beltWarning) | OnChange/equalTo | Value | | environment.air.temp | Number | equalTo/greaterThan/lowerThan/ | Value | | privacy.state | Enum(Privacy) | equalTo / OnChange/IncludedIN | Value | # noqa: E501 + + :return: The data of this DataTrigger. # noqa: E501 + :rtype: str + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this DataTrigger. + + The left operand of the trigger function. The following Table details for each operand data its type, the supported operator and the possibly retruned value: |**Data**|**Type**|**Op**|**Value**| |---|---| ---:| ---:| | Vehicle.alert | List of value | OnChange (at least one)/IncludedIn/EqualTo | Value (ObjetAlert) | | Vehicle.odometer | Integer | equalTo/greaterThan/lowerThan/ | Value | | vehicle.engines.running (boolean) | Boolean | OnChange/equalTo | Value (true/false) | | vehicle.engines.thermic.oil.temp | Integer | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.electric.level | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.electric.autonomy | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.fuel.level | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.fuel.autonomy | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.autonomy (global) | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.energy.charging.status | Enum(ChargingStatusEnum) | OnChange/equalTo | Value | | vehicle.energy.charging.plugged | Boolean | OnChange/equalTo | Value | | vehicle.doorsState.lockedState | N/A | OnChange | Value | | vehicle.doorsState.opening | N/A | OnChange | Value | | vehicle.kinetic.moving| Boolean | OnChange/equalTo | Value (true/false) | | vehicle.kinetic.speed | Number | equalTo/greaterThan/ lowerThan/ | Value | | vehicle.trip| Literal | OnChange| Value(IDTRIP) | | vehicle.maintenance.daysBeforeMaintenance, | Number | OnChange/equalTo/ greaterThan/ lowerThan/ | Value | | vehicle.maintenance.mileageBeforeMaintenance| Number | OnChange/equalTo/ greaterThan/ lowerThan/ | Value | | vehicle.safety.beltWarning | Enum(beltWarning) | OnChange/equalTo | Value | | environment.air.temp | Number | equalTo/greaterThan/lowerThan/ | Value | | privacy.state | Enum(Privacy) | equalTo / OnChange/IncludedIN | Value | # noqa: E501 + + :param data: The data of this DataTrigger. # noqa: E501 + :type: str + """ + if data is None: + raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 + allowed_values = ["vehicle.alert", "vehicle.odometer", "vehicle.engines.running", "vehicle.engines.thermic.oil.temp", "vehicle.energy.electric.level", "vehicle.energy.electric.autonomy", "vehicle.energy.fuel.level", "vehicle.energy.fuel.autonomy", "vehicle.autonomy", "vehicle.energy.charging.status", "vehicle.energy.charging.plugged", "vehicle.doorsState.lockedState", "vehicle.doorsState.opening", "vehicle.kinetic.moving", "vehicle.kinetic.speed", "vehicle.trip", "vehicle.maintenance.daysBeforeMaintenance", "vehicle.maintenance.mileageBeforeMaintenance", "vehicle.safety.beltWarning", "environment.air.temp", "privacy.state"] # noqa: E501 + if data not in allowed_values: + raise ValueError( + "Invalid value for `data` ({0}), must be one of {1}" # noqa: E501 + .format(data, allowed_values) + ) + + self._data = data + + @property + def op(self): + """Gets the op of this DataTrigger. # noqa: E501 + + The operator of the trigger function. # noqa: E501 + + :return: The op of this DataTrigger. # noqa: E501 + :rtype: str + """ + return self._op + + @op.setter + def op(self, op): + """Sets the op of this DataTrigger. + + The operator of the trigger function. # noqa: E501 + + :param op: The op of this DataTrigger. # noqa: E501 + :type: str + """ + if op is None: + raise ValueError("Invalid value for `op`, must not be `None`") # noqa: E501 + allowed_values = ["equalsTo", "greaterThan", "lowerThan", "includedIn", "onChange"] # noqa: E501 + if op not in allowed_values: + raise ValueError( + "Invalid value for `op` ({0}), must be one of {1}" # noqa: E501 + .format(op, allowed_values) + ) + + self._op = op + + @property + def value(self): + """Gets the value of this DataTrigger. # noqa: E501 + + The right operand of the trigger function. It can be a uniq ```value``` or a list of value ```values```. The choice of one or the other depends on ```OP``` which in the case of ```includedIn``` must be a list. * _Disclaimer_: If the op field is not set to ```includeIn``` then only the first item will be used. # noqa: E501 + + :return: The value of this DataTrigger. # noqa: E501 + :rtype: list[str] + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this DataTrigger. + + The right operand of the trigger function. It can be a uniq ```value``` or a list of value ```values```. The choice of one or the other depends on ```OP``` which in the case of ```includedIn``` must be a list. * _Disclaimer_: If the op field is not set to ```includeIn``` then only the first item will be used. # noqa: E501 + + :param value: The value of this DataTrigger. # noqa: E501 + :type: list[str] + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DataTrigger, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DataTrigger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/default_alert_push.py b/psa_connectedcar/models/default_alert_push.py new file mode 100644 index 0000000..af879e0 --- /dev/null +++ b/psa_connectedcar/models/default_alert_push.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DefaultAlertPush(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'list[DefaultAlertPushAttributes]', + 'name': 'str' + } + + attribute_map = { + 'attributes': 'attributes', + 'name': 'name' + } + + def __init__(self, attributes=None, name=None): # noqa: E501 + """DefaultAlertPush - a model defined in Swagger""" # noqa: E501 + + self._attributes = None + self._name = None + self.discriminator = None + + if attributes is not None: + self.attributes = attributes + self.name = name + + @property + def attributes(self): + """Gets the attributes of this DefaultAlertPush. # noqa: E501 + + + :return: The attributes of this DefaultAlertPush. # noqa: E501 + :rtype: list[DefaultAlertPushAttributes] + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this DefaultAlertPush. + + + :param attributes: The attributes of this DefaultAlertPush. # noqa: E501 + :type: list[DefaultAlertPushAttributes] + """ + + self._attributes = attributes + + @property + def name(self): + """Gets the name of this DefaultAlertPush. # noqa: E501 + + push event name # noqa: E501 + + :return: The name of this DefaultAlertPush. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this DefaultAlertPush. + + push event name # noqa: E501 + + :param name: The name of this DefaultAlertPush. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DefaultAlertPush, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DefaultAlertPush): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/default_alert_push_attributes.py b/psa_connectedcar/models/default_alert_push_attributes.py new file mode 100644 index 0000000..d856c25 --- /dev/null +++ b/psa_connectedcar/models/default_alert_push_attributes.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DefaultAlertPushAttributes(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'key': 'str', + 'value': 'str' + } + + attribute_map = { + 'key': 'key', + 'value': 'value' + } + + def __init__(self, key=None, value=None): # noqa: E501 + """DefaultAlertPushAttributes - a model defined in Swagger""" # noqa: E501 + + self._key = None + self._value = None + self.discriminator = None + + self.key = key + self.value = value + + @property + def key(self): + """Gets the key of this DefaultAlertPushAttributes. # noqa: E501 + + + :return: The key of this DefaultAlertPushAttributes. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this DefaultAlertPushAttributes. + + + :param key: The key of this DefaultAlertPushAttributes. # noqa: E501 + :type: str + """ + if key is None: + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def value(self): + """Gets the value of this DefaultAlertPushAttributes. # noqa: E501 + + + :return: The value of this DefaultAlertPushAttributes. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this DefaultAlertPushAttributes. + + + :param value: The value of this DefaultAlertPushAttributes. # noqa: E501 + :type: str + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DefaultAlertPushAttributes, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DefaultAlertPushAttributes): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/doors_state.py b/psa_connectedcar/models/doors_state.py new file mode 100644 index 0000000..1e93b07 --- /dev/null +++ b/psa_connectedcar/models/doors_state.py @@ -0,0 +1,174 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DoorsState(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'locked_state': 'list[str]', + 'opening': 'list[DoorsStateOpening]', + 'updated_at': 'datetime' + } + + attribute_map = { + 'locked_state': 'lockedState', + 'opening': 'opening', + 'updated_at': 'updatedAt' + } + + def __init__(self, locked_state=None, opening=None, updated_at=None): # noqa: E501 + """DoorsState - a model defined in Swagger""" # noqa: E501 + + self._locked_state = None + self._opening = None + self._updated_at = None + self.discriminator = None + + if locked_state is not None: + self.locked_state = locked_state + if opening is not None: + self.opening = opening + if updated_at is not None: + self.updated_at = updated_at + + @property + def locked_state(self): + """Gets the locked_state of this DoorsState. # noqa: E501 + + + :return: The locked_state of this DoorsState. # noqa: E501 + :rtype: list[str] + """ + return self._locked_state + + @locked_state.setter + def locked_state(self, locked_state): + """Sets the locked_state of this DoorsState. + + + :param locked_state: The locked_state of this DoorsState. # noqa: E501 + :type: list[str] + """ + allowed_values = ["Unlocked", "Locked", "SuperLocked", "DriverDoorUnlocked", "CabinDoorsUnlocked", "CargoDoorsLocked", "CargoDoorsUnlocked", "RearDoorsUnlocked", "RearDoorsLocked"] # noqa: E501 + if not set(locked_state).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `locked_state` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(locked_state) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._locked_state = locked_state + + @property + def opening(self): + """Gets the opening of this DoorsState. # noqa: E501 + + + :return: The opening of this DoorsState. # noqa: E501 + :rtype: list[DoorsStateOpening] + """ + return self._opening + + @opening.setter + def opening(self, opening): + """Sets the opening of this DoorsState. + + + :param opening: The opening of this DoorsState. # noqa: E501 + :type: list[DoorsStateOpening] + """ + + self._opening = opening + + @property + def updated_at(self): + """Gets the updated_at of this DoorsState. # noqa: E501 + + + :return: The updated_at of this DoorsState. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this DoorsState. + + + :param updated_at: The updated_at of this DoorsState. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DoorsState, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DoorsState): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/doors_state_opening.py b/psa_connectedcar/models/doors_state_opening.py new file mode 100644 index 0000000..b2e4724 --- /dev/null +++ b/psa_connectedcar/models/doors_state_opening.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class DoorsStateOpening(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'identifier': 'str', + 'state': 'str' + } + + attribute_map = { + 'identifier': 'identifier', + 'state': 'state' + } + + def __init__(self, identifier=None, state=None): # noqa: E501 + """DoorsStateOpening - a model defined in Swagger""" # noqa: E501 + + self._identifier = None + self._state = None + self.discriminator = None + + if identifier is not None: + self.identifier = identifier + if state is not None: + self.state = state + + @property + def identifier(self): + """Gets the identifier of this DoorsStateOpening. # noqa: E501 + + + :return: The identifier of this DoorsStateOpening. # noqa: E501 + :rtype: str + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this DoorsStateOpening. + + + :param identifier: The identifier of this DoorsStateOpening. # noqa: E501 + :type: str + """ + allowed_values = ["Driver", "Passenger", "RearLeft", "RearRight", "Trunk", "RearWindow", "RoofWindow"] # noqa: E501 + if identifier not in allowed_values: + raise ValueError( + "Invalid value for `identifier` ({0}), must be one of {1}" # noqa: E501 + .format(identifier, allowed_values) + ) + + self._identifier = identifier + + @property + def state(self): + """Gets the state of this DoorsStateOpening. # noqa: E501 + + + :return: The state of this DoorsStateOpening. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this DoorsStateOpening. + + + :param state: The state of this DoorsStateOpening. # noqa: E501 + :type: str + """ + allowed_values = ["Open", "Closed"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(DoorsStateOpening, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DoorsStateOpening): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/e_coaching.py b/psa_connectedcar/models/e_coaching.py new file mode 100644 index 0000000..02ee845 --- /dev/null +++ b/psa_connectedcar/models/e_coaching.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ECoaching(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'object', + 'links': 'ECoachingLinks', + 'scores': 'list[ECoachingScores]' + } + + attribute_map = { + 'embedded': '_embedded', + 'links': '_links', + 'scores': 'scores' + } + + def __init__(self, embedded=None, links=None, scores=None): # noqa: E501 + """ECoaching - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self._links = None + self._scores = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + if links is not None: + self.links = links + if scores is not None: + self.scores = scores + + @property + def embedded(self): + """Gets the embedded of this ECoaching. # noqa: E501 + + + :return: The embedded of this ECoaching. # noqa: E501 + :rtype: object + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this ECoaching. + + + :param embedded: The embedded of this ECoaching. # noqa: E501 + :type: object + """ + + self._embedded = embedded + + @property + def links(self): + """Gets the links of this ECoaching. # noqa: E501 + + + :return: The links of this ECoaching. # noqa: E501 + :rtype: ECoachingLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this ECoaching. + + + :param links: The links of this ECoaching. # noqa: E501 + :type: ECoachingLinks + """ + + self._links = links + + @property + def scores(self): + """Gets the scores of this ECoaching. # noqa: E501 + + + :return: The scores of this ECoaching. # noqa: E501 + :rtype: list[ECoachingScores] + """ + return self._scores + + @scores.setter + def scores(self, scores): + """Sets the scores of this ECoaching. + + + :param scores: The scores of this ECoaching. # noqa: E501 + :type: list[ECoachingScores] + """ + + self._scores = scores + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ECoaching, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ECoaching): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/e_coaching_links.py b/psa_connectedcar/models/e_coaching_links.py new file mode 100644 index 0000000..8d6baa4 --- /dev/null +++ b/psa_connectedcar/models/e_coaching_links.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ECoachingLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_self': 'Link', + 'trip': 'Link', + 'vehicle': 'Link' + } + + attribute_map = { + '_self': 'self', + 'trip': 'trip', + 'vehicle': 'vehicle' + } + + def __init__(self, _self=None, trip=None, vehicle=None): # noqa: E501 + """ECoachingLinks - a model defined in Swagger""" # noqa: E501 + + self.__self = None + self._trip = None + self._vehicle = None + self.discriminator = None + + if _self is not None: + self._self = _self + if trip is not None: + self.trip = trip + if vehicle is not None: + self.vehicle = vehicle + + @property + def _self(self): + """Gets the _self of this ECoachingLinks. # noqa: E501 + + + :return: The _self of this ECoachingLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this ECoachingLinks. + + + :param _self: The _self of this ECoachingLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + @property + def trip(self): + """Gets the trip of this ECoachingLinks. # noqa: E501 + + + :return: The trip of this ECoachingLinks. # noqa: E501 + :rtype: Link + """ + return self._trip + + @trip.setter + def trip(self, trip): + """Sets the trip of this ECoachingLinks. + + + :param trip: The trip of this ECoachingLinks. # noqa: E501 + :type: Link + """ + + self._trip = trip + + @property + def vehicle(self): + """Gets the vehicle of this ECoachingLinks. # noqa: E501 + + + :return: The vehicle of this ECoachingLinks. # noqa: E501 + :rtype: Link + """ + return self._vehicle + + @vehicle.setter + def vehicle(self, vehicle): + """Sets the vehicle of this ECoachingLinks. + + + :param vehicle: The vehicle of this ECoachingLinks. # noqa: E501 + :type: Link + """ + + self._vehicle = vehicle + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ECoachingLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ECoachingLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/e_coaching_scores.py b/psa_connectedcar/models/e_coaching_scores.py new file mode 100644 index 0000000..a1f7531 --- /dev/null +++ b/psa_connectedcar/models/e_coaching_scores.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ECoachingScores(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'category': 'str', + 'score': 'float' + } + + attribute_map = { + 'category': 'category', + 'score': 'score' + } + + def __init__(self, category=None, score=None): # noqa: E501 + """ECoachingScores - a model defined in Swagger""" # noqa: E501 + + self._category = None + self._score = None + self.discriminator = None + + if category is not None: + self.category = category + if score is not None: + self.score = score + + @property + def category(self): + """Gets the category of this ECoachingScores. # noqa: E501 + + category of the score. Global, ACCELERATION, BREAKING, A/C system, Runing cold engine, Direct Shift Gear, Speed, STT system, ZEV (Zero emission vehicle). # noqa: E501 + + :return: The category of this ECoachingScores. # noqa: E501 + :rtype: str + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this ECoachingScores. + + category of the score. Global, ACCELERATION, BREAKING, A/C system, Runing cold engine, Direct Shift Gear, Speed, STT system, ZEV (Zero emission vehicle). # noqa: E501 + + :param category: The category of this ECoachingScores. # noqa: E501 + :type: str + """ + allowed_values = ["Global", "Acceleration", "Break", "AirCondioner", "ColdEngine", "TirePressure", "Slope", "Speed", "StartStop"] # noqa: E501 + if category not in allowed_values: + raise ValueError( + "Invalid value for `category` ({0}), must be one of {1}" # noqa: E501 + .format(category, allowed_values) + ) + + self._category = category + + @property + def score(self): + """Gets the score of this ECoachingScores. # noqa: E501 + + + :return: The score of this ECoachingScores. # noqa: E501 + :rtype: float + """ + return self._score + + @score.setter + def score(self, score): + """Sets the score of this ECoachingScores. + + + :param score: The score of this ECoachingScores. # noqa: E501 + :type: float + """ + if score is not None and score > 10: # noqa: E501 + raise ValueError("Invalid value for `score`, must be a value less than or equal to `10`") # noqa: E501 + if score is not None and score < 0: # noqa: E501 + raise ValueError("Invalid value for `score`, must be a value greater than or equal to `0`") # noqa: E501 + + self._score = score + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ECoachingScores, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ECoachingScores): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/energy.py b/psa_connectedcar/models/energy.py new file mode 100644 index 0000000..7aec515 --- /dev/null +++ b/psa_connectedcar/models/energy.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Energy(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """Energy - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Energy, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Energy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/engine.py b/psa_connectedcar/models/engine.py new file mode 100644 index 0000000..025da00 --- /dev/null +++ b/psa_connectedcar/models/engine.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Engine(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'oil': 'EngineOil', + 'speed': 'float', + 'type': 'str' + } + + attribute_map = { + 'oil': 'oil', + 'speed': 'speed', + 'type': 'type' + } + + def __init__(self, oil=None, speed=None, type='Thermic'): # noqa: E501 + """Engine - a model defined in Swagger""" # noqa: E501 + + self._oil = None + self._speed = None + self._type = None + self.discriminator = None + + if oil is not None: + self.oil = oil + if speed is not None: + self.speed = speed + if type is not None: + self.type = type + + @property + def oil(self): + """Gets the oil of this Engine. # noqa: E501 + + + :return: The oil of this Engine. # noqa: E501 + :rtype: EngineOil + """ + return self._oil + + @oil.setter + def oil(self, oil): + """Sets the oil of this Engine. + + + :param oil: The oil of this Engine. # noqa: E501 + :type: EngineOil + """ + + self._oil = oil + + @property + def speed(self): + """Gets the speed of this Engine. # noqa: E501 + + + :return: The speed of this Engine. # noqa: E501 + :rtype: float + """ + return self._speed + + @speed.setter + def speed(self, speed): + """Sets the speed of this Engine. + + + :param speed: The speed of this Engine. # noqa: E501 + :type: float + """ + + self._speed = speed + + @property + def type(self): + """Gets the type of this Engine. # noqa: E501 + + + :return: The type of this Engine. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Engine. + + + :param type: The type of this Engine. # noqa: E501 + :type: str + """ + allowed_values = ["Thermic", "Electric"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Engine, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Engine): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/engine_oil.py b/psa_connectedcar/models/engine_oil.py new file mode 100644 index 0000000..a892420 --- /dev/null +++ b/psa_connectedcar/models/engine_oil.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class EngineOil(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'temp': 'float' + } + + attribute_map = { + 'temp': 'temp' + } + + def __init__(self, temp=None): # noqa: E501 + """EngineOil - a model defined in Swagger""" # noqa: E501 + + self._temp = None + self.discriminator = None + + if temp is not None: + self.temp = temp + + @property + def temp(self): + """Gets the temp of this EngineOil. # noqa: E501 + + + :return: The temp of this EngineOil. # noqa: E501 + :rtype: float + """ + return self._temp + + @temp.setter + def temp(self, temp): + """Sets the temp of this EngineOil. + + + :param temp: The temp of this EngineOil. # noqa: E501 + :type: float + """ + + self._temp = temp + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EngineOil, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EngineOil): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/environment.py b/psa_connectedcar/models/environment.py new file mode 100644 index 0000000..65cfa3c --- /dev/null +++ b/psa_connectedcar/models/environment.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Environment(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime', + 'air': 'EngineOil', + 'luminosity': 'EnvironmentLuminosity' + } + + attribute_map = { + 'created_at': 'createdAt', + 'air': 'air', + 'luminosity': 'luminosity' + } + + def __init__(self, created_at=None, air=None, luminosity=None): # noqa: E501 + """Environment - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self._air = None + self._luminosity = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if air is not None: + self.air = air + if luminosity is not None: + self.luminosity = luminosity + + @property + def created_at(self): + """Gets the created_at of this Environment. # noqa: E501 + + Date when the resource has been created. # noqa: E501 + + :return: The created_at of this Environment. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this Environment. + + Date when the resource has been created. # noqa: E501 + + :param created_at: The created_at of this Environment. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def air(self): + """Gets the air of this Environment. # noqa: E501 + + + :return: The air of this Environment. # noqa: E501 + :rtype: EngineOil + """ + return self._air + + @air.setter + def air(self, air): + """Sets the air of this Environment. + + + :param air: The air of this Environment. # noqa: E501 + :type: EngineOil + """ + + self._air = air + + @property + def luminosity(self): + """Gets the luminosity of this Environment. # noqa: E501 + + + :return: The luminosity of this Environment. # noqa: E501 + :rtype: EnvironmentLuminosity + """ + return self._luminosity + + @luminosity.setter + def luminosity(self, luminosity): + """Sets the luminosity of this Environment. + + + :param luminosity: The luminosity of this Environment. # noqa: E501 + :type: EnvironmentLuminosity + """ + + self._luminosity = luminosity + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Environment, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Environment): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/environment_luminosity.py b/psa_connectedcar/models/environment_luminosity.py new file mode 100644 index 0000000..7f4a2f0 --- /dev/null +++ b/psa_connectedcar/models/environment_luminosity.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class EnvironmentLuminosity(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'day': 'bool' + } + + attribute_map = { + 'day': 'day' + } + + def __init__(self, day=None): # noqa: E501 + """EnvironmentLuminosity - a model defined in Swagger""" # noqa: E501 + + self._day = None + self.discriminator = None + + if day is not None: + self.day = day + + @property + def day(self): + """Gets the day of this EnvironmentLuminosity. # noqa: E501 + + + :return: The day of this EnvironmentLuminosity. # noqa: E501 + :rtype: bool + """ + return self._day + + @day.setter + def day(self, day): + """Sets the day of this EnvironmentLuminosity. + + + :param day: The day of this EnvironmentLuminosity. # noqa: E501 + :type: bool + """ + + self._day = day + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EnvironmentLuminosity, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EnvironmentLuminosity): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/event.py b/psa_connectedcar/models/event.py new file mode 100644 index 0000000..c4225a5 --- /dev/null +++ b/psa_connectedcar/models/event.py @@ -0,0 +1,254 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Event(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime', + 'embedded': 'object', + 'links': 'EventLinks', + 'event_id': 'str', + 'id': 'str', + 'type': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'embedded': '_embedded', + 'links': '_links', + 'event_id': 'eventId', + 'id': 'id', + 'type': 'type' + } + + def __init__(self, created_at=None, embedded=None, links=None, event_id=None, id=None, type=None): # noqa: E501 + """Event - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self._embedded = None + self._links = None + self._event_id = None + self._id = None + self._type = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if embedded is not None: + self.embedded = embedded + self.links = links + if event_id is not None: + self.event_id = event_id + if id is not None: + self.id = id + if type is not None: + self.type = type + + @property + def created_at(self): + """Gets the created_at of this Event. # noqa: E501 + + Date when the resource has been created. # noqa: E501 + + :return: The created_at of this Event. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this Event. + + Date when the resource has been created. # noqa: E501 + + :param created_at: The created_at of this Event. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def embedded(self): + """Gets the embedded of this Event. # noqa: E501 + + + :return: The embedded of this Event. # noqa: E501 + :rtype: object + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Event. + + + :param embedded: The embedded of this Event. # noqa: E501 + :type: object + """ + + self._embedded = embedded + + @property + def links(self): + """Gets the links of this Event. # noqa: E501 + + + :return: The links of this Event. # noqa: E501 + :rtype: EventLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Event. + + + :param links: The links of this Event. # noqa: E501 + :type: EventLinks + """ + if links is None: + raise ValueError("Invalid value for `links`, must not be `None`") # noqa: E501 + + self._links = links + + @property + def event_id(self): + """Gets the event_id of this Event. # noqa: E501 + + + :return: The event_id of this Event. # noqa: E501 + :rtype: str + """ + return self._event_id + + @event_id.setter + def event_id(self, event_id): + """Sets the event_id of this Event. + + + :param event_id: The event_id of this Event. # noqa: E501 + :type: str + """ + + self._event_id = event_id + + @property + def id(self): + """Gets the id of this Event. # noqa: E501 + + + :return: The id of this Event. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Event. + + + :param id: The id of this Event. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def type(self): + """Gets the type of this Event. # noqa: E501 + + + :return: The type of this Event. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Event. + + + :param type: The type of this Event. # noqa: E501 + :type: str + """ + allowed_values = ["Trip", "Refuel", "FuelStolen", "Alert", "Collision"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Event, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Event): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/event_links.py b/psa_connectedcar/models/event_links.py new file mode 100644 index 0000000..1580521 --- /dev/null +++ b/psa_connectedcar/models/event_links.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class EventLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_self': 'Link' + } + + attribute_map = { + '_self': 'self' + } + + def __init__(self, _self=None): # noqa: E501 + """EventLinks - a model defined in Swagger""" # noqa: E501 + + self.__self = None + self.discriminator = None + + if _self is not None: + self._self = _self + + @property + def _self(self): + """Gets the _self of this EventLinks. # noqa: E501 + + + :return: The _self of this EventLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this EventLinks. + + + :param _self: The _self of this EventLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(EventLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, EventLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/extension.py b/psa_connectedcar/models/extension.py new file mode 100644 index 0000000..69aad07 --- /dev/null +++ b/psa_connectedcar/models/extension.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Extension(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'kinetic': 'Kinetic', + 'odemeter': 'VehicleOdometer' + } + + attribute_map = { + 'kinetic': 'kinetic', + 'odemeter': 'odemeter' + } + + def __init__(self, kinetic=None, odemeter=None): # noqa: E501 + """Extension - a model defined in Swagger""" # noqa: E501 + + self._kinetic = None + self._odemeter = None + self.discriminator = None + + if kinetic is not None: + self.kinetic = kinetic + if odemeter is not None: + self.odemeter = odemeter + + @property + def kinetic(self): + """Gets the kinetic of this Extension. # noqa: E501 + + + :return: The kinetic of this Extension. # noqa: E501 + :rtype: Kinetic + """ + return self._kinetic + + @kinetic.setter + def kinetic(self, kinetic): + """Sets the kinetic of this Extension. + + + :param kinetic: The kinetic of this Extension. # noqa: E501 + :type: Kinetic + """ + + self._kinetic = kinetic + + @property + def odemeter(self): + """Gets the odemeter of this Extension. # noqa: E501 + + + :return: The odemeter of this Extension. # noqa: E501 + :rtype: VehicleOdometer + """ + return self._odemeter + + @odemeter.setter + def odemeter(self, odemeter): + """Sets the odemeter of this Extension. + + + :param odemeter: The odemeter of this Extension. # noqa: E501 + :type: VehicleOdometer + """ + + self._odemeter = odemeter + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Extension, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Extension): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/extension_type.py b/psa_connectedcar/models/extension_type.py new file mode 100644 index 0000000..7478f21 --- /dev/null +++ b/psa_connectedcar/models/extension_type.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ExtensionType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ExtensionType - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ExtensionType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ExtensionType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/geometry.py b/psa_connectedcar/models/geometry.py new file mode 100644 index 0000000..855aab6 --- /dev/null +++ b/psa_connectedcar/models/geometry.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Geometry(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'coordinates': 'object', + 'type': 'str' + } + + attribute_map = { + 'coordinates': 'coordinates', + 'type': 'type' + } + + def __init__(self, coordinates=None, type=None): # noqa: E501 + """Geometry - a model defined in Swagger""" # noqa: E501 + + self._coordinates = None + self._type = None + self.discriminator = None + + self.coordinates = coordinates + self.type = type + + @property + def coordinates(self): + """Gets the coordinates of this Geometry. # noqa: E501 + + Geometry coordinates # noqa: E501 + + :return: The coordinates of this Geometry. # noqa: E501 + :rtype: object + """ + return self._coordinates + + @coordinates.setter + def coordinates(self, coordinates): + """Sets the coordinates of this Geometry. + + Geometry coordinates # noqa: E501 + + :param coordinates: The coordinates of this Geometry. # noqa: E501 + :type: object + """ + if coordinates is None: + raise ValueError("Invalid value for `coordinates`, must not be `None`") # noqa: E501 + + self._coordinates = coordinates + + @property + def type(self): + """Gets the type of this Geometry. # noqa: E501 + + + :return: The type of this Geometry. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Geometry. + + + :param type: The type of this Geometry. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["Polygon", "Point", "ExtCircle"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Geometry, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Geometry): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/ignition.py b/psa_connectedcar/models/ignition.py new file mode 100644 index 0000000..b892c31 --- /dev/null +++ b/psa_connectedcar/models/ignition.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Ignition(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'type': 'str' + } + + attribute_map = { + 'type': 'type' + } + + def __init__(self, type=None): # noqa: E501 + """Ignition - a model defined in Swagger""" # noqa: E501 + + self._type = None + self.discriminator = None + + if type is not None: + self.type = type + + @property + def type(self): + """Gets the type of this Ignition. # noqa: E501 + + + :return: The type of this Ignition. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Ignition. + + + :param type: The type of this Ignition. # noqa: E501 + :type: str + """ + allowed_values = ["Stop", "StartUp", "Start", "Free"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Ignition, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Ignition): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/index_range.py b/psa_connectedcar/models/index_range.py new file mode 100644 index 0000000..7c2453d --- /dev/null +++ b/psa_connectedcar/models/index_range.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class IndexRange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """IndexRange - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(IndexRange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IndexRange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/kinetic.py b/psa_connectedcar/models/kinetic.py new file mode 100644 index 0000000..392640a --- /dev/null +++ b/psa_connectedcar/models/kinetic.py @@ -0,0 +1,193 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Kinetic(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'acceleration': 'float', + 'moving': 'bool', + 'pace': 'float', + 'speed': 'float' + } + + attribute_map = { + 'acceleration': 'acceleration', + 'moving': 'moving', + 'pace': 'pace', + 'speed': 'speed' + } + + def __init__(self, acceleration=None, moving=None, pace=None, speed=None): # noqa: E501 + """Kinetic - a model defined in Swagger""" # noqa: E501 + + self._acceleration = None + self._moving = None + self._pace = None + self._speed = None + self.discriminator = None + + if acceleration is not None: + self.acceleration = acceleration + if moving is not None: + self.moving = moving + if pace is not None: + self.pace = pace + if speed is not None: + self.speed = speed + + @property + def acceleration(self): + """Gets the acceleration of this Kinetic. # noqa: E501 + + + :return: The acceleration of this Kinetic. # noqa: E501 + :rtype: float + """ + return self._acceleration + + @acceleration.setter + def acceleration(self, acceleration): + """Sets the acceleration of this Kinetic. + + + :param acceleration: The acceleration of this Kinetic. # noqa: E501 + :type: float + """ + + self._acceleration = acceleration + + @property + def moving(self): + """Gets the moving of this Kinetic. # noqa: E501 + + + :return: The moving of this Kinetic. # noqa: E501 + :rtype: bool + """ + return self._moving + + @moving.setter + def moving(self, moving): + """Sets the moving of this Kinetic. + + + :param moving: The moving of this Kinetic. # noqa: E501 + :type: bool + """ + + self._moving = moving + + @property + def pace(self): + """Gets the pace of this Kinetic. # noqa: E501 + + + :return: The pace of this Kinetic. # noqa: E501 + :rtype: float + """ + return self._pace + + @pace.setter + def pace(self, pace): + """Sets the pace of this Kinetic. + + + :param pace: The pace of this Kinetic. # noqa: E501 + :type: float + """ + + self._pace = pace + + @property + def speed(self): + """Gets the speed of this Kinetic. # noqa: E501 + + + :return: The speed of this Kinetic. # noqa: E501 + :rtype: float + """ + return self._speed + + @speed.setter + def speed(self, speed): + """Sets the speed of this Kinetic. + + + :param speed: The speed of this Kinetic. # noqa: E501 + :type: float + """ + + self._speed = speed + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Kinetic, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Kinetic): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/lighting.py b/psa_connectedcar/models/lighting.py new file mode 100644 index 0000000..6b3c675 --- /dev/null +++ b/psa_connectedcar/models/lighting.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Lighting(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'light': 'list[str]', + 'turn': 'list[str]' + } + + attribute_map = { + 'light': 'light', + 'turn': 'turn' + } + + def __init__(self, light=None, turn=None): # noqa: E501 + """Lighting - a model defined in Swagger""" # noqa: E501 + + self._light = None + self._turn = None + self.discriminator = None + + if light is not None: + self.light = light + if turn is not None: + self.turn = turn + + @property + def light(self): + """Gets the light of this Lighting. # noqa: E501 + + + :return: The light of this Lighting. # noqa: E501 + :rtype: list[str] + """ + return self._light + + @light.setter + def light(self, light): + """Sets the light of this Lighting. + + + :param light: The light of this Lighting. # noqa: E501 + :type: list[str] + """ + allowed_values = ["Front", "Rear"] # noqa: E501 + if not set(light).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `light` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(light) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._light = light + + @property + def turn(self): + """Gets the turn of this Lighting. # noqa: E501 + + + :return: The turn of this Lighting. # noqa: E501 + :rtype: list[str] + """ + return self._turn + + @turn.setter + def turn(self, turn): + """Sets the turn of this Lighting. + + + :param turn: The turn of this Lighting. # noqa: E501 + :type: list[str] + """ + allowed_values = ["Left", "Right"] # noqa: E501 + if not set(turn).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `turn` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(turn) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._turn = turn + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Lighting, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Lighting): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/link.py b/psa_connectedcar/models/link.py new file mode 100644 index 0000000..19e42d0 --- /dev/null +++ b/psa_connectedcar/models/link.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Link(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'deprecation': 'AlertEndPosition', + 'href': 'Url', + 'hreflang': 'str', + 'name': 'str', + 'profile': 'str', + 'templated': 'bool', + 'title': 'str', + 'type': 'str' + } + + attribute_map = { + 'deprecation': 'deprecation', + 'href': 'href', + 'hreflang': 'hreflang', + 'name': 'name', + 'profile': 'profile', + 'templated': 'templated', + 'title': 'title', + 'type': 'type' + } + + def __init__(self, deprecation=None, href=None, hreflang=None, name=None, profile=None, templated=None, title=None, type=None): # noqa: E501 + """Link - a model defined in Swagger""" # noqa: E501 + + self._deprecation = None + self._href = None + self._hreflang = None + self._name = None + self._profile = None + self._templated = None + self._title = None + self._type = None + self.discriminator = None + + if deprecation is not None: + self.deprecation = deprecation + self.href = href + if hreflang is not None: + self.hreflang = hreflang + if name is not None: + self.name = name + if profile is not None: + self.profile = profile + if templated is not None: + self.templated = templated + if title is not None: + self.title = title + if type is not None: + self.type = type + + @property + def deprecation(self): + """Gets the deprecation of this Link. # noqa: E501 + + + :return: The deprecation of this Link. # noqa: E501 + :rtype: AlertEndPosition + """ + return self._deprecation + + @deprecation.setter + def deprecation(self, deprecation): + """Sets the deprecation of this Link. + + + :param deprecation: The deprecation of this Link. # noqa: E501 + :type: AlertEndPosition + """ + + self._deprecation = deprecation + + @property + def href(self): + """Gets the href of this Link. # noqa: E501 + + + :return: The href of this Link. # noqa: E501 + :rtype: Url + """ + return self._href + + @href.setter + def href(self, href): + """Sets the href of this Link. + + + :param href: The href of this Link. # noqa: E501 + :type: Url + """ + if href is None: + raise ValueError("Invalid value for `href`, must not be `None`") # noqa: E501 + + self._href = href + + @property + def hreflang(self): + """Gets the hreflang of this Link. # noqa: E501 + + Its value is a string which is a URI that hints about the profile (as defined by [I-D.wilde-profile-link](https://tools.ietf.org/html/draft-kelly-json-hal-08#ref-I-D.wilde-profile-link)) of the target resource. # noqa: E501 + + :return: The hreflang of this Link. # noqa: E501 + :rtype: str + """ + return self._hreflang + + @hreflang.setter + def hreflang(self, hreflang): + """Sets the hreflang of this Link. + + Its value is a string which is a URI that hints about the profile (as defined by [I-D.wilde-profile-link](https://tools.ietf.org/html/draft-kelly-json-hal-08#ref-I-D.wilde-profile-link)) of the target resource. # noqa: E501 + + :param hreflang: The hreflang of this Link. # noqa: E501 + :type: str + """ + + self._hreflang = hreflang + + @property + def name(self): + """Gets the name of this Link. # noqa: E501 + + + :return: The name of this Link. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Link. + + + :param name: The name of this Link. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def profile(self): + """Gets the profile of this Link. # noqa: E501 + + Its value is a string and is intended for indicating the language of the target resource (as defined by [RFC5988]). # noqa: E501 + + :return: The profile of this Link. # noqa: E501 + :rtype: str + """ + return self._profile + + @profile.setter + def profile(self, profile): + """Sets the profile of this Link. + + Its value is a string and is intended for indicating the language of the target resource (as defined by [RFC5988]). # noqa: E501 + + :param profile: The profile of this Link. # noqa: E501 + :type: str + """ + + self._profile = profile + + @property + def templated(self): + """Gets the templated of this Link. # noqa: E501 + + SHOULD be true when the Link Object's \"href\" property is a URI Template # noqa: E501 + + :return: The templated of this Link. # noqa: E501 + :rtype: bool + """ + return self._templated + + @templated.setter + def templated(self, templated): + """Sets the templated of this Link. + + SHOULD be true when the Link Object's \"href\" property is a URI Template # noqa: E501 + + :param templated: The templated of this Link. # noqa: E501 + :type: bool + """ + + self._templated = templated + + @property + def title(self): + """Gets the title of this Link. # noqa: E501 + + Its value is a string and is intended for labelling the link with a human-readable identifier (as defined by [RFC5988](https://tools.ietf.org/html/rfc5988)). # noqa: E501 + + :return: The title of this Link. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this Link. + + Its value is a string and is intended for labelling the link with a human-readable identifier (as defined by [RFC5988](https://tools.ietf.org/html/rfc5988)). # noqa: E501 + + :param title: The title of this Link. # noqa: E501 + :type: str + """ + + self._title = title + + @property + def type(self): + """Gets the type of this Link. # noqa: E501 + + a hint to indicate the media type expected when dereferencing the target resource. # noqa: E501 + + :return: The type of this Link. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Link. + + a hint to indicate the media type expected when dereferencing the target resource. # noqa: E501 + + :param type: The type of this Link. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Link, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Link): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/maintenance.py b/psa_connectedcar/models/maintenance.py new file mode 100644 index 0000000..12e7d7f --- /dev/null +++ b/psa_connectedcar/models/maintenance.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Maintenance(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'links': 'MaintenanceLinks' + } + + attribute_map = { + 'links': '_links' + } + + def __init__(self, links=None): # noqa: E501 + """Maintenance - a model defined in Swagger""" # noqa: E501 + + self._links = None + self.discriminator = None + + self.links = links + + @property + def links(self): + """Gets the links of this Maintenance. # noqa: E501 + + + :return: The links of this Maintenance. # noqa: E501 + :rtype: MaintenanceLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Maintenance. + + + :param links: The links of this Maintenance. # noqa: E501 + :type: MaintenanceLinks + """ + if links is None: + raise ValueError("Invalid value for `links`, must not be `None`") # noqa: E501 + + self._links = links + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Maintenance, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Maintenance): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/maintenance_links.py b/psa_connectedcar/models/maintenance_links.py new file mode 100644 index 0000000..37b874f --- /dev/null +++ b/psa_connectedcar/models/maintenance_links.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MaintenanceLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'alerts': 'Link', + '_self': 'Link', + 'vehicle': 'Link' + } + + attribute_map = { + 'alerts': 'alerts', + '_self': 'self', + 'vehicle': 'vehicle' + } + + def __init__(self, alerts=None, _self=None, vehicle=None): # noqa: E501 + """MaintenanceLinks - a model defined in Swagger""" # noqa: E501 + + self._alerts = None + self.__self = None + self._vehicle = None + self.discriminator = None + + if alerts is not None: + self.alerts = alerts + if _self is not None: + self._self = _self + if vehicle is not None: + self.vehicle = vehicle + + @property + def alerts(self): + """Gets the alerts of this MaintenanceLinks. # noqa: E501 + + + :return: The alerts of this MaintenanceLinks. # noqa: E501 + :rtype: Link + """ + return self._alerts + + @alerts.setter + def alerts(self, alerts): + """Sets the alerts of this MaintenanceLinks. + + + :param alerts: The alerts of this MaintenanceLinks. # noqa: E501 + :type: Link + """ + + self._alerts = alerts + + @property + def _self(self): + """Gets the _self of this MaintenanceLinks. # noqa: E501 + + + :return: The _self of this MaintenanceLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this MaintenanceLinks. + + + :param _self: The _self of this MaintenanceLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + @property + def vehicle(self): + """Gets the vehicle of this MaintenanceLinks. # noqa: E501 + + + :return: The vehicle of this MaintenanceLinks. # noqa: E501 + :rtype: Link + """ + return self._vehicle + + @vehicle.setter + def vehicle(self, vehicle): + """Sets the vehicle of this MaintenanceLinks. + + + :param vehicle: The vehicle of this MaintenanceLinks. # noqa: E501 + :type: Link + """ + + self._vehicle = vehicle + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MaintenanceLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MaintenanceLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/maintenance_obj.py b/psa_connectedcar/models/maintenance_obj.py new file mode 100644 index 0000000..96af739 --- /dev/null +++ b/psa_connectedcar/models/maintenance_obj.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MaintenanceObj(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime', + 'days_before_maintenace': 'int', + 'mileage_before_maintenance': 'int' + } + + attribute_map = { + 'created_at': 'createdAt', + 'days_before_maintenace': 'daysBeforeMaintenace', + 'mileage_before_maintenance': 'mileageBeforeMaintenance' + } + + def __init__(self, created_at=None, days_before_maintenace=None, mileage_before_maintenance=None): # noqa: E501 + """MaintenanceObj - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self._days_before_maintenace = None + self._mileage_before_maintenance = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if days_before_maintenace is not None: + self.days_before_maintenace = days_before_maintenace + if mileage_before_maintenance is not None: + self.mileage_before_maintenance = mileage_before_maintenance + + @property + def created_at(self): + """Gets the created_at of this MaintenanceObj. # noqa: E501 + + Date when the resource has been created. # noqa: E501 + + :return: The created_at of this MaintenanceObj. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this MaintenanceObj. + + Date when the resource has been created. # noqa: E501 + + :param created_at: The created_at of this MaintenanceObj. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def days_before_maintenace(self): + """Gets the days_before_maintenace of this MaintenanceObj. # noqa: E501 + + + :return: The days_before_maintenace of this MaintenanceObj. # noqa: E501 + :rtype: int + """ + return self._days_before_maintenace + + @days_before_maintenace.setter + def days_before_maintenace(self, days_before_maintenace): + """Sets the days_before_maintenace of this MaintenanceObj. + + + :param days_before_maintenace: The days_before_maintenace of this MaintenanceObj. # noqa: E501 + :type: int + """ + + self._days_before_maintenace = days_before_maintenace + + @property + def mileage_before_maintenance(self): + """Gets the mileage_before_maintenance of this MaintenanceObj. # noqa: E501 + + + :return: The mileage_before_maintenance of this MaintenanceObj. # noqa: E501 + :rtype: int + """ + return self._mileage_before_maintenance + + @mileage_before_maintenance.setter + def mileage_before_maintenance(self, mileage_before_maintenance): + """Sets the mileage_before_maintenance of this MaintenanceObj. + + + :param mileage_before_maintenance: The mileage_before_maintenance of this MaintenanceObj. # noqa: E501 + :type: int + """ + + self._mileage_before_maintenance = mileage_before_maintenance + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MaintenanceObj, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MaintenanceObj): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor.py b/psa_connectedcar/models/monitor.py new file mode 100644 index 0000000..57d453f --- /dev/null +++ b/psa_connectedcar/models/monitor.py @@ -0,0 +1,196 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Monitor(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'links': 'MonitorLinks', + 'mid': 'MonitorId', + 'monitor': 'MonitorParameter', + 'status': 'MonitorStatus' + } + + attribute_map = { + 'links': '_links', + 'mid': 'mid', + 'monitor': 'monitor', + 'status': 'status' + } + + def __init__(self, links=None, mid=None, monitor=None, status=None): # noqa: E501 + """Monitor - a model defined in Swagger""" # noqa: E501 + + self._links = None + self._mid = None + self._monitor = None + self._status = None + self.discriminator = None + + if links is not None: + self.links = links + self.mid = mid + self.monitor = monitor + self.status = status + + @property + def links(self): + """Gets the links of this Monitor. # noqa: E501 + + + :return: The links of this Monitor. # noqa: E501 + :rtype: MonitorLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Monitor. + + + :param links: The links of this Monitor. # noqa: E501 + :type: MonitorLinks + """ + + self._links = links + + @property + def mid(self): + """Gets the mid of this Monitor. # noqa: E501 + + + :return: The mid of this Monitor. # noqa: E501 + :rtype: MonitorId + """ + return self._mid + + @mid.setter + def mid(self, mid): + """Sets the mid of this Monitor. + + + :param mid: The mid of this Monitor. # noqa: E501 + :type: MonitorId + """ + if mid is None: + raise ValueError("Invalid value for `mid`, must not be `None`") # noqa: E501 + + self._mid = mid + + @property + def monitor(self): + """Gets the monitor of this Monitor. # noqa: E501 + + + :return: The monitor of this Monitor. # noqa: E501 + :rtype: MonitorParameter + """ + return self._monitor + + @monitor.setter + def monitor(self, monitor): + """Sets the monitor of this Monitor. + + + :param monitor: The monitor of this Monitor. # noqa: E501 + :type: MonitorParameter + """ + if monitor is None: + raise ValueError("Invalid value for `monitor`, must not be `None`") # noqa: E501 + + self._monitor = monitor + + @property + def status(self): + """Gets the status of this Monitor. # noqa: E501 + + + :return: The status of this Monitor. # noqa: E501 + :rtype: MonitorStatus + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this Monitor. + + + :param status: The status of this Monitor. # noqa: E501 + :type: MonitorStatus + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Monitor, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Monitor): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_id.py b/psa_connectedcar/models/monitor_id.py new file mode 100644 index 0000000..7608a5d --- /dev/null +++ b/psa_connectedcar/models/monitor_id.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorId(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """MonitorId - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorId, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorId): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_links.py b/psa_connectedcar/models/monitor_links.py new file mode 100644 index 0000000..3af6fee --- /dev/null +++ b/psa_connectedcar/models/monitor_links.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'fleet': 'Link', + '_self': 'Link' + } + + attribute_map = { + 'fleet': 'fleet', + '_self': 'self' + } + + def __init__(self, fleet=None, _self=None): # noqa: E501 + """MonitorLinks - a model defined in Swagger""" # noqa: E501 + + self._fleet = None + self.__self = None + self.discriminator = None + + if fleet is not None: + self.fleet = fleet + if _self is not None: + self._self = _self + + @property + def fleet(self): + """Gets the fleet of this MonitorLinks. # noqa: E501 + + + :return: The fleet of this MonitorLinks. # noqa: E501 + :rtype: Link + """ + return self._fleet + + @fleet.setter + def fleet(self, fleet): + """Sets the fleet of this MonitorLinks. + + + :param fleet: The fleet of this MonitorLinks. # noqa: E501 + :type: Link + """ + + self._fleet = fleet + + @property + def _self(self): + """Gets the _self of this MonitorLinks. # noqa: E501 + + + :return: The _self of this MonitorLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this MonitorLinks. + + + :param _self: The _self of this MonitorLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_parameter.py b/psa_connectedcar/models/monitor_parameter.py new file mode 100644 index 0000000..33112b9 --- /dev/null +++ b/psa_connectedcar/models/monitor_parameter.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorParameter(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'extended_event_param': 'list[object]', + 'label': 'str', + 'locale': 'str', + 'subscribe_param': 'MonitorSubscribe', + 'trigger_param': 'MonitorParameterTriggerParam' + } + + attribute_map = { + 'extended_event_param': 'extendedEventParam', + 'label': 'label', + 'locale': 'locale', + 'subscribe_param': 'subscribeParam', + 'trigger_param': 'triggerParam' + } + + def __init__(self, extended_event_param=None, label=None, locale=None, subscribe_param=None, trigger_param=None): # noqa: E501 + """MonitorParameter - a model defined in Swagger""" # noqa: E501 + + self._extended_event_param = None + self._label = None + self._locale = None + self._subscribe_param = None + self._trigger_param = None + self.discriminator = None + + if extended_event_param is not None: + self.extended_event_param = extended_event_param + self.label = label + if locale is not None: + self.locale = locale + self.subscribe_param = subscribe_param + self.trigger_param = trigger_param + + @property + def extended_event_param(self): + """Gets the extended_event_param of this MonitorParameter. # noqa: E501 + + Allow to set extra vehicle data (defined in data model) to add to the monitor event when publishing. The possible values are |value|description|Related model | |----------|:-------------|------:| |vehicle.doorsState|Latest know door state (timestamped)|DoorState| |vehicle.status|Latest know vehicle status (timestamped)|Status| |vehicle.maintenance|Latest know maintenance(timestamped)|Maintenance| |vehicle.position|Last vehicle position (timestamped)|Position| |vehicle.telemetry${.TelemetryEnum}|Latest known telemetry (timestamped). |Telemetry |vehicle.alerts|List of active alerts|Alert| * For telemetry extension: * The suffix ```${.TelemetryEnum}``` can be selected to refine with telemetry type (from the TelemetryEnum list). This value (with suffix) can be selected **_several times_** to included suitable telemetry messages with the extention. * Using ```vehicle.telemetry``` without suffix means to include all available telemetries. # noqa: E501 + + :return: The extended_event_param of this MonitorParameter. # noqa: E501 + :rtype: list[object] + """ + return self._extended_event_param + + @extended_event_param.setter + def extended_event_param(self, extended_event_param): + """Sets the extended_event_param of this MonitorParameter. + + Allow to set extra vehicle data (defined in data model) to add to the monitor event when publishing. The possible values are |value|description|Related model | |----------|:-------------|------:| |vehicle.doorsState|Latest know door state (timestamped)|DoorState| |vehicle.status|Latest know vehicle status (timestamped)|Status| |vehicle.maintenance|Latest know maintenance(timestamped)|Maintenance| |vehicle.position|Last vehicle position (timestamped)|Position| |vehicle.telemetry${.TelemetryEnum}|Latest known telemetry (timestamped). |Telemetry |vehicle.alerts|List of active alerts|Alert| * For telemetry extension: * The suffix ```${.TelemetryEnum}``` can be selected to refine with telemetry type (from the TelemetryEnum list). This value (with suffix) can be selected **_several times_** to included suitable telemetry messages with the extention. * Using ```vehicle.telemetry``` without suffix means to include all available telemetries. # noqa: E501 + + :param extended_event_param: The extended_event_param of this MonitorParameter. # noqa: E501 + :type: list[object] + """ + + self._extended_event_param = extended_event_param + + @property + def label(self): + """Gets the label of this MonitorParameter. # noqa: E501 + + Monitor lablel (usually its name). # noqa: E501 + + :return: The label of this MonitorParameter. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this MonitorParameter. + + Monitor lablel (usually its name). # noqa: E501 + + :param label: The label of this MonitorParameter. # noqa: E501 + :type: str + """ + if label is None: + raise ValueError("Invalid value for `label`, must not be `None`") # noqa: E501 + + self._label = label + + @property + def locale(self): + """Gets the locale of this MonitorParameter. # noqa: E501 + + Locale is used for rendering text according to language and country for. It should match the REGEX ```\\w(-\\w)?```. For more details about possible standard values, please refer to [locals list](https://en.wikipedia.org/wiki/Language_localisation). # noqa: E501 + + :return: The locale of this MonitorParameter. # noqa: E501 + :rtype: str + """ + return self._locale + + @locale.setter + def locale(self, locale): + """Sets the locale of this MonitorParameter. + + Locale is used for rendering text according to language and country for. It should match the REGEX ```\\w(-\\w)?```. For more details about possible standard values, please refer to [locals list](https://en.wikipedia.org/wiki/Language_localisation). # noqa: E501 + + :param locale: The locale of this MonitorParameter. # noqa: E501 + :type: str + """ + if locale is not None and not re.search(r'\\w(-\\w)?', locale): # noqa: E501 + raise ValueError(r"Invalid value for `locale`, must be a follow pattern or equal to `/\\w(-\\w)?/`") # noqa: E501 + + self._locale = locale + + @property + def subscribe_param(self): + """Gets the subscribe_param of this MonitorParameter. # noqa: E501 + + + :return: The subscribe_param of this MonitorParameter. # noqa: E501 + :rtype: MonitorSubscribe + """ + return self._subscribe_param + + @subscribe_param.setter + def subscribe_param(self, subscribe_param): + """Sets the subscribe_param of this MonitorParameter. + + + :param subscribe_param: The subscribe_param of this MonitorParameter. # noqa: E501 + :type: MonitorSubscribe + """ + if subscribe_param is None: + raise ValueError("Invalid value for `subscribe_param`, must not be `None`") # noqa: E501 + + self._subscribe_param = subscribe_param + + @property + def trigger_param(self): + """Gets the trigger_param of this MonitorParameter. # noqa: E501 + + + :return: The trigger_param of this MonitorParameter. # noqa: E501 + :rtype: MonitorParameterTriggerParam + """ + return self._trigger_param + + @trigger_param.setter + def trigger_param(self, trigger_param): + """Sets the trigger_param of this MonitorParameter. + + + :param trigger_param: The trigger_param of this MonitorParameter. # noqa: E501 + :type: MonitorParameterTriggerParam + """ + if trigger_param is None: + raise ValueError("Invalid value for `trigger_param`, must not be `None`") # noqa: E501 + + self._trigger_param = trigger_param + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorParameter, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorParameter): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_parameter_trigger_param.py b/psa_connectedcar/models/monitor_parameter_trigger_param.py new file mode 100644 index 0000000..2633f37 --- /dev/null +++ b/psa_connectedcar/models/monitor_parameter_trigger_param.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorParameterTriggerParam(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'bool_exp': 'str', + 'data_triggers': 'list[DataTrigger]', + 'time_zone_triggers': 'TimeZoneTrigger', + 'triggers': 'list[MonitorTrigger]' + } + + attribute_map = { + 'bool_exp': 'bool.exp', + 'data_triggers': 'dataTriggers', + 'time_zone_triggers': 'timeZoneTriggers', + 'triggers': 'triggers' + } + + def __init__(self, bool_exp=None, data_triggers=None, time_zone_triggers=None, triggers=None): # noqa: E501 + """MonitorParameterTriggerParam - a model defined in Swagger""" # noqa: E501 + + self._bool_exp = None + self._data_triggers = None + self._time_zone_triggers = None + self._triggers = None + self.discriminator = None + + self.bool_exp = bool_exp + if data_triggers is not None: + self.data_triggers = data_triggers + if time_zone_triggers is not None: + self.time_zone_triggers = time_zone_triggers + self.triggers = triggers + + @property + def bool_exp(self): + """Gets the bool_exp of this MonitorParameterTriggerParam. # noqa: E501 + + A boolean expression that allow defining a logical relationship between triggers. Used Operands with this expression should only be the names of the defined triggers. Grammar: ``` exp ::= exp '&' exp | exp '|' exp | (exp) | !exp ``` * **example**: having two-zone trigger (two towns) named z1 an z2, one time-trigger (8h00 to 20h00) named t1 and finally three data triggerd named as follow: f(fuel), a(autonomy) , o(odometer). we can have a boolean expression such as: : ``` ((z1 & t1) | (z2 & !t1) | (f & z1) | (a & (z1|t)) | (o & (z1 | z2))) ``` # noqa: E501 + + :return: The bool_exp of this MonitorParameterTriggerParam. # noqa: E501 + :rtype: str + """ + return self._bool_exp + + @bool_exp.setter + def bool_exp(self, bool_exp): + """Sets the bool_exp of this MonitorParameterTriggerParam. + + A boolean expression that allow defining a logical relationship between triggers. Used Operands with this expression should only be the names of the defined triggers. Grammar: ``` exp ::= exp '&' exp | exp '|' exp | (exp) | !exp ``` * **example**: having two-zone trigger (two towns) named z1 an z2, one time-trigger (8h00 to 20h00) named t1 and finally three data triggerd named as follow: f(fuel), a(autonomy) , o(odometer). we can have a boolean expression such as: : ``` ((z1 & t1) | (z2 & !t1) | (f & z1) | (a & (z1|t)) | (o & (z1 | z2))) ``` # noqa: E501 + + :param bool_exp: The bool_exp of this MonitorParameterTriggerParam. # noqa: E501 + :type: str + """ + if bool_exp is None: + raise ValueError("Invalid value for `bool_exp`, must not be `None`") # noqa: E501 + + self._bool_exp = bool_exp + + @property + def data_triggers(self): + """Gets the data_triggers of this MonitorParameterTriggerParam. # noqa: E501 + + Compound data triggers (will be evaluated with an AND relationship) *Note*: ```dataTriggers``` is depricated according the new monitor spec. Please use the new data schema. # noqa: E501 + + :return: The data_triggers of this MonitorParameterTriggerParam. # noqa: E501 + :rtype: list[DataTrigger] + """ + return self._data_triggers + + @data_triggers.setter + def data_triggers(self, data_triggers): + """Sets the data_triggers of this MonitorParameterTriggerParam. + + Compound data triggers (will be evaluated with an AND relationship) *Note*: ```dataTriggers``` is depricated according the new monitor spec. Please use the new data schema. # noqa: E501 + + :param data_triggers: The data_triggers of this MonitorParameterTriggerParam. # noqa: E501 + :type: list[DataTrigger] + """ + + self._data_triggers = data_triggers + + @property + def time_zone_triggers(self): + """Gets the time_zone_triggers of this MonitorParameterTriggerParam. # noqa: E501 + + + :return: The time_zone_triggers of this MonitorParameterTriggerParam. # noqa: E501 + :rtype: TimeZoneTrigger + """ + return self._time_zone_triggers + + @time_zone_triggers.setter + def time_zone_triggers(self, time_zone_triggers): + """Sets the time_zone_triggers of this MonitorParameterTriggerParam. + + + :param time_zone_triggers: The time_zone_triggers of this MonitorParameterTriggerParam. # noqa: E501 + :type: TimeZoneTrigger + """ + + self._time_zone_triggers = time_zone_triggers + + @property + def triggers(self): + """Gets the triggers of this MonitorParameterTriggerParam. # noqa: E501 + + Compound monitor triggers (will be evaluated using boolean expresion :```boo.exp```) # noqa: E501 + + :return: The triggers of this MonitorParameterTriggerParam. # noqa: E501 + :rtype: list[MonitorTrigger] + """ + return self._triggers + + @triggers.setter + def triggers(self, triggers): + """Sets the triggers of this MonitorParameterTriggerParam. + + Compound monitor triggers (will be evaluated using boolean expresion :```boo.exp```) # noqa: E501 + + :param triggers: The triggers of this MonitorParameterTriggerParam. # noqa: E501 + :type: list[MonitorTrigger] + """ + if triggers is None: + raise ValueError("Invalid value for `triggers`, must not be `None`") # noqa: E501 + + self._triggers = triggers + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorParameterTriggerParam, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorParameterTriggerParam): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_ref.py b/psa_connectedcar/models/monitor_ref.py new file mode 100644 index 0000000..28a13e1 --- /dev/null +++ b/psa_connectedcar/models/monitor_ref.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorRef(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'links': 'MonitorRefLinks', + 'monitor_id': 'MonitorId' + } + + attribute_map = { + 'links': '_links', + 'monitor_id': 'monitorId' + } + + def __init__(self, links=None, monitor_id=None): # noqa: E501 + """MonitorRef - a model defined in Swagger""" # noqa: E501 + + self._links = None + self._monitor_id = None + self.discriminator = None + + if links is not None: + self.links = links + if monitor_id is not None: + self.monitor_id = monitor_id + + @property + def links(self): + """Gets the links of this MonitorRef. # noqa: E501 + + + :return: The links of this MonitorRef. # noqa: E501 + :rtype: MonitorRefLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this MonitorRef. + + + :param links: The links of this MonitorRef. # noqa: E501 + :type: MonitorRefLinks + """ + + self._links = links + + @property + def monitor_id(self): + """Gets the monitor_id of this MonitorRef. # noqa: E501 + + + :return: The monitor_id of this MonitorRef. # noqa: E501 + :rtype: MonitorId + """ + return self._monitor_id + + @monitor_id.setter + def monitor_id(self, monitor_id): + """Sets the monitor_id of this MonitorRef. + + + :param monitor_id: The monitor_id of this MonitorRef. # noqa: E501 + :type: MonitorId + """ + + self._monitor_id = monitor_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorRef, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorRef): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_ref_links.py b/psa_connectedcar/models/monitor_ref_links.py new file mode 100644 index 0000000..26af3f6 --- /dev/null +++ b/psa_connectedcar/models/monitor_ref_links.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorRefLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'delete': 'Link', + 'monitor': 'Link', + 'vehicle': 'Link' + } + + attribute_map = { + 'delete': 'delete', + 'monitor': 'monitor', + 'vehicle': 'vehicle' + } + + def __init__(self, delete=None, monitor=None, vehicle=None): # noqa: E501 + """MonitorRefLinks - a model defined in Swagger""" # noqa: E501 + + self._delete = None + self._monitor = None + self._vehicle = None + self.discriminator = None + + if delete is not None: + self.delete = delete + if monitor is not None: + self.monitor = monitor + if vehicle is not None: + self.vehicle = vehicle + + @property + def delete(self): + """Gets the delete of this MonitorRefLinks. # noqa: E501 + + + :return: The delete of this MonitorRefLinks. # noqa: E501 + :rtype: Link + """ + return self._delete + + @delete.setter + def delete(self, delete): + """Sets the delete of this MonitorRefLinks. + + + :param delete: The delete of this MonitorRefLinks. # noqa: E501 + :type: Link + """ + + self._delete = delete + + @property + def monitor(self): + """Gets the monitor of this MonitorRefLinks. # noqa: E501 + + + :return: The monitor of this MonitorRefLinks. # noqa: E501 + :rtype: Link + """ + return self._monitor + + @monitor.setter + def monitor(self, monitor): + """Sets the monitor of this MonitorRefLinks. + + + :param monitor: The monitor of this MonitorRefLinks. # noqa: E501 + :type: Link + """ + + self._monitor = monitor + + @property + def vehicle(self): + """Gets the vehicle of this MonitorRefLinks. # noqa: E501 + + + :return: The vehicle of this MonitorRefLinks. # noqa: E501 + :rtype: Link + """ + return self._vehicle + + @vehicle.setter + def vehicle(self, vehicle): + """Sets the vehicle of this MonitorRefLinks. + + + :param vehicle: The vehicle of this MonitorRefLinks. # noqa: E501 + :type: Link + """ + + self._vehicle = vehicle + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorRefLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorRefLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_status.py b/psa_connectedcar/models/monitor_status.py new file mode 100644 index 0000000..5b5529a --- /dev/null +++ b/psa_connectedcar/models/monitor_status.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorStatus(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + RUNNING = "Running" + PAUSED = "Paused" + FAILED = "Failed" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """MonitorStatus - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorStatus, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorStatus): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_status_setter.py b/psa_connectedcar/models/monitor_status_setter.py new file mode 100644 index 0000000..f84957b --- /dev/null +++ b/psa_connectedcar/models/monitor_status_setter.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorStatusSetter(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'status': 'str' + } + + attribute_map = { + 'status': 'status' + } + + def __init__(self, status=None): # noqa: E501 + """MonitorStatusSetter - a model defined in Swagger""" # noqa: E501 + + self._status = None + self.discriminator = None + + if status is not None: + self.status = status + + @property + def status(self): + """Gets the status of this MonitorStatusSetter. # noqa: E501 + + + :return: The status of this MonitorStatusSetter. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this MonitorStatusSetter. + + + :param status: The status of this MonitorStatusSetter. # noqa: E501 + :type: str + """ + allowed_values = ["Running", "Paused"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorStatusSetter, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorStatusSetter): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_subscribe.py b/psa_connectedcar/models/monitor_subscribe.py new file mode 100644 index 0000000..cb81f11 --- /dev/null +++ b/psa_connectedcar/models/monitor_subscribe.py @@ -0,0 +1,198 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorSubscribe(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'batch_notify': 'MonitorSubscribeBatchNotify', + 'callback': 'MonitorWebhook', + 'refresh_event': 'float', + 'retry_policy': 'MonitorSubscribeRetryPolicy' + } + + attribute_map = { + 'batch_notify': 'batchNotify', + 'callback': 'callback', + 'refresh_event': 'refreshEvent', + 'retry_policy': 'retryPolicy' + } + + def __init__(self, batch_notify=None, callback=None, refresh_event=None, retry_policy=None): # noqa: E501 + """MonitorSubscribe - a model defined in Swagger""" # noqa: E501 + + self._batch_notify = None + self._callback = None + self._refresh_event = None + self._retry_policy = None + self.discriminator = None + + if batch_notify is not None: + self.batch_notify = batch_notify + self.callback = callback + if refresh_event is not None: + self.refresh_event = refresh_event + if retry_policy is not None: + self.retry_policy = retry_policy + + @property + def batch_notify(self): + """Gets the batch_notify of this MonitorSubscribe. # noqa: E501 + + + :return: The batch_notify of this MonitorSubscribe. # noqa: E501 + :rtype: MonitorSubscribeBatchNotify + """ + return self._batch_notify + + @batch_notify.setter + def batch_notify(self, batch_notify): + """Sets the batch_notify of this MonitorSubscribe. + + + :param batch_notify: The batch_notify of this MonitorSubscribe. # noqa: E501 + :type: MonitorSubscribeBatchNotify + """ + + self._batch_notify = batch_notify + + @property + def callback(self): + """Gets the callback of this MonitorSubscribe. # noqa: E501 + + + :return: The callback of this MonitorSubscribe. # noqa: E501 + :rtype: MonitorWebhook + """ + return self._callback + + @callback.setter + def callback(self, callback): + """Sets the callback of this MonitorSubscribe. + + + :param callback: The callback of this MonitorSubscribe. # noqa: E501 + :type: MonitorWebhook + """ + if callback is None: + raise ValueError("Invalid value for `callback`, must not be `None`") # noqa: E501 + + self._callback = callback + + @property + def refresh_event(self): + """Gets the refresh_event of this MonitorSubscribe. # noqa: E501 + + Define the period (in sec.) between two refresh events. The refresh-events are sent when the condition of the monitor is satisfied (Trigger -> toggled true).A kind of periodic reminder. # noqa: E501 + + :return: The refresh_event of this MonitorSubscribe. # noqa: E501 + :rtype: float + """ + return self._refresh_event + + @refresh_event.setter + def refresh_event(self, refresh_event): + """Sets the refresh_event of this MonitorSubscribe. + + Define the period (in sec.) between two refresh events. The refresh-events are sent when the condition of the monitor is satisfied (Trigger -> toggled true).A kind of periodic reminder. # noqa: E501 + + :param refresh_event: The refresh_event of this MonitorSubscribe. # noqa: E501 + :type: float + """ + if refresh_event is not None and refresh_event < 60: # noqa: E501 + raise ValueError("Invalid value for `refresh_event`, must be a value greater than or equal to `60`") # noqa: E501 + + self._refresh_event = refresh_event + + @property + def retry_policy(self): + """Gets the retry_policy of this MonitorSubscribe. # noqa: E501 + + + :return: The retry_policy of this MonitorSubscribe. # noqa: E501 + :rtype: MonitorSubscribeRetryPolicy + """ + return self._retry_policy + + @retry_policy.setter + def retry_policy(self, retry_policy): + """Sets the retry_policy of this MonitorSubscribe. + + + :param retry_policy: The retry_policy of this MonitorSubscribe. # noqa: E501 + :type: MonitorSubscribeRetryPolicy + """ + + self._retry_policy = retry_policy + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorSubscribe, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorSubscribe): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_subscribe_batch_notify.py b/psa_connectedcar/models/monitor_subscribe_batch_notify.py new file mode 100644 index 0000000..923c166 --- /dev/null +++ b/psa_connectedcar/models/monitor_subscribe_batch_notify.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorSubscribeBatchNotify(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'size': 'float', + 'time_window': 'float' + } + + attribute_map = { + 'size': 'size', + 'time_window': 'timeWindow' + } + + def __init__(self, size=None, time_window=None): # noqa: E501 + """MonitorSubscribeBatchNotify - a model defined in Swagger""" # noqa: E501 + + self._size = None + self._time_window = None + self.discriminator = None + + if size is not None: + self.size = size + if time_window is not None: + self.time_window = time_window + + @property + def size(self): + """Gets the size of this MonitorSubscribeBatchNotify. # noqa: E501 + + Batch size # noqa: E501 + + :return: The size of this MonitorSubscribeBatchNotify. # noqa: E501 + :rtype: float + """ + return self._size + + @size.setter + def size(self, size): + """Sets the size of this MonitorSubscribeBatchNotify. + + Batch size # noqa: E501 + + :param size: The size of this MonitorSubscribeBatchNotify. # noqa: E501 + :type: float + """ + + self._size = size + + @property + def time_window(self): + """Gets the time_window of this MonitorSubscribeBatchNotify. # noqa: E501 + + Notification batch window size (expressed in seconds). # noqa: E501 + + :return: The time_window of this MonitorSubscribeBatchNotify. # noqa: E501 + :rtype: float + """ + return self._time_window + + @time_window.setter + def time_window(self, time_window): + """Sets the time_window of this MonitorSubscribeBatchNotify. + + Notification batch window size (expressed in seconds). # noqa: E501 + + :param time_window: The time_window of this MonitorSubscribeBatchNotify. # noqa: E501 + :type: float + """ + if time_window is not None and time_window < 60: # noqa: E501 + raise ValueError("Invalid value for `time_window`, must be a value greater than or equal to `60`") # noqa: E501 + + self._time_window = time_window + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorSubscribeBatchNotify, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorSubscribeBatchNotify): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_subscribe_retry_policy.py b/psa_connectedcar/models/monitor_subscribe_retry_policy.py new file mode 100644 index 0000000..55f981a --- /dev/null +++ b/psa_connectedcar/models/monitor_subscribe_retry_policy.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorSubscribeRetryPolicy(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'max_retry_number': 'int', + 'policy': 'str', + 'retry_delay': 'int' + } + + attribute_map = { + 'max_retry_number': 'maxRetryNumber', + 'policy': 'policy', + 'retry_delay': 'retryDelay' + } + + def __init__(self, max_retry_number=None, policy=None, retry_delay=None): # noqa: E501 + """MonitorSubscribeRetryPolicy - a model defined in Swagger""" # noqa: E501 + + self._max_retry_number = None + self._policy = None + self._retry_delay = None + self.discriminator = None + + if max_retry_number is not None: + self.max_retry_number = max_retry_number + self.policy = policy + if retry_delay is not None: + self.retry_delay = retry_delay + + @property + def max_retry_number(self): + """Gets the max_retry_number of this MonitorSubscribeRetryPolicy. # noqa: E501 + + Maximum number of attempts (to be used with retryPolicy set to Bounded). # noqa: E501 + + :return: The max_retry_number of this MonitorSubscribeRetryPolicy. # noqa: E501 + :rtype: int + """ + return self._max_retry_number + + @max_retry_number.setter + def max_retry_number(self, max_retry_number): + """Sets the max_retry_number of this MonitorSubscribeRetryPolicy. + + Maximum number of attempts (to be used with retryPolicy set to Bounded). # noqa: E501 + + :param max_retry_number: The max_retry_number of this MonitorSubscribeRetryPolicy. # noqa: E501 + :type: int + """ + if max_retry_number is not None and max_retry_number < 1: # noqa: E501 + raise ValueError("Invalid value for `max_retry_number`, must be a value greater than or equal to `1`") # noqa: E501 + + self._max_retry_number = max_retry_number + + @property + def policy(self): + """Gets the policy of this MonitorSubscribeRetryPolicy. # noqa: E501 + + Defines the retry rules following a WebHook notification failure (ie the return code is not HTTP 2XX). '_None_' means with a single try, '_Bounded_' with a limited number of tries and '_Always_' with an infinite number of tries. # noqa: E501 + + :return: The policy of this MonitorSubscribeRetryPolicy. # noqa: E501 + :rtype: str + """ + return self._policy + + @policy.setter + def policy(self, policy): + """Sets the policy of this MonitorSubscribeRetryPolicy. + + Defines the retry rules following a WebHook notification failure (ie the return code is not HTTP 2XX). '_None_' means with a single try, '_Bounded_' with a limited number of tries and '_Always_' with an infinite number of tries. # noqa: E501 + + :param policy: The policy of this MonitorSubscribeRetryPolicy. # noqa: E501 + :type: str + """ + if policy is None: + raise ValueError("Invalid value for `policy`, must not be `None`") # noqa: E501 + allowed_values = ["None", "Bounded", "Always"] # noqa: E501 + if policy not in allowed_values: + raise ValueError( + "Invalid value for `policy` ({0}), must be one of {1}" # noqa: E501 + .format(policy, allowed_values) + ) + + self._policy = policy + + @property + def retry_delay(self): + """Gets the retry_delay of this MonitorSubscribeRetryPolicy. # noqa: E501 + + Time to wait (expressed in seconds) befor retrying to push a notification. # noqa: E501 + + :return: The retry_delay of this MonitorSubscribeRetryPolicy. # noqa: E501 + :rtype: int + """ + return self._retry_delay + + @retry_delay.setter + def retry_delay(self, retry_delay): + """Sets the retry_delay of this MonitorSubscribeRetryPolicy. + + Time to wait (expressed in seconds) befor retrying to push a notification. # noqa: E501 + + :param retry_delay: The retry_delay of this MonitorSubscribeRetryPolicy. # noqa: E501 + :type: int + """ + if retry_delay is not None and retry_delay < 1: # noqa: E501 + raise ValueError("Invalid value for `retry_delay`, must be a value greater than or equal to `1`") # noqa: E501 + + self._retry_delay = retry_delay + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorSubscribeRetryPolicy, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorSubscribeRetryPolicy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_trigger.py b/psa_connectedcar/models/monitor_trigger.py new file mode 100644 index 0000000..ce8f57c --- /dev/null +++ b/psa_connectedcar/models/monitor_trigger.py @@ -0,0 +1,196 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorTrigger(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'DataTrigger', + 'name': 'str', + 'time': 'TimeTrigger', + 'zone': 'ZoneTrigger' + } + + attribute_map = { + 'data': 'data', + 'name': 'name', + 'time': 'time', + 'zone': 'zone' + } + + def __init__(self, data=None, name=None, time=None, zone=None): # noqa: E501 + """MonitorTrigger - a model defined in Swagger""" # noqa: E501 + + self._data = None + self._name = None + self._time = None + self._zone = None + self.discriminator = None + + if data is not None: + self.data = data + self.name = name + if time is not None: + self.time = time + if zone is not None: + self.zone = zone + + @property + def data(self): + """Gets the data of this MonitorTrigger. # noqa: E501 + + + :return: The data of this MonitorTrigger. # noqa: E501 + :rtype: DataTrigger + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this MonitorTrigger. + + + :param data: The data of this MonitorTrigger. # noqa: E501 + :type: DataTrigger + """ + + self._data = data + + @property + def name(self): + """Gets the name of this MonitorTrigger. # noqa: E501 + + The trigger name(should be uniq) # noqa: E501 + + :return: The name of this MonitorTrigger. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this MonitorTrigger. + + The trigger name(should be uniq) # noqa: E501 + + :param name: The name of this MonitorTrigger. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def time(self): + """Gets the time of this MonitorTrigger. # noqa: E501 + + + :return: The time of this MonitorTrigger. # noqa: E501 + :rtype: TimeTrigger + """ + return self._time + + @time.setter + def time(self, time): + """Sets the time of this MonitorTrigger. + + + :param time: The time of this MonitorTrigger. # noqa: E501 + :type: TimeTrigger + """ + + self._time = time + + @property + def zone(self): + """Gets the zone of this MonitorTrigger. # noqa: E501 + + + :return: The zone of this MonitorTrigger. # noqa: E501 + :rtype: ZoneTrigger + """ + return self._zone + + @zone.setter + def zone(self, zone): + """Sets the zone of this MonitorTrigger. + + + :param zone: The zone of this MonitorTrigger. # noqa: E501 + :type: ZoneTrigger + """ + + self._zone = zone + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorTrigger, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorTrigger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_webhook.py b/psa_connectedcar/models/monitor_webhook.py new file mode 100644 index 0000000..f79e573 --- /dev/null +++ b/psa_connectedcar/models/monitor_webhook.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorWebhook(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'attributes': 'list[MonitorWebhookAttributes]', + 'name': 'str', + 'target': 'Url' + } + + attribute_map = { + 'attributes': 'attributes', + 'name': 'name', + 'target': 'target' + } + + def __init__(self, attributes=None, name=None, target=None): # noqa: E501 + """MonitorWebhook - a model defined in Swagger""" # noqa: E501 + + self._attributes = None + self._name = None + self._target = None + self.discriminator = None + + if attributes is not None: + self.attributes = attributes + self.name = name + self.target = target + + @property + def attributes(self): + """Gets the attributes of this MonitorWebhook. # noqa: E501 + + Additional attributes-set that can be used as http header enhencement (such as headers can be used as an authentication parameter when posting the event) or simply added to the notification event body (as set of key/values) or finally as additional query parameters. # noqa: E501 + + :return: The attributes of this MonitorWebhook. # noqa: E501 + :rtype: list[MonitorWebhookAttributes] + """ + return self._attributes + + @attributes.setter + def attributes(self, attributes): + """Sets the attributes of this MonitorWebhook. + + Additional attributes-set that can be used as http header enhencement (such as headers can be used as an authentication parameter when posting the event) or simply added to the notification event body (as set of key/values) or finally as additional query parameters. # noqa: E501 + + :param attributes: The attributes of this MonitorWebhook. # noqa: E501 + :type: list[MonitorWebhookAttributes] + """ + + self._attributes = attributes + + @property + def name(self): + """Gets the name of this MonitorWebhook. # noqa: E501 + + Webhook name. # noqa: E501 + + :return: The name of this MonitorWebhook. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this MonitorWebhook. + + Webhook name. # noqa: E501 + + :param name: The name of this MonitorWebhook. # noqa: E501 + :type: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def target(self): + """Gets the target of this MonitorWebhook. # noqa: E501 + + + :return: The target of this MonitorWebhook. # noqa: E501 + :rtype: Url + """ + return self._target + + @target.setter + def target(self, target): + """Sets the target of this MonitorWebhook. + + + :param target: The target of this MonitorWebhook. # noqa: E501 + :type: Url + """ + if target is None: + raise ValueError("Invalid value for `target`, must not be `None`") # noqa: E501 + + self._target = target + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorWebhook, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorWebhook): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitor_webhook_attributes.py b/psa_connectedcar/models/monitor_webhook_attributes.py new file mode 100644 index 0000000..34cb340 --- /dev/null +++ b/psa_connectedcar/models/monitor_webhook_attributes.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorWebhookAttributes(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'key': 'str', + 'type': 'str', + 'value': 'object' + } + + attribute_map = { + 'key': 'key', + 'type': 'type', + 'value': 'value' + } + + def __init__(self, key=None, type=None, value=None): # noqa: E501 + """MonitorWebhookAttributes - a model defined in Swagger""" # noqa: E501 + + self._key = None + self._type = None + self._value = None + self.discriminator = None + + self.key = key + self.type = type + self.value = value + + @property + def key(self): + """Gets the key of this MonitorWebhookAttributes. # noqa: E501 + + + :return: The key of this MonitorWebhookAttributes. # noqa: E501 + :rtype: str + """ + return self._key + + @key.setter + def key(self, key): + """Sets the key of this MonitorWebhookAttributes. + + + :param key: The key of this MonitorWebhookAttributes. # noqa: E501 + :type: str + """ + if key is None: + raise ValueError("Invalid value for `key`, must not be `None`") # noqa: E501 + + self._key = key + + @property + def type(self): + """Gets the type of this MonitorWebhookAttributes. # noqa: E501 + + 3 attributes type: |Attribute-type|Role| |----------|-------------| |Header|-Will be add as http header extension \"x-######:\"| |Body|-Will be simply add to event body map attribute (see monitor event definition in template document)| |Query|-Will set as http query parameter when invoking the Webhook| # noqa: E501 + + :return: The type of this MonitorWebhookAttributes. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this MonitorWebhookAttributes. + + 3 attributes type: |Attribute-type|Role| |----------|-------------| |Header|-Will be add as http header extension \"x-######:\"| |Body|-Will be simply add to event body map attribute (see monitor event definition in template document)| |Query|-Will set as http query parameter when invoking the Webhook| # noqa: E501 + + :param type: The type of this MonitorWebhookAttributes. # noqa: E501 + :type: str + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["Header", "Body", "Query"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def value(self): + """Gets the value of this MonitorWebhookAttributes. # noqa: E501 + + + :return: The value of this MonitorWebhookAttributes. # noqa: E501 + :rtype: object + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this MonitorWebhookAttributes. + + + :param value: The value of this MonitorWebhookAttributes. # noqa: E501 + :type: object + """ + if value is None: + raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorWebhookAttributes, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorWebhookAttributes): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitors.py b/psa_connectedcar/models/monitors.py new file mode 100644 index 0000000..6fa1d60 --- /dev/null +++ b/psa_connectedcar/models/monitors.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Monitors(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'MonitorsEmbedded' + } + + attribute_map = { + 'embedded': '_embedded' + } + + def __init__(self, embedded=None): # noqa: E501 + """Monitors - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + + @property + def embedded(self): + """Gets the embedded of this Monitors. # noqa: E501 + + + :return: The embedded of this Monitors. # noqa: E501 + :rtype: MonitorsEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Monitors. + + + :param embedded: The embedded of this Monitors. # noqa: E501 + :type: MonitorsEmbedded + """ + + self._embedded = embedded + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Monitors, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Monitors): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/monitors_embedded.py b/psa_connectedcar/models/monitors_embedded.py new file mode 100644 index 0000000..4c7a121 --- /dev/null +++ b/psa_connectedcar/models/monitors_embedded.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class MonitorsEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'monitors': 'list[MonitorParameter]' + } + + attribute_map = { + 'monitors': 'monitors' + } + + def __init__(self, monitors=None): # noqa: E501 + """MonitorsEmbedded - a model defined in Swagger""" # noqa: E501 + + self._monitors = None + self.discriminator = None + + if monitors is not None: + self.monitors = monitors + + @property + def monitors(self): + """Gets the monitors of this MonitorsEmbedded. # noqa: E501 + + + :return: The monitors of this MonitorsEmbedded. # noqa: E501 + :rtype: list[MonitorParameter] + """ + return self._monitors + + @monitors.setter + def monitors(self, monitors): + """Sets the monitors of this MonitorsEmbedded. + + + :param monitors: The monitors of this MonitorsEmbedded. # noqa: E501 + :type: list[MonitorParameter] + """ + + self._monitors = monitors + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MonitorsEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MonitorsEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/overall_autonomy.py b/psa_connectedcar/models/overall_autonomy.py new file mode 100644 index 0000000..e170439 --- /dev/null +++ b/psa_connectedcar/models/overall_autonomy.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class OverallAutonomy(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'autonomy': 'float' + } + + attribute_map = { + 'autonomy': 'autonomy' + } + + def __init__(self, autonomy=None): # noqa: E501 + """OverallAutonomy - a model defined in Swagger""" # noqa: E501 + + self._autonomy = None + self.discriminator = None + + if autonomy is not None: + self.autonomy = autonomy + + @property + def autonomy(self): + """Gets the autonomy of this OverallAutonomy. # noqa: E501 + + Vehicle global autonomy expressed in KM. # noqa: E501 + + :return: The autonomy of this OverallAutonomy. # noqa: E501 + :rtype: float + """ + return self._autonomy + + @autonomy.setter + def autonomy(self, autonomy): + """Sets the autonomy of this OverallAutonomy. + + Vehicle global autonomy expressed in KM. # noqa: E501 + + :param autonomy: The autonomy of this OverallAutonomy. # noqa: E501 + :type: float + """ + + self._autonomy = autonomy + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(OverallAutonomy, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, OverallAutonomy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/point.py b/psa_connectedcar/models/point.py new file mode 100644 index 0000000..ab48906 --- /dev/null +++ b/psa_connectedcar/models/point.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Point(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'coordinates': 'Vect2D', + 'type': 'str' + } + + attribute_map = { + 'coordinates': 'coordinates', + 'type': 'type' + } + + def __init__(self, coordinates=None, type='Point'): # noqa: E501 + """Point - a model defined in Swagger""" # noqa: E501 + + self._coordinates = None + self._type = None + self.discriminator = None + + if coordinates is not None: + self.coordinates = coordinates + if type is not None: + self.type = type + + @property + def coordinates(self): + """Gets the coordinates of this Point. # noqa: E501 + + + :return: The coordinates of this Point. # noqa: E501 + :rtype: Vect2D + """ + return self._coordinates + + @coordinates.setter + def coordinates(self, coordinates): + """Sets the coordinates of this Point. + + + :param coordinates: The coordinates of this Point. # noqa: E501 + :type: Vect2D + """ + + self._coordinates = coordinates + + @property + def type(self): + """Gets the type of this Point. # noqa: E501 + + + :return: The type of this Point. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Point. + + + :param type: The type of this Point. # noqa: E501 + :type: str + """ + allowed_values = ["Point"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Point, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Point): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/polygon_zone.py b/psa_connectedcar/models/polygon_zone.py new file mode 100644 index 0000000..fe1f3ea --- /dev/null +++ b/psa_connectedcar/models/polygon_zone.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class PolygonZone(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'coordinates': 'list[Vect2D]', + 'type': 'str' + } + + attribute_map = { + 'coordinates': 'coordinates', + 'type': 'type' + } + + def __init__(self, coordinates=None, type='Polygon'): # noqa: E501 + """PolygonZone - a model defined in Swagger""" # noqa: E501 + + self._coordinates = None + self._type = None + self.discriminator = None + + if coordinates is not None: + self.coordinates = coordinates + if type is not None: + self.type = type + + @property + def coordinates(self): + """Gets the coordinates of this PolygonZone. # noqa: E501 + + + :return: The coordinates of this PolygonZone. # noqa: E501 + :rtype: list[Vect2D] + """ + return self._coordinates + + @coordinates.setter + def coordinates(self, coordinates): + """Sets the coordinates of this PolygonZone. + + + :param coordinates: The coordinates of this PolygonZone. # noqa: E501 + :type: list[Vect2D] + """ + + self._coordinates = coordinates + + @property + def type(self): + """Gets the type of this PolygonZone. # noqa: E501 + + + :return: The type of this PolygonZone. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PolygonZone. + + + :param type: The type of this PolygonZone. # noqa: E501 + :type: str + """ + allowed_values = ["Polygon"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PolygonZone, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PolygonZone): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/position.py b/psa_connectedcar/models/position.py new file mode 100644 index 0000000..0c7ed7e --- /dev/null +++ b/psa_connectedcar/models/position.py @@ -0,0 +1,202 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Position(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime', + 'geometry': 'Point', + 'properties': 'PositionProperties', + 'type': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'geometry': 'geometry', + 'properties': 'properties', + 'type': 'type' + } + + def __init__(self, created_at=None, geometry=None, properties=None, type='Feature'): # noqa: E501 + """Position - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self._geometry = None + self._properties = None + self._type = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if geometry is not None: + self.geometry = geometry + self.properties = properties + if type is not None: + self.type = type + + @property + def created_at(self): + """Gets the created_at of this Position. # noqa: E501 + + Date when the resource has been created. # noqa: E501 + + :return: The created_at of this Position. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this Position. + + Date when the resource has been created. # noqa: E501 + + :param created_at: The created_at of this Position. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def geometry(self): + """Gets the geometry of this Position. # noqa: E501 + + + :return: The geometry of this Position. # noqa: E501 + :rtype: Point + """ + return self._geometry + + @geometry.setter + def geometry(self, geometry): + """Sets the geometry of this Position. + + + :param geometry: The geometry of this Position. # noqa: E501 + :type: Point + """ + + self._geometry = geometry + + @property + def properties(self): + """Gets the properties of this Position. # noqa: E501 + + + :return: The properties of this Position. # noqa: E501 + :rtype: PositionProperties + """ + return self._properties + + @properties.setter + def properties(self, properties): + """Sets the properties of this Position. + + + :param properties: The properties of this Position. # noqa: E501 + :type: PositionProperties + """ + if properties is None: + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + @property + def type(self): + """Gets the type of this Position. # noqa: E501 + + + :return: The type of this Position. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this Position. + + + :param type: The type of this Position. # noqa: E501 + :type: str + """ + allowed_values = ["Feature"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Position, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Position): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/position_properties.py b/psa_connectedcar/models/position_properties.py new file mode 100644 index 0000000..e5164ad --- /dev/null +++ b/psa_connectedcar/models/position_properties.py @@ -0,0 +1,177 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class PositionProperties(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'heading': 'float', + 'signal_quality': 'float', + 'type': 'str' + } + + attribute_map = { + 'heading': 'heading', + 'signal_quality': 'signalQuality', + 'type': 'type' + } + + def __init__(self, heading=None, signal_quality=None, type=None): # noqa: E501 + """PositionProperties - a model defined in Swagger""" # noqa: E501 + + self._heading = None + self._signal_quality = None + self._type = None + self.discriminator = None + + if heading is not None: + self.heading = heading + if signal_quality is not None: + self.signal_quality = signal_quality + if type is not None: + self.type = type + + @property + def heading(self): + """Gets the heading of this PositionProperties. # noqa: E501 + + + :return: The heading of this PositionProperties. # noqa: E501 + :rtype: float + """ + return self._heading + + @heading.setter + def heading(self, heading): + """Sets the heading of this PositionProperties. + + + :param heading: The heading of this PositionProperties. # noqa: E501 + :type: float + """ + if heading is not None and heading > 360: # noqa: E501 + raise ValueError("Invalid value for `heading`, must be a value less than or equal to `360`") # noqa: E501 + if heading is not None and heading < 0: # noqa: E501 + raise ValueError("Invalid value for `heading`, must be a value greater than or equal to `0`") # noqa: E501 + + self._heading = heading + + @property + def signal_quality(self): + """Gets the signal_quality of this PositionProperties. # noqa: E501 + + + :return: The signal_quality of this PositionProperties. # noqa: E501 + :rtype: float + """ + return self._signal_quality + + @signal_quality.setter + def signal_quality(self, signal_quality): + """Sets the signal_quality of this PositionProperties. + + + :param signal_quality: The signal_quality of this PositionProperties. # noqa: E501 + :type: float + """ + + self._signal_quality = signal_quality + + @property + def type(self): + """Gets the type of this PositionProperties. # noqa: E501 + + + :return: The type of this PositionProperties. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PositionProperties. + + + :param type: The type of this PositionProperties. # noqa: E501 + :type: str + """ + allowed_values = ["Estimated", "Acquired", "Estimate", "Aquire"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PositionProperties, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PositionProperties): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/preconditioning.py b/psa_connectedcar/models/preconditioning.py new file mode 100644 index 0000000..0a37a23 --- /dev/null +++ b/psa_connectedcar/models/preconditioning.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Preconditioning(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'air_conditioning': 'PreconditioningAirConditioning' + } + + attribute_map = { + 'air_conditioning': 'airConditioning' + } + + def __init__(self, air_conditioning=None): # noqa: E501 + """Preconditioning - a model defined in Swagger""" # noqa: E501 + + self._air_conditioning = None + self.discriminator = None + + if air_conditioning is not None: + self.air_conditioning = air_conditioning + + @property + def air_conditioning(self): + """Gets the air_conditioning of this Preconditioning. # noqa: E501 + + + :return: The air_conditioning of this Preconditioning. # noqa: E501 + :rtype: PreconditioningAirConditioning + """ + return self._air_conditioning + + @air_conditioning.setter + def air_conditioning(self, air_conditioning): + """Sets the air_conditioning of this Preconditioning. + + + :param air_conditioning: The air_conditioning of this Preconditioning. # noqa: E501 + :type: PreconditioningAirConditioning + """ + + self._air_conditioning = air_conditioning + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Preconditioning, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Preconditioning): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/preconditioning_air_conditioning.py b/psa_connectedcar/models/preconditioning_air_conditioning.py new file mode 100644 index 0000000..b5853a7 --- /dev/null +++ b/psa_connectedcar/models/preconditioning_air_conditioning.py @@ -0,0 +1,209 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class PreconditioningAirConditioning(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'failure_cause': 'str', + 'programs': 'list[PreconditioningProgram]', + 'status': 'str', + 'updated_at': 'datetime' + } + + attribute_map = { + 'failure_cause': 'failureCause', + 'programs': 'programs', + 'status': 'status', + 'updated_at': 'updatedAt' + } + + def __init__(self, failure_cause=None, programs=None, status=None, updated_at=None): # noqa: E501 + """PreconditioningAirConditioning - a model defined in Swagger""" # noqa: E501 + + self._failure_cause = None + self._programs = None + self._status = None + self._updated_at = None + self.discriminator = None + + if failure_cause is not None: + self.failure_cause = failure_cause + if programs is not None: + self.programs = programs + if status is not None: + self.status = status + if updated_at is not None: + self.updated_at = updated_at + + @property + def failure_cause(self): + """Gets the failure_cause of this PreconditioningAirConditioning. # noqa: E501 + + failure cause # noqa: E501 + + :return: The failure_cause of this PreconditioningAirConditioning. # noqa: E501 + :rtype: str + """ + return self._failure_cause + + @failure_cause.setter + def failure_cause(self, failure_cause): + """Sets the failure_cause of this PreconditioningAirConditioning. + + failure cause # noqa: E501 + + :param failure_cause: The failure_cause of this PreconditioningAirConditioning. # noqa: E501 + :type: str + """ + allowed_values = ["Defect", "DoorOpened", "LowBattery", "LowFuelLevel", "TooManyUnusedProg"] # noqa: E501 + if failure_cause not in allowed_values: + raise ValueError( + "Invalid value for `failure_cause` ({0}), must be one of {1}" # noqa: E501 + .format(failure_cause, allowed_values) + ) + + self._failure_cause = failure_cause + + @property + def programs(self): + """Gets the programs of this PreconditioningAirConditioning. # noqa: E501 + + + :return: The programs of this PreconditioningAirConditioning. # noqa: E501 + :rtype: list[PreconditioningProgram] + """ + return self._programs + + @programs.setter + def programs(self, programs): + """Sets the programs of this PreconditioningAirConditioning. + + + :param programs: The programs of this PreconditioningAirConditioning. # noqa: E501 + :type: list[PreconditioningProgram] + """ + + self._programs = programs + + @property + def status(self): + """Gets the status of this PreconditioningAirConditioning. # noqa: E501 + + The status of the preconditionning feature. # noqa: E501 + + :return: The status of this PreconditioningAirConditioning. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this PreconditioningAirConditioning. + + The status of the preconditionning feature. # noqa: E501 + + :param status: The status of this PreconditioningAirConditioning. # noqa: E501 + :type: str + """ + allowed_values = ["Enabled", "Disabled", "Finished", "Failure"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def updated_at(self): + """Gets the updated_at of this PreconditioningAirConditioning. # noqa: E501 + + + :return: The updated_at of this PreconditioningAirConditioning. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this PreconditioningAirConditioning. + + + :param updated_at: The updated_at of this PreconditioningAirConditioning. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PreconditioningAirConditioning, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PreconditioningAirConditioning): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/preconditioning_program.py b/psa_connectedcar/models/preconditioning_program.py new file mode 100644 index 0000000..ceff618 --- /dev/null +++ b/psa_connectedcar/models/preconditioning_program.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class PreconditioningProgram(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """PreconditioningProgram - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PreconditioningProgram, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PreconditioningProgram): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/privacy.py b/psa_connectedcar/models/privacy.py new file mode 100644 index 0000000..29bd7e7 --- /dev/null +++ b/psa_connectedcar/models/privacy.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Privacy(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'state': 'str' + } + + attribute_map = { + 'state': 'state' + } + + def __init__(self, state=None): # noqa: E501 + """Privacy - a model defined in Swagger""" # noqa: E501 + + self._state = None + self.discriminator = None + + if state is not None: + self.state = state + + @property + def state(self): + """Gets the state of this Privacy. # noqa: E501 + + + :return: The state of this Privacy. # noqa: E501 + :rtype: str + """ + return self._state + + @state.setter + def state(self, state): + """Sets the state of this Privacy. + + + :param state: The state of this Privacy. # noqa: E501 + :type: str + """ + allowed_values = ["None", "Geolocation", "Full"] # noqa: E501 + if state not in allowed_values: + raise ValueError( + "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 + .format(state, allowed_values) + ) + + self._state = state + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Privacy, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Privacy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/program.py b/psa_connectedcar/models/program.py new file mode 100644 index 0000000..3d74372 --- /dev/null +++ b/psa_connectedcar/models/program.py @@ -0,0 +1,180 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Program(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'occurence': 'ProgramOccurence', + 'recurrence': 'str', + 'start': 'str' + } + + attribute_map = { + 'occurence': 'occurence', + 'recurrence': 'recurrence', + 'start': 'start' + } + + def __init__(self, occurence=None, recurrence='Daily', start=None): # noqa: E501 + """Program - a model defined in Swagger""" # noqa: E501 + + self._occurence = None + self._recurrence = None + self._start = None + self.discriminator = None + + self.occurence = occurence + self.recurrence = recurrence + self.start = start + + @property + def occurence(self): + """Gets the occurence of this Program. # noqa: E501 + + + :return: The occurence of this Program. # noqa: E501 + :rtype: ProgramOccurence + """ + return self._occurence + + @occurence.setter + def occurence(self, occurence): + """Sets the occurence of this Program. + + + :param occurence: The occurence of this Program. # noqa: E501 + :type: ProgramOccurence + """ + if occurence is None: + raise ValueError("Invalid value for `occurence`, must not be `None`") # noqa: E501 + + self._occurence = occurence + + @property + def recurrence(self): + """Gets the recurrence of this Program. # noqa: E501 + + Determines the recurrence of the program. * None: means no recurrence. * Daily: repeated over the week. * Weekly: repeated over the weeks of the year from w1 to w52 specified in an array unitary or grouped by ranges (w1, w2,w34-w46, w52). # noqa: E501 + + :return: The recurrence of this Program. # noqa: E501 + :rtype: str + """ + return self._recurrence + + @recurrence.setter + def recurrence(self, recurrence): + """Sets the recurrence of this Program. + + Determines the recurrence of the program. * None: means no recurrence. * Daily: repeated over the week. * Weekly: repeated over the weeks of the year from w1 to w52 specified in an array unitary or grouped by ranges (w1, w2,w34-w46, w52). # noqa: E501 + + :param recurrence: The recurrence of this Program. # noqa: E501 + :type: str + """ + if recurrence is None: + raise ValueError("Invalid value for `recurrence`, must not be `None`") # noqa: E501 + allowed_values = ["None", "Daily", "Weekly"] # noqa: E501 + if recurrence not in allowed_values: + raise ValueError( + "Invalid value for `recurrence` ({0}), must be one of {1}" # noqa: E501 + .format(recurrence, allowed_values) + ) + + self._recurrence = recurrence + + @property + def start(self): + """Gets the start of this Program. # noqa: E501 + + The program start time formatted using the duration format based on [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) with the schema: P[n]Y[n]M[n]DT[n]H[n]M[n]S _example_: * PT14H30M : 14H30min # noqa: E501 + + :return: The start of this Program. # noqa: E501 + :rtype: str + """ + return self._start + + @start.setter + def start(self, start): + """Sets the start of this Program. + + The program start time formatted using the duration format based on [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals) with the schema: P[n]Y[n]M[n]DT[n]H[n]M[n]S _example_: * PT14H30M : 14H30min # noqa: E501 + + :param start: The start of this Program. # noqa: E501 + :type: str + """ + if start is None: + raise ValueError("Invalid value for `start`, must not be `None`") # noqa: E501 + + self._start = start + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Program, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Program): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/program_occurence.py b/psa_connectedcar/models/program_occurence.py new file mode 100644 index 0000000..65ec5e5 --- /dev/null +++ b/psa_connectedcar/models/program_occurence.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ProgramOccurence(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'day': 'list[str]', + 'week': 'list[str]' + } + + attribute_map = { + 'day': 'day', + 'week': 'week' + } + + def __init__(self, day=None, week=None): # noqa: E501 + """ProgramOccurence - a model defined in Swagger""" # noqa: E501 + + self._day = None + self._week = None + self.discriminator = None + + self.day = day + if week is not None: + self.week = week + + @property + def day(self): + """Gets the day of this ProgramOccurence. # noqa: E501 + + + :return: The day of this ProgramOccurence. # noqa: E501 + :rtype: list[str] + """ + return self._day + + @day.setter + def day(self, day): + """Sets the day of this ProgramOccurence. + + + :param day: The day of this ProgramOccurence. # noqa: E501 + :type: list[str] + """ + if day is None: + raise ValueError("Invalid value for `day`, must not be `None`") # noqa: E501 + allowed_values = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] # noqa: E501 + if not set(day).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `day` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(day) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._day = day + + @property + def week(self): + """Gets the week of this ProgramOccurence. # noqa: E501 + + + :return: The week of this ProgramOccurence. # noqa: E501 + :rtype: list[str] + """ + return self._week + + @week.setter + def week(self, week): + """Sets the week of this ProgramOccurence. + + + :param week: The week of this ProgramOccurence. # noqa: E501 + :type: list[str] + """ + + self._week = week + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ProgramOccurence, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ProgramOccurence): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/safety.py b/psa_connectedcar/models/safety.py new file mode 100644 index 0000000..d956c43 --- /dev/null +++ b/psa_connectedcar/models/safety.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Safety(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'belt_warning': 'str', + 'e_call_triggering_request': 'str' + } + + attribute_map = { + 'belt_warning': 'beltWarning', + 'e_call_triggering_request': 'eCallTriggeringRequest' + } + + def __init__(self, belt_warning=None, e_call_triggering_request=None): # noqa: E501 + """Safety - a model defined in Swagger""" # noqa: E501 + + self._belt_warning = None + self._e_call_triggering_request = None + self.discriminator = None + + if belt_warning is not None: + self.belt_warning = belt_warning + if e_call_triggering_request is not None: + self.e_call_triggering_request = e_call_triggering_request + + @property + def belt_warning(self): + """Gets the belt_warning of this Safety. # noqa: E501 + + + :return: The belt_warning of this Safety. # noqa: E501 + :rtype: str + """ + return self._belt_warning + + @belt_warning.setter + def belt_warning(self, belt_warning): + """Sets the belt_warning of this Safety. + + + :param belt_warning: The belt_warning of this Safety. # noqa: E501 + :type: str + """ + allowed_values = ["Normal", "Omission"] # noqa: E501 + if belt_warning not in allowed_values: + raise ValueError( + "Invalid value for `belt_warning` ({0}), must be one of {1}" # noqa: E501 + .format(belt_warning, allowed_values) + ) + + self._belt_warning = belt_warning + + @property + def e_call_triggering_request(self): + """Gets the e_call_triggering_request of this Safety. # noqa: E501 + + + :return: The e_call_triggering_request of this Safety. # noqa: E501 + :rtype: str + """ + return self._e_call_triggering_request + + @e_call_triggering_request.setter + def e_call_triggering_request(self, e_call_triggering_request): + """Sets the e_call_triggering_request of this Safety. + + + :param e_call_triggering_request: The e_call_triggering_request of this Safety. # noqa: E501 + :type: str + """ + allowed_values = ["AirbagUnabled", "NoRequest", "Requested"] # noqa: E501 + if e_call_triggering_request not in allowed_values: + raise ValueError( + "Invalid value for `e_call_triggering_request` ({0}), must be one of {1}" # noqa: E501 + .format(e_call_triggering_request, allowed_values) + ) + + self._e_call_triggering_request = e_call_triggering_request + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Safety, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Safety): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/service_type.py b/psa_connectedcar/models/service_type.py new file mode 100644 index 0000000..c2f4a2d --- /dev/null +++ b/psa_connectedcar/models/service_type.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ServiceType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'type': 'str', + 'updated_at': 'datetime' + } + + attribute_map = { + 'type': 'type', + 'updated_at': 'updatedAt' + } + + def __init__(self, type=None, updated_at=None): # noqa: E501 + """ServiceType - a model defined in Swagger""" # noqa: E501 + + self._type = None + self._updated_at = None + self.discriminator = None + + if type is not None: + self.type = type + if updated_at is not None: + self.updated_at = updated_at + + @property + def type(self): + """Gets the type of this ServiceType. # noqa: E501 + + + :return: The type of this ServiceType. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ServiceType. + + + :param type: The type of this ServiceType. # noqa: E501 + :type: str + """ + allowed_values = ["Electric", "Hybrid", "Unknown"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def updated_at(self): + """Gets the updated_at of this ServiceType. # noqa: E501 + + + :return: The updated_at of this ServiceType. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this ServiceType. + + + :param updated_at: The updated_at of this ServiceType. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ServiceType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ServiceType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/status.py b/psa_connectedcar/models/status.py new file mode 100644 index 0000000..87698f9 --- /dev/null +++ b/psa_connectedcar/models/status.py @@ -0,0 +1,430 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Status(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'StatusEmbedded', + 'links': 'StatusLinks', + 'battery': 'Battery', + 'doors_state': 'DoorsState', + 'energy': 'list[Energy]', + 'environment': 'Environment', + 'ignition': 'Ignition', + 'kinetic': 'Kinetic', + 'last_position': 'Position', + 'preconditionning': 'Preconditioning', + 'privacy': 'Privacy', + 'safety': 'Safety', + 'service': 'ServiceType' + } + + attribute_map = { + 'embedded': '_embedded', + 'links': '_links', + 'battery': 'battery', + 'doors_state': 'doorsState', + 'energy': 'energy', + 'environment': 'environment', + 'ignition': 'ignition', + 'kinetic': 'kinetic', + 'last_position': 'lastPosition', + 'preconditionning': 'preconditionning', + 'privacy': 'privacy', + 'safety': 'safety', + 'service': 'service' + } + + def __init__(self, embedded=None, links=None, battery=None, doors_state=None, energy=None, environment=None, ignition=None, kinetic=None, last_position=None, preconditionning=None, privacy=None, safety=None, service=None): # noqa: E501 + """Status - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self._links = None + self._battery = None + self._doors_state = None + self._energy = None + self._environment = None + self._ignition = None + self._kinetic = None + self._last_position = None + self._preconditionning = None + self._privacy = None + self._safety = None + self._service = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + self.links = links + if battery is not None: + self.battery = battery + if doors_state is not None: + self.doors_state = doors_state + if energy is not None: + self.energy = energy + if environment is not None: + self.environment = environment + if ignition is not None: + self.ignition = ignition + if kinetic is not None: + self.kinetic = kinetic + if last_position is not None: + self.last_position = last_position + if preconditionning is not None: + self.preconditionning = preconditionning + if privacy is not None: + self.privacy = privacy + if safety is not None: + self.safety = safety + if service is not None: + self.service = service + + @property + def embedded(self): + """Gets the embedded of this Status. # noqa: E501 + + + :return: The embedded of this Status. # noqa: E501 + :rtype: StatusEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Status. + + + :param embedded: The embedded of this Status. # noqa: E501 + :type: StatusEmbedded + """ + + self._embedded = embedded + + @property + def links(self): + """Gets the links of this Status. # noqa: E501 + + + :return: The links of this Status. # noqa: E501 + :rtype: StatusLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Status. + + + :param links: The links of this Status. # noqa: E501 + :type: StatusLinks + """ + if links is None: + raise ValueError("Invalid value for `links`, must not be `None`") # noqa: E501 + + self._links = links + + @property + def battery(self): + """Gets the battery of this Status. # noqa: E501 + + + :return: The battery of this Status. # noqa: E501 + :rtype: Battery + """ + return self._battery + + @battery.setter + def battery(self, battery): + """Sets the battery of this Status. + + + :param battery: The battery of this Status. # noqa: E501 + :type: Battery + """ + + self._battery = battery + + @property + def doors_state(self): + """Gets the doors_state of this Status. # noqa: E501 + + + :return: The doors_state of this Status. # noqa: E501 + :rtype: DoorsState + """ + return self._doors_state + + @doors_state.setter + def doors_state(self, doors_state): + """Sets the doors_state of this Status. + + + :param doors_state: The doors_state of this Status. # noqa: E501 + :type: DoorsState + """ + + self._doors_state = doors_state + + @property + def energy(self): + """Gets the energy of this Status. # noqa: E501 + + Describe vehicle energy supply for thermic, low emission vehicle or both. # noqa: E501 + + :return: The energy of this Status. # noqa: E501 + :rtype: list[Energy] + """ + return self._energy + + @energy.setter + def energy(self, energy): + """Sets the energy of this Status. + + Describe vehicle energy supply for thermic, low emission vehicle or both. # noqa: E501 + + :param energy: The energy of this Status. # noqa: E501 + :type: list[Energy] + """ + + self._energy = energy + + @property + def environment(self): + """Gets the environment of this Status. # noqa: E501 + + + :return: The environment of this Status. # noqa: E501 + :rtype: Environment + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this Status. + + + :param environment: The environment of this Status. # noqa: E501 + :type: Environment + """ + + self._environment = environment + + @property + def ignition(self): + """Gets the ignition of this Status. # noqa: E501 + + + :return: The ignition of this Status. # noqa: E501 + :rtype: Ignition + """ + return self._ignition + + @ignition.setter + def ignition(self, ignition): + """Sets the ignition of this Status. + + + :param ignition: The ignition of this Status. # noqa: E501 + :type: Ignition + """ + + self._ignition = ignition + + @property + def kinetic(self): + """Gets the kinetic of this Status. # noqa: E501 + + + :return: The kinetic of this Status. # noqa: E501 + :rtype: Kinetic + """ + return self._kinetic + + @kinetic.setter + def kinetic(self, kinetic): + """Sets the kinetic of this Status. + + + :param kinetic: The kinetic of this Status. # noqa: E501 + :type: Kinetic + """ + + self._kinetic = kinetic + + @property + def last_position(self): + """Gets the last_position of this Status. # noqa: E501 + + + :return: The last_position of this Status. # noqa: E501 + :rtype: Position + """ + return self._last_position + + @last_position.setter + def last_position(self, last_position): + """Sets the last_position of this Status. + + + :param last_position: The last_position of this Status. # noqa: E501 + :type: Position + """ + + self._last_position = last_position + + @property + def preconditionning(self): + """Gets the preconditionning of this Status. # noqa: E501 + + + :return: The preconditionning of this Status. # noqa: E501 + :rtype: Preconditioning + """ + return self._preconditionning + + @preconditionning.setter + def preconditionning(self, preconditionning): + """Sets the preconditionning of this Status. + + + :param preconditionning: The preconditionning of this Status. # noqa: E501 + :type: Preconditioning + """ + + self._preconditionning = preconditionning + + @property + def privacy(self): + """Gets the privacy of this Status. # noqa: E501 + + + :return: The privacy of this Status. # noqa: E501 + :rtype: Privacy + """ + return self._privacy + + @privacy.setter + def privacy(self, privacy): + """Sets the privacy of this Status. + + + :param privacy: The privacy of this Status. # noqa: E501 + :type: Privacy + """ + + self._privacy = privacy + + @property + def safety(self): + """Gets the safety of this Status. # noqa: E501 + + + :return: The safety of this Status. # noqa: E501 + :rtype: Safety + """ + return self._safety + + @safety.setter + def safety(self, safety): + """Sets the safety of this Status. + + + :param safety: The safety of this Status. # noqa: E501 + :type: Safety + """ + + self._safety = safety + + @property + def service(self): + """Gets the service of this Status. # noqa: E501 + + + :return: The service of this Status. # noqa: E501 + :rtype: ServiceType + """ + return self._service + + @service.setter + def service(self, service): + """Sets the service of this Status. + + + :param service: The service of this Status. # noqa: E501 + :type: ServiceType + """ + + self._service = service + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Status, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Status): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/status_embedded.py b/psa_connectedcar/models/status_embedded.py new file mode 100644 index 0000000..e3ff47c --- /dev/null +++ b/psa_connectedcar/models/status_embedded.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class StatusEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'extension': 'Extension' + } + + attribute_map = { + 'extension': 'extension' + } + + def __init__(self, extension=None): # noqa: E501 + """StatusEmbedded - a model defined in Swagger""" # noqa: E501 + + self._extension = None + self.discriminator = None + + if extension is not None: + self.extension = extension + + @property + def extension(self): + """Gets the extension of this StatusEmbedded. # noqa: E501 + + + :return: The extension of this StatusEmbedded. # noqa: E501 + :rtype: Extension + """ + return self._extension + + @extension.setter + def extension(self, extension): + """Sets the extension of this StatusEmbedded. + + + :param extension: The extension of this StatusEmbedded. # noqa: E501 + :type: Extension + """ + + self._extension = extension + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StatusEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StatusEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/status_extension_type.py b/psa_connectedcar/models/status_extension_type.py new file mode 100644 index 0000000..dc81a1e --- /dev/null +++ b/psa_connectedcar/models/status_extension_type.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class StatusExtensionType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """StatusExtensionType - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StatusExtensionType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StatusExtensionType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/status_links.py b/psa_connectedcar/models/status_links.py new file mode 100644 index 0000000..cfa33de --- /dev/null +++ b/psa_connectedcar/models/status_links.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class StatusLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_self': 'Link', + 'vehicle': 'Link' + } + + attribute_map = { + '_self': 'self', + 'vehicle': 'vehicle' + } + + def __init__(self, _self=None, vehicle=None): # noqa: E501 + """StatusLinks - a model defined in Swagger""" # noqa: E501 + + self.__self = None + self._vehicle = None + self.discriminator = None + + if _self is not None: + self._self = _self + if vehicle is not None: + self.vehicle = vehicle + + @property + def _self(self): + """Gets the _self of this StatusLinks. # noqa: E501 + + + :return: The _self of this StatusLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this StatusLinks. + + + :param _self: The _self of this StatusLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + @property + def vehicle(self): + """Gets the vehicle of this StatusLinks. # noqa: E501 + + + :return: The vehicle of this StatusLinks. # noqa: E501 + :rtype: Link + """ + return self._vehicle + + @vehicle.setter + def vehicle(self, vehicle): + """Sets the vehicle of this StatusLinks. + + + :param vehicle: The vehicle of this StatusLinks. # noqa: E501 + :type: Link + """ + + self._vehicle = vehicle + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(StatusLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StatusLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/tab_links.py b/psa_connectedcar/models/tab_links.py new file mode 100644 index 0000000..8b42433 --- /dev/null +++ b/psa_connectedcar/models/tab_links.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TabLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'first': 'Link', + 'last': 'Link', + 'next': 'Link', + 'prev': 'Link', + '_self': 'Link' + } + + attribute_map = { + 'first': 'first', + 'last': 'last', + 'next': 'next', + 'prev': 'prev', + '_self': 'self' + } + + def __init__(self, first=None, last=None, next=None, prev=None, _self=None): # noqa: E501 + """TabLinks - a model defined in Swagger""" # noqa: E501 + + self._first = None + self._last = None + self._next = None + self._prev = None + self.__self = None + self.discriminator = None + + if first is not None: + self.first = first + if last is not None: + self.last = last + if next is not None: + self.next = next + if prev is not None: + self.prev = prev + if _self is not None: + self._self = _self + + @property + def first(self): + """Gets the first of this TabLinks. # noqa: E501 + + + :return: The first of this TabLinks. # noqa: E501 + :rtype: Link + """ + return self._first + + @first.setter + def first(self, first): + """Sets the first of this TabLinks. + + + :param first: The first of this TabLinks. # noqa: E501 + :type: Link + """ + + self._first = first + + @property + def last(self): + """Gets the last of this TabLinks. # noqa: E501 + + + :return: The last of this TabLinks. # noqa: E501 + :rtype: Link + """ + return self._last + + @last.setter + def last(self, last): + """Sets the last of this TabLinks. + + + :param last: The last of this TabLinks. # noqa: E501 + :type: Link + """ + + self._last = last + + @property + def next(self): + """Gets the next of this TabLinks. # noqa: E501 + + + :return: The next of this TabLinks. # noqa: E501 + :rtype: Link + """ + return self._next + + @next.setter + def next(self, next): + """Sets the next of this TabLinks. + + + :param next: The next of this TabLinks. # noqa: E501 + :type: Link + """ + + self._next = next + + @property + def prev(self): + """Gets the prev of this TabLinks. # noqa: E501 + + + :return: The prev of this TabLinks. # noqa: E501 + :rtype: Link + """ + return self._prev + + @prev.setter + def prev(self, prev): + """Sets the prev of this TabLinks. + + + :param prev: The prev of this TabLinks. # noqa: E501 + :type: Link + """ + + self._prev = prev + + @property + def _self(self): + """Gets the _self of this TabLinks. # noqa: E501 + + + :return: The _self of this TabLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this TabLinks. + + + :param _self: The _self of this TabLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TabLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TabLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry.py b/psa_connectedcar/models/telemetry.py new file mode 100644 index 0000000..7b64324 --- /dev/null +++ b/psa_connectedcar/models/telemetry.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Telemetry(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'TelemetryEmbedded' + } + + attribute_map = { + 'embedded': '_embedded' + } + + def __init__(self, embedded=None): # noqa: E501 + """Telemetry - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + + @property + def embedded(self): + """Gets the embedded of this Telemetry. # noqa: E501 + + + :return: The embedded of this Telemetry. # noqa: E501 + :rtype: TelemetryEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Telemetry. + + + :param embedded: The embedded of this Telemetry. # noqa: E501 + :type: TelemetryEmbedded + """ + + self._embedded = embedded + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Telemetry, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Telemetry): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_embedded.py b/psa_connectedcar/models/telemetry_embedded.py new file mode 100644 index 0000000..cc24a31 --- /dev/null +++ b/psa_connectedcar/models/telemetry_embedded.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'telemetries': 'list[TelemetryMessage]' + } + + attribute_map = { + 'telemetries': 'telemetries' + } + + def __init__(self, telemetries=None): # noqa: E501 + """TelemetryEmbedded - a model defined in Swagger""" # noqa: E501 + + self._telemetries = None + self.discriminator = None + + if telemetries is not None: + self.telemetries = telemetries + + @property + def telemetries(self): + """Gets the telemetries of this TelemetryEmbedded. # noqa: E501 + + + :return: The telemetries of this TelemetryEmbedded. # noqa: E501 + :rtype: list[TelemetryMessage] + """ + return self._telemetries + + @telemetries.setter + def telemetries(self, telemetries): + """Sets the telemetries of this TelemetryEmbedded. + + + :param telemetries: The telemetries of this TelemetryEmbedded. # noqa: E501 + :type: list[TelemetryMessage] + """ + + self._telemetries = telemetries + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_enum.py b/psa_connectedcar/models/telemetry_enum.py new file mode 100644 index 0000000..7a8bf6d --- /dev/null +++ b/psa_connectedcar/models/telemetry_enum.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryEnum(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """TelemetryEnum - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryEnum, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryEnum): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_extension.py b/psa_connectedcar/models/telemetry_extension.py new file mode 100644 index 0000000..7efcc3c --- /dev/null +++ b/psa_connectedcar/models/telemetry_extension.py @@ -0,0 +1,193 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryExtension(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'alerts': 'list[Alert]', + 'collision': 'Collision', + 'location': 'Position', + 'maintenance': 'MaintenanceObj' + } + + attribute_map = { + 'alerts': 'alerts', + 'collision': 'collision', + 'location': 'location', + 'maintenance': 'maintenance' + } + + def __init__(self, alerts=None, collision=None, location=None, maintenance=None): # noqa: E501 + """TelemetryExtension - a model defined in Swagger""" # noqa: E501 + + self._alerts = None + self._collision = None + self._location = None + self._maintenance = None + self.discriminator = None + + if alerts is not None: + self.alerts = alerts + if collision is not None: + self.collision = collision + if location is not None: + self.location = location + if maintenance is not None: + self.maintenance = maintenance + + @property + def alerts(self): + """Gets the alerts of this TelemetryExtension. # noqa: E501 + + + :return: The alerts of this TelemetryExtension. # noqa: E501 + :rtype: list[Alert] + """ + return self._alerts + + @alerts.setter + def alerts(self, alerts): + """Sets the alerts of this TelemetryExtension. + + + :param alerts: The alerts of this TelemetryExtension. # noqa: E501 + :type: list[Alert] + """ + + self._alerts = alerts + + @property + def collision(self): + """Gets the collision of this TelemetryExtension. # noqa: E501 + + + :return: The collision of this TelemetryExtension. # noqa: E501 + :rtype: Collision + """ + return self._collision + + @collision.setter + def collision(self, collision): + """Sets the collision of this TelemetryExtension. + + + :param collision: The collision of this TelemetryExtension. # noqa: E501 + :type: Collision + """ + + self._collision = collision + + @property + def location(self): + """Gets the location of this TelemetryExtension. # noqa: E501 + + + :return: The location of this TelemetryExtension. # noqa: E501 + :rtype: Position + """ + return self._location + + @location.setter + def location(self, location): + """Sets the location of this TelemetryExtension. + + + :param location: The location of this TelemetryExtension. # noqa: E501 + :type: Position + """ + + self._location = location + + @property + def maintenance(self): + """Gets the maintenance of this TelemetryExtension. # noqa: E501 + + + :return: The maintenance of this TelemetryExtension. # noqa: E501 + :rtype: MaintenanceObj + """ + return self._maintenance + + @maintenance.setter + def maintenance(self, maintenance): + """Sets the maintenance of this TelemetryExtension. + + + :param maintenance: The maintenance of this TelemetryExtension. # noqa: E501 + :type: MaintenanceObj + """ + + self._maintenance = maintenance + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryExtension, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryExtension): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_extension_type.py b/psa_connectedcar/models/telemetry_extension_type.py new file mode 100644 index 0000000..b702f0d --- /dev/null +++ b/psa_connectedcar/models/telemetry_extension_type.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryExtensionType(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """TelemetryExtensionType - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryExtensionType, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryExtensionType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_message.py b/psa_connectedcar/models/telemetry_message.py new file mode 100644 index 0000000..221586e --- /dev/null +++ b/psa_connectedcar/models/telemetry_message.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryMessage(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'TelemetryMessageEmbedded', + 'links': 'StatusLinks', + 'environment': 'Environment', + 'id': 'str', + 'privacy': 'Privacy', + 'vehicle': 'TelemetryMessageVehicle' + } + + attribute_map = { + 'embedded': '_embedded', + 'links': '_links', + 'environment': 'environment', + 'id': 'id', + 'privacy': 'privacy', + 'vehicle': 'vehicle' + } + + def __init__(self, embedded=None, links=None, environment=None, id=None, privacy=None, vehicle=None): # noqa: E501 + """TelemetryMessage - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self._links = None + self._environment = None + self._id = None + self._privacy = None + self._vehicle = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + if links is not None: + self.links = links + if environment is not None: + self.environment = environment + if id is not None: + self.id = id + if privacy is not None: + self.privacy = privacy + if vehicle is not None: + self.vehicle = vehicle + + @property + def embedded(self): + """Gets the embedded of this TelemetryMessage. # noqa: E501 + + + :return: The embedded of this TelemetryMessage. # noqa: E501 + :rtype: TelemetryMessageEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this TelemetryMessage. + + + :param embedded: The embedded of this TelemetryMessage. # noqa: E501 + :type: TelemetryMessageEmbedded + """ + + self._embedded = embedded + + @property + def links(self): + """Gets the links of this TelemetryMessage. # noqa: E501 + + + :return: The links of this TelemetryMessage. # noqa: E501 + :rtype: StatusLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this TelemetryMessage. + + + :param links: The links of this TelemetryMessage. # noqa: E501 + :type: StatusLinks + """ + + self._links = links + + @property + def environment(self): + """Gets the environment of this TelemetryMessage. # noqa: E501 + + + :return: The environment of this TelemetryMessage. # noqa: E501 + :rtype: Environment + """ + return self._environment + + @environment.setter + def environment(self, environment): + """Sets the environment of this TelemetryMessage. + + + :param environment: The environment of this TelemetryMessage. # noqa: E501 + :type: Environment + """ + + self._environment = environment + + @property + def id(self): + """Gets the id of this TelemetryMessage. # noqa: E501 + + + :return: The id of this TelemetryMessage. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TelemetryMessage. + + + :param id: The id of this TelemetryMessage. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def privacy(self): + """Gets the privacy of this TelemetryMessage. # noqa: E501 + + + :return: The privacy of this TelemetryMessage. # noqa: E501 + :rtype: Privacy + """ + return self._privacy + + @privacy.setter + def privacy(self, privacy): + """Sets the privacy of this TelemetryMessage. + + + :param privacy: The privacy of this TelemetryMessage. # noqa: E501 + :type: Privacy + """ + + self._privacy = privacy + + @property + def vehicle(self): + """Gets the vehicle of this TelemetryMessage. # noqa: E501 + + + :return: The vehicle of this TelemetryMessage. # noqa: E501 + :rtype: TelemetryMessageVehicle + """ + return self._vehicle + + @vehicle.setter + def vehicle(self, vehicle): + """Sets the vehicle of this TelemetryMessage. + + + :param vehicle: The vehicle of this TelemetryMessage. # noqa: E501 + :type: TelemetryMessageVehicle + """ + + self._vehicle = vehicle + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryMessage, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryMessage): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_message_embedded.py b/psa_connectedcar/models/telemetry_message_embedded.py new file mode 100644 index 0000000..2e815b3 --- /dev/null +++ b/psa_connectedcar/models/telemetry_message_embedded.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryMessageEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'extension': 'TelemetryExtension' + } + + attribute_map = { + 'extension': 'extension' + } + + def __init__(self, extension=None): # noqa: E501 + """TelemetryMessageEmbedded - a model defined in Swagger""" # noqa: E501 + + self._extension = None + self.discriminator = None + + if extension is not None: + self.extension = extension + + @property + def extension(self): + """Gets the extension of this TelemetryMessageEmbedded. # noqa: E501 + + + :return: The extension of this TelemetryMessageEmbedded. # noqa: E501 + :rtype: TelemetryExtension + """ + return self._extension + + @extension.setter + def extension(self, extension): + """Sets the extension of this TelemetryMessageEmbedded. + + + :param extension: The extension of this TelemetryMessageEmbedded. # noqa: E501 + :type: TelemetryExtension + """ + + self._extension = extension + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryMessageEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryMessageEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_message_vehicle.py b/psa_connectedcar/models/telemetry_message_vehicle.py new file mode 100644 index 0000000..59fa0ac --- /dev/null +++ b/psa_connectedcar/models/telemetry_message_vehicle.py @@ -0,0 +1,349 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryMessageVehicle(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'adas': 'Adas', + 'battery': 'Battery', + 'braking_system': 'TelemetryMessageVehicleBrakingSystem', + 'doors_state': 'DoorsState', + 'energy': 'Energy', + 'engines': 'list[Engine]', + 'ignition': 'Ignition', + 'lighting': 'Lighting', + 'safety': 'Safety', + 'transmission': 'TelemetryMessageVehicleTransmission' + } + + attribute_map = { + 'adas': 'adas', + 'battery': 'battery', + 'braking_system': 'brakingSystem', + 'doors_state': 'doorsState', + 'energy': 'energy', + 'engines': 'engines', + 'ignition': 'ignition', + 'lighting': 'lighting', + 'safety': 'safety', + 'transmission': 'transmission' + } + + def __init__(self, adas=None, battery=None, braking_system=None, doors_state=None, energy=None, engines=None, ignition=None, lighting=None, safety=None, transmission=None): # noqa: E501 + """TelemetryMessageVehicle - a model defined in Swagger""" # noqa: E501 + + self._adas = None + self._battery = None + self._braking_system = None + self._doors_state = None + self._energy = None + self._engines = None + self._ignition = None + self._lighting = None + self._safety = None + self._transmission = None + self.discriminator = None + + if adas is not None: + self.adas = adas + if battery is not None: + self.battery = battery + if braking_system is not None: + self.braking_system = braking_system + if doors_state is not None: + self.doors_state = doors_state + if energy is not None: + self.energy = energy + if engines is not None: + self.engines = engines + if ignition is not None: + self.ignition = ignition + if lighting is not None: + self.lighting = lighting + if safety is not None: + self.safety = safety + if transmission is not None: + self.transmission = transmission + + @property + def adas(self): + """Gets the adas of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The adas of this TelemetryMessageVehicle. # noqa: E501 + :rtype: Adas + """ + return self._adas + + @adas.setter + def adas(self, adas): + """Sets the adas of this TelemetryMessageVehicle. + + + :param adas: The adas of this TelemetryMessageVehicle. # noqa: E501 + :type: Adas + """ + + self._adas = adas + + @property + def battery(self): + """Gets the battery of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The battery of this TelemetryMessageVehicle. # noqa: E501 + :rtype: Battery + """ + return self._battery + + @battery.setter + def battery(self, battery): + """Sets the battery of this TelemetryMessageVehicle. + + + :param battery: The battery of this TelemetryMessageVehicle. # noqa: E501 + :type: Battery + """ + + self._battery = battery + + @property + def braking_system(self): + """Gets the braking_system of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The braking_system of this TelemetryMessageVehicle. # noqa: E501 + :rtype: TelemetryMessageVehicleBrakingSystem + """ + return self._braking_system + + @braking_system.setter + def braking_system(self, braking_system): + """Sets the braking_system of this TelemetryMessageVehicle. + + + :param braking_system: The braking_system of this TelemetryMessageVehicle. # noqa: E501 + :type: TelemetryMessageVehicleBrakingSystem + """ + + self._braking_system = braking_system + + @property + def doors_state(self): + """Gets the doors_state of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The doors_state of this TelemetryMessageVehicle. # noqa: E501 + :rtype: DoorsState + """ + return self._doors_state + + @doors_state.setter + def doors_state(self, doors_state): + """Sets the doors_state of this TelemetryMessageVehicle. + + + :param doors_state: The doors_state of this TelemetryMessageVehicle. # noqa: E501 + :type: DoorsState + """ + + self._doors_state = doors_state + + @property + def energy(self): + """Gets the energy of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The energy of this TelemetryMessageVehicle. # noqa: E501 + :rtype: Energy + """ + return self._energy + + @energy.setter + def energy(self, energy): + """Sets the energy of this TelemetryMessageVehicle. + + + :param energy: The energy of this TelemetryMessageVehicle. # noqa: E501 + :type: Energy + """ + + self._energy = energy + + @property + def engines(self): + """Gets the engines of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The engines of this TelemetryMessageVehicle. # noqa: E501 + :rtype: list[Engine] + """ + return self._engines + + @engines.setter + def engines(self, engines): + """Sets the engines of this TelemetryMessageVehicle. + + + :param engines: The engines of this TelemetryMessageVehicle. # noqa: E501 + :type: list[Engine] + """ + + self._engines = engines + + @property + def ignition(self): + """Gets the ignition of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The ignition of this TelemetryMessageVehicle. # noqa: E501 + :rtype: Ignition + """ + return self._ignition + + @ignition.setter + def ignition(self, ignition): + """Sets the ignition of this TelemetryMessageVehicle. + + + :param ignition: The ignition of this TelemetryMessageVehicle. # noqa: E501 + :type: Ignition + """ + + self._ignition = ignition + + @property + def lighting(self): + """Gets the lighting of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The lighting of this TelemetryMessageVehicle. # noqa: E501 + :rtype: Lighting + """ + return self._lighting + + @lighting.setter + def lighting(self, lighting): + """Sets the lighting of this TelemetryMessageVehicle. + + + :param lighting: The lighting of this TelemetryMessageVehicle. # noqa: E501 + :type: Lighting + """ + + self._lighting = lighting + + @property + def safety(self): + """Gets the safety of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The safety of this TelemetryMessageVehicle. # noqa: E501 + :rtype: Safety + """ + return self._safety + + @safety.setter + def safety(self, safety): + """Sets the safety of this TelemetryMessageVehicle. + + + :param safety: The safety of this TelemetryMessageVehicle. # noqa: E501 + :type: Safety + """ + + self._safety = safety + + @property + def transmission(self): + """Gets the transmission of this TelemetryMessageVehicle. # noqa: E501 + + + :return: The transmission of this TelemetryMessageVehicle. # noqa: E501 + :rtype: TelemetryMessageVehicleTransmission + """ + return self._transmission + + @transmission.setter + def transmission(self, transmission): + """Sets the transmission of this TelemetryMessageVehicle. + + + :param transmission: The transmission of this TelemetryMessageVehicle. # noqa: E501 + :type: TelemetryMessageVehicleTransmission + """ + + self._transmission = transmission + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryMessageVehicle, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryMessageVehicle): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_message_vehicle_braking_system.py b/psa_connectedcar/models/telemetry_message_vehicle_braking_system.py new file mode 100644 index 0000000..dfd2e42 --- /dev/null +++ b/psa_connectedcar/models/telemetry_message_vehicle_braking_system.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryMessageVehicleBrakingSystem(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'parking': 'bool' + } + + attribute_map = { + 'parking': 'parking' + } + + def __init__(self, parking=None): # noqa: E501 + """TelemetryMessageVehicleBrakingSystem - a model defined in Swagger""" # noqa: E501 + + self._parking = None + self.discriminator = None + + if parking is not None: + self.parking = parking + + @property + def parking(self): + """Gets the parking of this TelemetryMessageVehicleBrakingSystem. # noqa: E501 + + + :return: The parking of this TelemetryMessageVehicleBrakingSystem. # noqa: E501 + :rtype: bool + """ + return self._parking + + @parking.setter + def parking(self, parking): + """Sets the parking of this TelemetryMessageVehicleBrakingSystem. + + + :param parking: The parking of this TelemetryMessageVehicleBrakingSystem. # noqa: E501 + :type: bool + """ + + self._parking = parking + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryMessageVehicleBrakingSystem, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryMessageVehicleBrakingSystem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_message_vehicle_transmission.py b/psa_connectedcar/models/telemetry_message_vehicle_transmission.py new file mode 100644 index 0000000..8f5d81c --- /dev/null +++ b/psa_connectedcar/models/telemetry_message_vehicle_transmission.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryMessageVehicleTransmission(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'gearbox': 'TelemetryMessageVehicleTransmissionGearbox' + } + + attribute_map = { + 'gearbox': 'gearbox' + } + + def __init__(self, gearbox=None): # noqa: E501 + """TelemetryMessageVehicleTransmission - a model defined in Swagger""" # noqa: E501 + + self._gearbox = None + self.discriminator = None + + if gearbox is not None: + self.gearbox = gearbox + + @property + def gearbox(self): + """Gets the gearbox of this TelemetryMessageVehicleTransmission. # noqa: E501 + + + :return: The gearbox of this TelemetryMessageVehicleTransmission. # noqa: E501 + :rtype: TelemetryMessageVehicleTransmissionGearbox + """ + return self._gearbox + + @gearbox.setter + def gearbox(self, gearbox): + """Sets the gearbox of this TelemetryMessageVehicleTransmission. + + + :param gearbox: The gearbox of this TelemetryMessageVehicleTransmission. # noqa: E501 + :type: TelemetryMessageVehicleTransmissionGearbox + """ + + self._gearbox = gearbox + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryMessageVehicleTransmission, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryMessageVehicleTransmission): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_message_vehicle_transmission_gearbox.py b/psa_connectedcar/models/telemetry_message_vehicle_transmission_gearbox.py new file mode 100644 index 0000000..f3e5b16 --- /dev/null +++ b/psa_connectedcar/models/telemetry_message_vehicle_transmission_gearbox.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryMessageVehicleTransmissionGearbox(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'gear': 'TelemetryMessageVehicleTransmissionGearboxGear', + 'mode': 'TelemetryMessageVehicleTransmissionGearboxMode' + } + + attribute_map = { + 'gear': 'gear', + 'mode': 'mode' + } + + def __init__(self, gear=None, mode=None): # noqa: E501 + """TelemetryMessageVehicleTransmissionGearbox - a model defined in Swagger""" # noqa: E501 + + self._gear = None + self._mode = None + self.discriminator = None + + if gear is not None: + self.gear = gear + if mode is not None: + self.mode = mode + + @property + def gear(self): + """Gets the gear of this TelemetryMessageVehicleTransmissionGearbox. # noqa: E501 + + + :return: The gear of this TelemetryMessageVehicleTransmissionGearbox. # noqa: E501 + :rtype: TelemetryMessageVehicleTransmissionGearboxGear + """ + return self._gear + + @gear.setter + def gear(self, gear): + """Sets the gear of this TelemetryMessageVehicleTransmissionGearbox. + + + :param gear: The gear of this TelemetryMessageVehicleTransmissionGearbox. # noqa: E501 + :type: TelemetryMessageVehicleTransmissionGearboxGear + """ + + self._gear = gear + + @property + def mode(self): + """Gets the mode of this TelemetryMessageVehicleTransmissionGearbox. # noqa: E501 + + + :return: The mode of this TelemetryMessageVehicleTransmissionGearbox. # noqa: E501 + :rtype: TelemetryMessageVehicleTransmissionGearboxMode + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this TelemetryMessageVehicleTransmissionGearbox. + + + :param mode: The mode of this TelemetryMessageVehicleTransmissionGearbox. # noqa: E501 + :type: TelemetryMessageVehicleTransmissionGearboxMode + """ + + self._mode = mode + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryMessageVehicleTransmissionGearbox, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryMessageVehicleTransmissionGearbox): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_message_vehicle_transmission_gearbox_gear.py b/psa_connectedcar/models/telemetry_message_vehicle_transmission_gearbox_gear.py new file mode 100644 index 0000000..0969426 --- /dev/null +++ b/psa_connectedcar/models/telemetry_message_vehicle_transmission_gearbox_gear.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryMessageVehicleTransmissionGearboxGear(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'recommended': 'str' + } + + attribute_map = { + 'recommended': 'recommended' + } + + def __init__(self, recommended=None): # noqa: E501 + """TelemetryMessageVehicleTransmissionGearboxGear - a model defined in Swagger""" # noqa: E501 + + self._recommended = None + self.discriminator = None + + if recommended is not None: + self.recommended = recommended + + @property + def recommended(self): + """Gets the recommended of this TelemetryMessageVehicleTransmissionGearboxGear. # noqa: E501 + + + :return: The recommended of this TelemetryMessageVehicleTransmissionGearboxGear. # noqa: E501 + :rtype: str + """ + return self._recommended + + @recommended.setter + def recommended(self, recommended): + """Sets the recommended of this TelemetryMessageVehicleTransmissionGearboxGear. + + + :param recommended: The recommended of this TelemetryMessageVehicleTransmissionGearboxGear. # noqa: E501 + :type: str + """ + allowed_values = ["None", "Up", "Down", "UpDown"] # noqa: E501 + if recommended not in allowed_values: + raise ValueError( + "Invalid value for `recommended` ({0}), must be one of {1}" # noqa: E501 + .format(recommended, allowed_values) + ) + + self._recommended = recommended + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryMessageVehicleTransmissionGearboxGear, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryMessageVehicleTransmissionGearboxGear): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/telemetry_message_vehicle_transmission_gearbox_mode.py b/psa_connectedcar/models/telemetry_message_vehicle_transmission_gearbox_mode.py new file mode 100644 index 0000000..e509068 --- /dev/null +++ b/psa_connectedcar/models/telemetry_message_vehicle_transmission_gearbox_mode.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TelemetryMessageVehicleTransmissionGearboxMode(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'automatic': 'bool', + 'snow': 'bool', + 'sport': 'bool' + } + + attribute_map = { + 'automatic': 'automatic', + 'snow': 'snow', + 'sport': 'sport' + } + + def __init__(self, automatic=None, snow=None, sport=None): # noqa: E501 + """TelemetryMessageVehicleTransmissionGearboxMode - a model defined in Swagger""" # noqa: E501 + + self._automatic = None + self._snow = None + self._sport = None + self.discriminator = None + + if automatic is not None: + self.automatic = automatic + if snow is not None: + self.snow = snow + if sport is not None: + self.sport = sport + + @property + def automatic(self): + """Gets the automatic of this TelemetryMessageVehicleTransmissionGearboxMode. # noqa: E501 + + + :return: The automatic of this TelemetryMessageVehicleTransmissionGearboxMode. # noqa: E501 + :rtype: bool + """ + return self._automatic + + @automatic.setter + def automatic(self, automatic): + """Sets the automatic of this TelemetryMessageVehicleTransmissionGearboxMode. + + + :param automatic: The automatic of this TelemetryMessageVehicleTransmissionGearboxMode. # noqa: E501 + :type: bool + """ + + self._automatic = automatic + + @property + def snow(self): + """Gets the snow of this TelemetryMessageVehicleTransmissionGearboxMode. # noqa: E501 + + + :return: The snow of this TelemetryMessageVehicleTransmissionGearboxMode. # noqa: E501 + :rtype: bool + """ + return self._snow + + @snow.setter + def snow(self, snow): + """Sets the snow of this TelemetryMessageVehicleTransmissionGearboxMode. + + + :param snow: The snow of this TelemetryMessageVehicleTransmissionGearboxMode. # noqa: E501 + :type: bool + """ + + self._snow = snow + + @property + def sport(self): + """Gets the sport of this TelemetryMessageVehicleTransmissionGearboxMode. # noqa: E501 + + + :return: The sport of this TelemetryMessageVehicleTransmissionGearboxMode. # noqa: E501 + :rtype: bool + """ + return self._sport + + @sport.setter + def sport(self, sport): + """Sets the sport of this TelemetryMessageVehicleTransmissionGearboxMode. + + + :param sport: The sport of this TelemetryMessageVehicleTransmissionGearboxMode. # noqa: E501 + :type: bool + """ + + self._sport = sport + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TelemetryMessageVehicleTransmissionGearboxMode, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TelemetryMessageVehicleTransmissionGearboxMode): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/time_monitor_trigger.py b/psa_connectedcar/models/time_monitor_trigger.py new file mode 100644 index 0000000..181dd16 --- /dev/null +++ b/psa_connectedcar/models/time_monitor_trigger.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TimeMonitorTrigger(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'times': 'list[TimeRange]', + 'type': 'str' + } + + attribute_map = { + 'times': 'times', + 'type': 'type' + } + + def __init__(self, times=None, type='Temporal'): # noqa: E501 + """TimeMonitorTrigger - a model defined in Swagger""" # noqa: E501 + + self._times = None + self._type = None + self.discriminator = None + + if times is not None: + self.times = times + if type is not None: + self.type = type + + @property + def times(self): + """Gets the times of this TimeMonitorTrigger. # noqa: E501 + + + :return: The times of this TimeMonitorTrigger. # noqa: E501 + :rtype: list[TimeRange] + """ + return self._times + + @times.setter + def times(self, times): + """Sets the times of this TimeMonitorTrigger. + + + :param times: The times of this TimeMonitorTrigger. # noqa: E501 + :type: list[TimeRange] + """ + + self._times = times + + @property + def type(self): + """Gets the type of this TimeMonitorTrigger. # noqa: E501 + + + :return: The type of this TimeMonitorTrigger. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this TimeMonitorTrigger. + + + :param type: The type of this TimeMonitorTrigger. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TimeMonitorTrigger, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TimeMonitorTrigger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/time_range.py b/psa_connectedcar/models/time_range.py new file mode 100644 index 0000000..878360b --- /dev/null +++ b/psa_connectedcar/models/time_range.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TimeRange(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """TimeRange - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TimeRange, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TimeRange): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/time_stamped.py b/psa_connectedcar/models/time_stamped.py new file mode 100644 index 0000000..cbf4ee2 --- /dev/null +++ b/psa_connectedcar/models/time_stamped.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TimeStamped(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime' + } + + attribute_map = { + 'created_at': 'createdAt' + } + + def __init__(self, created_at=None): # noqa: E501 + """TimeStamped - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + + @property + def created_at(self): + """Gets the created_at of this TimeStamped. # noqa: E501 + + + :return: The created_at of this TimeStamped. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this TimeStamped. + + + :param created_at: The created_at of this TimeStamped. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TimeStamped, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TimeStamped): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/time_trigger.py b/psa_connectedcar/models/time_trigger.py new file mode 100644 index 0000000..fc2c97a --- /dev/null +++ b/psa_connectedcar/models/time_trigger.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TimeTrigger(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'time_zone': 'str', + 'times': 'list[BoundedProgram]' + } + + attribute_map = { + 'time_zone': 'time.zone', + 'times': 'times' + } + + def __init__(self, time_zone='Europe/Paris', times=None): # noqa: E501 + """TimeTrigger - a model defined in Swagger""" # noqa: E501 + + self._time_zone = None + self._times = None + self.discriminator = None + + if time_zone is not None: + self.time_zone = time_zone + if times is not None: + self.times = times + + @property + def time_zone(self): + """Gets the time_zone of this TimeTrigger. # noqa: E501 + + The standard time [zone code](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the region where to apply this time trigger monitor. This allows to adapt this trigger to the time change according to local (region/country) criteria/rules. # noqa: E501 + + :return: The time_zone of this TimeTrigger. # noqa: E501 + :rtype: str + """ + return self._time_zone + + @time_zone.setter + def time_zone(self, time_zone): + """Sets the time_zone of this TimeTrigger. + + The standard time [zone code](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) of the region where to apply this time trigger monitor. This allows to adapt this trigger to the time change according to local (region/country) criteria/rules. # noqa: E501 + + :param time_zone: The time_zone of this TimeTrigger. # noqa: E501 + :type: str + """ + if time_zone is not None and not re.search(r'\\w?\/\\w?', time_zone): # noqa: E501 + raise ValueError(r"Invalid value for `time_zone`, must be a follow pattern or equal to `/\\w?\/\\w?/`") # noqa: E501 + + self._time_zone = time_zone + + @property + def times(self): + """Gets the times of this TimeTrigger. # noqa: E501 + + + :return: The times of this TimeTrigger. # noqa: E501 + :rtype: list[BoundedProgram] + """ + return self._times + + @times.setter + def times(self, times): + """Sets the times of this TimeTrigger. + + + :param times: The times of this TimeTrigger. # noqa: E501 + :type: list[BoundedProgram] + """ + + self._times = times + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TimeTrigger, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TimeTrigger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/time_zone_monitor_trigger.py b/psa_connectedcar/models/time_zone_monitor_trigger.py new file mode 100644 index 0000000..c4ce746 --- /dev/null +++ b/psa_connectedcar/models/time_zone_monitor_trigger.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TimeZoneMonitorTrigger(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'place': 'object', + 'type': 'str', + 'within': 'str' + } + + attribute_map = { + 'place': 'place', + 'type': 'type', + 'within': 'within' + } + + def __init__(self, place=None, type='SpacialTemporal', within=None): # noqa: E501 + """TimeZoneMonitorTrigger - a model defined in Swagger""" # noqa: E501 + + self._place = None + self._type = None + self._within = None + self.discriminator = None + + if place is not None: + self.place = place + if type is not None: + self.type = type + if within is not None: + self.within = within + + @property + def place(self): + """Gets the place of this TimeZoneMonitorTrigger. # noqa: E501 + + + :return: The place of this TimeZoneMonitorTrigger. # noqa: E501 + :rtype: object + """ + return self._place + + @place.setter + def place(self, place): + """Sets the place of this TimeZoneMonitorTrigger. + + + :param place: The place of this TimeZoneMonitorTrigger. # noqa: E501 + :type: object + """ + + self._place = place + + @property + def type(self): + """Gets the type of this TimeZoneMonitorTrigger. # noqa: E501 + + + :return: The type of this TimeZoneMonitorTrigger. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this TimeZoneMonitorTrigger. + + + :param type: The type of this TimeZoneMonitorTrigger. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def within(self): + """Gets the within of this TimeZoneMonitorTrigger. # noqa: E501 + + containing mode. i.e wayPoints (such as Trip) start and /or end within or cross the container, # noqa: E501 + + :return: The within of this TimeZoneMonitorTrigger. # noqa: E501 + :rtype: str + """ + return self._within + + @within.setter + def within(self, within): + """Sets the within of this TimeZoneMonitorTrigger. + + containing mode. i.e wayPoints (such as Trip) start and /or end within or cross the container, # noqa: E501 + + :param within: The within of this TimeZoneMonitorTrigger. # noqa: E501 + :type: str + """ + allowed_values = ["start", "stop", "startOrStop", "startAndStop", "crossing"] # noqa: E501 + if within not in allowed_values: + raise ValueError( + "Invalid value for `within` ({0}), must be one of {1}" # noqa: E501 + .format(within, allowed_values) + ) + + self._within = within + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TimeZoneMonitorTrigger, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TimeZoneMonitorTrigger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/time_zone_trigger.py b/psa_connectedcar/models/time_zone_trigger.py new file mode 100644 index 0000000..36af78b --- /dev/null +++ b/psa_connectedcar/models/time_zone_trigger.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TimeZoneTrigger(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'time_trigger': 'TimeTrigger', + 'zone_trigger': 'ZoneTrigger' + } + + attribute_map = { + 'time_trigger': 'timeTrigger', + 'zone_trigger': 'zoneTrigger' + } + + def __init__(self, time_trigger=None, zone_trigger=None): # noqa: E501 + """TimeZoneTrigger - a model defined in Swagger""" # noqa: E501 + + self._time_trigger = None + self._zone_trigger = None + self.discriminator = None + + if time_trigger is not None: + self.time_trigger = time_trigger + if zone_trigger is not None: + self.zone_trigger = zone_trigger + + @property + def time_trigger(self): + """Gets the time_trigger of this TimeZoneTrigger. # noqa: E501 + + + :return: The time_trigger of this TimeZoneTrigger. # noqa: E501 + :rtype: TimeTrigger + """ + return self._time_trigger + + @time_trigger.setter + def time_trigger(self, time_trigger): + """Sets the time_trigger of this TimeZoneTrigger. + + + :param time_trigger: The time_trigger of this TimeZoneTrigger. # noqa: E501 + :type: TimeTrigger + """ + + self._time_trigger = time_trigger + + @property + def zone_trigger(self): + """Gets the zone_trigger of this TimeZoneTrigger. # noqa: E501 + + + :return: The zone_trigger of this TimeZoneTrigger. # noqa: E501 + :rtype: ZoneTrigger + """ + return self._zone_trigger + + @zone_trigger.setter + def zone_trigger(self, zone_trigger): + """Sets the zone_trigger of this TimeZoneTrigger. + + + :param zone_trigger: The zone_trigger of this TimeZoneTrigger. # noqa: E501 + :type: ZoneTrigger + """ + + self._zone_trigger = zone_trigger + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TimeZoneTrigger, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TimeZoneTrigger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/trip.py b/psa_connectedcar/models/trip.py new file mode 100644 index 0000000..5859769 --- /dev/null +++ b/psa_connectedcar/models/trip.py @@ -0,0 +1,480 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Trip(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime', + 'links': 'TripLinks', + 'avg_consumption': 'list[TripAvgConsumption]', + 'distance': 'float', + 'done': 'bool', + 'duration': 'str', + 'faults': 'list[str]', + 'id': 'str', + 'odometer': 'float', + 'start_position': 'Position', + 'started_at': 'datetime', + 'stop_position': 'Position', + 'stopped_at': 'datetime', + 'zero_emission_ratio': 'float' + } + + attribute_map = { + 'created_at': 'createdAt', + 'links': '_links', + 'avg_consumption': 'avgConsumption', + 'distance': 'distance', + 'done': 'done', + 'duration': 'duration', + 'faults': 'faults', + 'id': 'id', + 'odometer': 'odometer', + 'start_position': 'startPosition', + 'started_at': 'startedAt', + 'stop_position': 'stopPosition', + 'stopped_at': 'stoppedAt', + 'zero_emission_ratio': 'zeroEmissionRatio' + } + + def __init__(self, created_at=None, links=None, avg_consumption=None, distance=None, done=None, duration=None, faults=None, id=None, odometer=None, start_position=None, started_at=None, stop_position=None, stopped_at=None, zero_emission_ratio=None): # noqa: E501 + """Trip - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self._links = None + self._avg_consumption = None + self._distance = None + self._done = None + self._duration = None + self._faults = None + self._id = None + self._odometer = None + self._start_position = None + self._started_at = None + self._stop_position = None + self._stopped_at = None + self._zero_emission_ratio = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if links is not None: + self.links = links + if avg_consumption is not None: + self.avg_consumption = avg_consumption + if distance is not None: + self.distance = distance + if done is not None: + self.done = done + if duration is not None: + self.duration = duration + if faults is not None: + self.faults = faults + if id is not None: + self.id = id + if odometer is not None: + self.odometer = odometer + if start_position is not None: + self.start_position = start_position + if started_at is not None: + self.started_at = started_at + if stop_position is not None: + self.stop_position = stop_position + if stopped_at is not None: + self.stopped_at = stopped_at + if zero_emission_ratio is not None: + self.zero_emission_ratio = zero_emission_ratio + + @property + def created_at(self): + """Gets the created_at of this Trip. # noqa: E501 + + Date when the resource has been created. # noqa: E501 + + :return: The created_at of this Trip. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this Trip. + + Date when the resource has been created. # noqa: E501 + + :param created_at: The created_at of this Trip. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def links(self): + """Gets the links of this Trip. # noqa: E501 + + + :return: The links of this Trip. # noqa: E501 + :rtype: TripLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Trip. + + + :param links: The links of this Trip. # noqa: E501 + :type: TripLinks + """ + + self._links = links + + @property + def avg_consumption(self): + """Gets the avg_consumption of this Trip. # noqa: E501 + + + :return: The avg_consumption of this Trip. # noqa: E501 + :rtype: list[TripAvgConsumption] + """ + return self._avg_consumption + + @avg_consumption.setter + def avg_consumption(self, avg_consumption): + """Sets the avg_consumption of this Trip. + + + :param avg_consumption: The avg_consumption of this Trip. # noqa: E501 + :type: list[TripAvgConsumption] + """ + + self._avg_consumption = avg_consumption + + @property + def distance(self): + """Gets the distance of this Trip. # noqa: E501 + + Distance in Km of the trip # noqa: E501 + + :return: The distance of this Trip. # noqa: E501 + :rtype: float + """ + return self._distance + + @distance.setter + def distance(self, distance): + """Sets the distance of this Trip. + + Distance in Km of the trip # noqa: E501 + + :param distance: The distance of this Trip. # noqa: E501 + :type: float + """ + + self._distance = distance + + @property + def done(self): + """Gets the done of this Trip. # noqa: E501 + + Determines whether this trip is finished or not. # noqa: E501 + + :return: The done of this Trip. # noqa: E501 + :rtype: bool + """ + return self._done + + @done.setter + def done(self, done): + """Sets the done of this Trip. + + Determines whether this trip is finished or not. # noqa: E501 + + :param done: The done of this Trip. # noqa: E501 + :type: bool + """ + + self._done = done + + @property + def duration(self): + """Gets the duration of this Trip. # noqa: E501 + + Duration of the trip # noqa: E501 + + :return: The duration of this Trip. # noqa: E501 + :rtype: str + """ + return self._duration + + @duration.setter + def duration(self, duration): + """Sets the duration of this Trip. + + Duration of the trip # noqa: E501 + + :param duration: The duration of this Trip. # noqa: E501 + :type: str + """ + + self._duration = duration + + @property + def faults(self): + """Gets the faults of this Trip. # noqa: E501 + + The faults of this finished or in progress trip. This means that we lacked data from the vehicle to complete the trip description during one of its step (starting, progressing, or finishing). # noqa: E501 + + :return: The faults of this Trip. # noqa: E501 + :rtype: list[str] + """ + return self._faults + + @faults.setter + def faults(self, faults): + """Sets the faults of this Trip. + + The faults of this finished or in progress trip. This means that we lacked data from the vehicle to complete the trip description during one of its step (starting, progressing, or finishing). # noqa: E501 + + :param faults: The faults of this Trip. # noqa: E501 + :type: list[str] + """ + allowed_values = ["Unstarted", "DataLacking", "Unfinished"] # noqa: E501 + if not set(faults).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `faults` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(faults) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._faults = faults + + @property + def id(self): + """Gets the id of this Trip. # noqa: E501 + + Identifier of a trip # noqa: E501 + + :return: The id of this Trip. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Trip. + + Identifier of a trip # noqa: E501 + + :param id: The id of this Trip. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def odometer(self): + """Gets the odometer of this Trip. # noqa: E501 + + The mileage of the vehicle at the end of a trip # noqa: E501 + + :return: The odometer of this Trip. # noqa: E501 + :rtype: float + """ + return self._odometer + + @odometer.setter + def odometer(self, odometer): + """Sets the odometer of this Trip. + + The mileage of the vehicle at the end of a trip # noqa: E501 + + :param odometer: The odometer of this Trip. # noqa: E501 + :type: float + """ + + self._odometer = odometer + + @property + def start_position(self): + """Gets the start_position of this Trip. # noqa: E501 + + + :return: The start_position of this Trip. # noqa: E501 + :rtype: Position + """ + return self._start_position + + @start_position.setter + def start_position(self, start_position): + """Sets the start_position of this Trip. + + + :param start_position: The start_position of this Trip. # noqa: E501 + :type: Position + """ + + self._start_position = start_position + + @property + def started_at(self): + """Gets the started_at of this Trip. # noqa: E501 + + Date & Time when the trip started # noqa: E501 + + :return: The started_at of this Trip. # noqa: E501 + :rtype: datetime + """ + return self._started_at + + @started_at.setter + def started_at(self, started_at): + """Sets the started_at of this Trip. + + Date & Time when the trip started # noqa: E501 + + :param started_at: The started_at of this Trip. # noqa: E501 + :type: datetime + """ + + self._started_at = started_at + + @property + def stop_position(self): + """Gets the stop_position of this Trip. # noqa: E501 + + + :return: The stop_position of this Trip. # noqa: E501 + :rtype: Position + """ + return self._stop_position + + @stop_position.setter + def stop_position(self, stop_position): + """Sets the stop_position of this Trip. + + + :param stop_position: The stop_position of this Trip. # noqa: E501 + :type: Position + """ + + self._stop_position = stop_position + + @property + def stopped_at(self): + """Gets the stopped_at of this Trip. # noqa: E501 + + Date & Time when the trip stopped # noqa: E501 + + :return: The stopped_at of this Trip. # noqa: E501 + :rtype: datetime + """ + return self._stopped_at + + @stopped_at.setter + def stopped_at(self, stopped_at): + """Sets the stopped_at of this Trip. + + Date & Time when the trip stopped # noqa: E501 + + :param stopped_at: The stopped_at of this Trip. # noqa: E501 + :type: datetime + """ + + self._stopped_at = stopped_at + + @property + def zero_emission_ratio(self): + """Gets the zero_emission_ratio of this Trip. # noqa: E501 + + Part of trip distance with zero gaz emission of the trip expressed in percent (0-100%). # noqa: E501 + + :return: The zero_emission_ratio of this Trip. # noqa: E501 + :rtype: float + """ + return self._zero_emission_ratio + + @zero_emission_ratio.setter + def zero_emission_ratio(self, zero_emission_ratio): + """Sets the zero_emission_ratio of this Trip. + + Part of trip distance with zero gaz emission of the trip expressed in percent (0-100%). # noqa: E501 + + :param zero_emission_ratio: The zero_emission_ratio of this Trip. # noqa: E501 + :type: float + """ + + self._zero_emission_ratio = zero_emission_ratio + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Trip, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Trip): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/trip_avg_consumption.py b/psa_connectedcar/models/trip_avg_consumption.py new file mode 100644 index 0000000..b671eb9 --- /dev/null +++ b/psa_connectedcar/models/trip_avg_consumption.py @@ -0,0 +1,147 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TripAvgConsumption(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'type': 'str', + 'value': 'float' + } + + attribute_map = { + 'type': 'type', + 'value': 'value' + } + + def __init__(self, type=None, value=None): # noqa: E501 + """TripAvgConsumption - a model defined in Swagger""" # noqa: E501 + + self._type = None + self._value = None + self.discriminator = None + + if type is not None: + self.type = type + if value is not None: + self.value = value + + @property + def type(self): + """Gets the type of this TripAvgConsumption. # noqa: E501 + + + :return: The type of this TripAvgConsumption. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this TripAvgConsumption. + + + :param type: The type of this TripAvgConsumption. # noqa: E501 + :type: str + """ + allowed_values = ["Fuel", "Electric"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 + .format(type, allowed_values) + ) + + self._type = type + + @property + def value(self): + """Gets the value of this TripAvgConsumption. # noqa: E501 + + + :return: The value of this TripAvgConsumption. # noqa: E501 + :rtype: float + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this TripAvgConsumption. + + + :param value: The value of this TripAvgConsumption. # noqa: E501 + :type: float + """ + + self._value = value + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TripAvgConsumption, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TripAvgConsumption): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/trip_links.py b/psa_connectedcar/models/trip_links.py new file mode 100644 index 0000000..624c3e2 --- /dev/null +++ b/psa_connectedcar/models/trip_links.py @@ -0,0 +1,193 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TripLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'alerts': 'Link', + '_self': 'Link', + 'vehicle': 'Link', + 'waypoints': 'Link' + } + + attribute_map = { + 'alerts': 'alerts', + '_self': 'self', + 'vehicle': 'vehicle', + 'waypoints': 'waypoints' + } + + def __init__(self, alerts=None, _self=None, vehicle=None, waypoints=None): # noqa: E501 + """TripLinks - a model defined in Swagger""" # noqa: E501 + + self._alerts = None + self.__self = None + self._vehicle = None + self._waypoints = None + self.discriminator = None + + if alerts is not None: + self.alerts = alerts + if _self is not None: + self._self = _self + if vehicle is not None: + self.vehicle = vehicle + if waypoints is not None: + self.waypoints = waypoints + + @property + def alerts(self): + """Gets the alerts of this TripLinks. # noqa: E501 + + + :return: The alerts of this TripLinks. # noqa: E501 + :rtype: Link + """ + return self._alerts + + @alerts.setter + def alerts(self, alerts): + """Sets the alerts of this TripLinks. + + + :param alerts: The alerts of this TripLinks. # noqa: E501 + :type: Link + """ + + self._alerts = alerts + + @property + def _self(self): + """Gets the _self of this TripLinks. # noqa: E501 + + + :return: The _self of this TripLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this TripLinks. + + + :param _self: The _self of this TripLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + @property + def vehicle(self): + """Gets the vehicle of this TripLinks. # noqa: E501 + + + :return: The vehicle of this TripLinks. # noqa: E501 + :rtype: Link + """ + return self._vehicle + + @vehicle.setter + def vehicle(self, vehicle): + """Sets the vehicle of this TripLinks. + + + :param vehicle: The vehicle of this TripLinks. # noqa: E501 + :type: Link + """ + + self._vehicle = vehicle + + @property + def waypoints(self): + """Gets the waypoints of this TripLinks. # noqa: E501 + + + :return: The waypoints of this TripLinks. # noqa: E501 + :rtype: Link + """ + return self._waypoints + + @waypoints.setter + def waypoints(self, waypoints): + """Sets the waypoints of this TripLinks. + + + :param waypoints: The waypoints of this TripLinks. # noqa: E501 + :type: Link + """ + + self._waypoints = waypoints + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TripLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TripLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/trips.py b/psa_connectedcar/models/trips.py new file mode 100644 index 0000000..24a5d36 --- /dev/null +++ b/psa_connectedcar/models/trips.py @@ -0,0 +1,219 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Trips(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'TripsEmbedded', + 'links': 'TabLinks', + 'current_page': 'int', + 'total': 'int', + 'total_page': 'int' + } + + attribute_map = { + 'embedded': '_embedded', + 'links': '_links', + 'current_page': 'currentPage', + 'total': 'total', + 'total_page': 'totalPage' + } + + def __init__(self, embedded=None, links=None, current_page=None, total=None, total_page=None): # noqa: E501 + """Trips - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self._links = None + self._current_page = None + self._total = None + self._total_page = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + if links is not None: + self.links = links + if current_page is not None: + self.current_page = current_page + if total is not None: + self.total = total + if total_page is not None: + self.total_page = total_page + + @property + def embedded(self): + """Gets the embedded of this Trips. # noqa: E501 + + + :return: The embedded of this Trips. # noqa: E501 + :rtype: TripsEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Trips. + + + :param embedded: The embedded of this Trips. # noqa: E501 + :type: TripsEmbedded + """ + + self._embedded = embedded + + @property + def links(self): + """Gets the links of this Trips. # noqa: E501 + + + :return: The links of this Trips. # noqa: E501 + :rtype: TabLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Trips. + + + :param links: The links of this Trips. # noqa: E501 + :type: TabLinks + """ + + self._links = links + + @property + def current_page(self): + """Gets the current_page of this Trips. # noqa: E501 + + + :return: The current_page of this Trips. # noqa: E501 + :rtype: int + """ + return self._current_page + + @current_page.setter + def current_page(self, current_page): + """Sets the current_page of this Trips. + + + :param current_page: The current_page of this Trips. # noqa: E501 + :type: int + """ + + self._current_page = current_page + + @property + def total(self): + """Gets the total of this Trips. # noqa: E501 + + + :return: The total of this Trips. # noqa: E501 + :rtype: int + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this Trips. + + + :param total: The total of this Trips. # noqa: E501 + :type: int + """ + + self._total = total + + @property + def total_page(self): + """Gets the total_page of this Trips. # noqa: E501 + + + :return: The total_page of this Trips. # noqa: E501 + :rtype: int + """ + return self._total_page + + @total_page.setter + def total_page(self, total_page): + """Sets the total_page of this Trips. + + + :param total_page: The total_page of this Trips. # noqa: E501 + :type: int + """ + + self._total_page = total_page + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Trips, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Trips): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/trips_embedded.py b/psa_connectedcar/models/trips_embedded.py new file mode 100644 index 0000000..27b7529 --- /dev/null +++ b/psa_connectedcar/models/trips_embedded.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class TripsEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'trips': 'list[Trip]' + } + + attribute_map = { + 'trips': 'trips' + } + + def __init__(self, trips=None): # noqa: E501 + """TripsEmbedded - a model defined in Swagger""" # noqa: E501 + + self._trips = None + self.discriminator = None + + if trips is not None: + self.trips = trips + + @property + def trips(self): + """Gets the trips of this TripsEmbedded. # noqa: E501 + + + :return: The trips of this TripsEmbedded. # noqa: E501 + :rtype: list[Trip] + """ + return self._trips + + @trips.setter + def trips(self, trips): + """Sets the trips of this TripsEmbedded. + + + :param trips: The trips of this TripsEmbedded. # noqa: E501 + :type: list[Trip] + """ + + self._trips = trips + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(TripsEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, TripsEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/updated_field.py b/psa_connectedcar/models/updated_field.py new file mode 100644 index 0000000..e240931 --- /dev/null +++ b/psa_connectedcar/models/updated_field.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class UpdatedField(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'updated_at': 'datetime' + } + + attribute_map = { + 'updated_at': 'updatedAt' + } + + def __init__(self, updated_at=None): # noqa: E501 + """UpdatedField - a model defined in Swagger""" # noqa: E501 + + self._updated_at = None + self.discriminator = None + + if updated_at is not None: + self.updated_at = updated_at + + @property + def updated_at(self): + """Gets the updated_at of this UpdatedField. # noqa: E501 + + Date when the resource has been updated. # noqa: E501 + + :return: The updated_at of this UpdatedField. # noqa: E501 + :rtype: datetime + """ + return self._updated_at + + @updated_at.setter + def updated_at(self, updated_at): + """Sets the updated_at of this UpdatedField. + + Date when the resource has been updated. # noqa: E501 + + :param updated_at: The updated_at of this UpdatedField. # noqa: E501 + :type: datetime + """ + + self._updated_at = updated_at + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UpdatedField, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UpdatedField): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/url.py b/psa_connectedcar/models/url.py new file mode 100644 index 0000000..da166ef --- /dev/null +++ b/psa_connectedcar/models/url.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Url(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """Url - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Url, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Url): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/user.py b/psa_connectedcar/models/user.py new file mode 100644 index 0000000..42f3033 --- /dev/null +++ b/psa_connectedcar/models/user.py @@ -0,0 +1,253 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class User(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime', + 'embedded': 'UserEmbedded', + 'links': 'UserLinks', + 'email': 'str', + 'first_name': 'str', + 'last_name': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'embedded': '_embedded', + 'links': '_links', + 'email': 'email', + 'first_name': 'firstName', + 'last_name': 'lastName' + } + + def __init__(self, created_at=None, embedded=None, links=None, email=None, first_name=None, last_name=None): # noqa: E501 + """User - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self._embedded = None + self._links = None + self._email = None + self._first_name = None + self._last_name = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if embedded is not None: + self.embedded = embedded + if links is not None: + self.links = links + if email is not None: + self.email = email + if first_name is not None: + self.first_name = first_name + if last_name is not None: + self.last_name = last_name + + @property + def created_at(self): + """Gets the created_at of this User. # noqa: E501 + + Date when the resource has been created. # noqa: E501 + + :return: The created_at of this User. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this User. + + Date when the resource has been created. # noqa: E501 + + :param created_at: The created_at of this User. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def embedded(self): + """Gets the embedded of this User. # noqa: E501 + + + :return: The embedded of this User. # noqa: E501 + :rtype: UserEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this User. + + + :param embedded: The embedded of this User. # noqa: E501 + :type: UserEmbedded + """ + + self._embedded = embedded + + @property + def links(self): + """Gets the links of this User. # noqa: E501 + + + :return: The links of this User. # noqa: E501 + :rtype: UserLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this User. + + + :param links: The links of this User. # noqa: E501 + :type: UserLinks + """ + + self._links = links + + @property + def email(self): + """Gets the email of this User. # noqa: E501 + + Mail of user # noqa: E501 + + :return: The email of this User. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this User. + + Mail of user # noqa: E501 + + :param email: The email of this User. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def first_name(self): + """Gets the first_name of this User. # noqa: E501 + + First name of user # noqa: E501 + + :return: The first_name of this User. # noqa: E501 + :rtype: str + """ + return self._first_name + + @first_name.setter + def first_name(self, first_name): + """Sets the first_name of this User. + + First name of user # noqa: E501 + + :param first_name: The first_name of this User. # noqa: E501 + :type: str + """ + + self._first_name = first_name + + @property + def last_name(self): + """Gets the last_name of this User. # noqa: E501 + + Last name of user # noqa: E501 + + :return: The last_name of this User. # noqa: E501 + :rtype: str + """ + return self._last_name + + @last_name.setter + def last_name(self, last_name): + """Sets the last_name of this User. + + Last name of user # noqa: E501 + + :param last_name: The last_name of this User. # noqa: E501 + :type: str + """ + + self._last_name = last_name + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(User, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, User): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/user_embedded.py b/psa_connectedcar/models/user_embedded.py new file mode 100644 index 0000000..7a3b525 --- /dev/null +++ b/psa_connectedcar/models/user_embedded.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class UserEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'vehicles': 'list[Vehicle]' + } + + attribute_map = { + 'vehicles': 'Vehicles' + } + + def __init__(self, vehicles=None): # noqa: E501 + """UserEmbedded - a model defined in Swagger""" # noqa: E501 + + self._vehicles = None + self.discriminator = None + + if vehicles is not None: + self.vehicles = vehicles + + @property + def vehicles(self): + """Gets the vehicles of this UserEmbedded. # noqa: E501 + + + :return: The vehicles of this UserEmbedded. # noqa: E501 + :rtype: list[Vehicle] + """ + return self._vehicles + + @vehicles.setter + def vehicles(self, vehicles): + """Sets the vehicles of this UserEmbedded. + + + :param vehicles: The vehicles of this UserEmbedded. # noqa: E501 + :type: list[Vehicle] + """ + + self._vehicles = vehicles + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UserEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/user_links.py b/psa_connectedcar/models/user_links.py new file mode 100644 index 0000000..6be4b47 --- /dev/null +++ b/psa_connectedcar/models/user_links.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class UserLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_self': 'Link', + 'vehicles': 'Link' + } + + attribute_map = { + '_self': 'self', + 'vehicles': 'vehicles' + } + + def __init__(self, _self=None, vehicles=None): # noqa: E501 + """UserLinks - a model defined in Swagger""" # noqa: E501 + + self.__self = None + self._vehicles = None + self.discriminator = None + + if _self is not None: + self._self = _self + if vehicles is not None: + self.vehicles = vehicles + + @property + def _self(self): + """Gets the _self of this UserLinks. # noqa: E501 + + + :return: The _self of this UserLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this UserLinks. + + + :param _self: The _self of this UserLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + @property + def vehicles(self): + """Gets the vehicles of this UserLinks. # noqa: E501 + + + :return: The vehicles of this UserLinks. # noqa: E501 + :rtype: Link + """ + return self._vehicles + + @vehicles.setter + def vehicles(self, vehicles): + """Sets the vehicles of this UserLinks. + + + :param vehicles: The vehicles of this UserLinks. # noqa: E501 + :type: Link + """ + + self._vehicles = vehicles + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UserLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UserLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/vect2_d.py b/psa_connectedcar/models/vect2_d.py new file mode 100644 index 0000000..e077c71 --- /dev/null +++ b/psa_connectedcar/models/vect2_d.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Vect2D(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """Vect2D - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Vect2D, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Vect2D): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/vehicle.py b/psa_connectedcar/models/vehicle.py new file mode 100644 index 0000000..ebf7651 --- /dev/null +++ b/psa_connectedcar/models/vehicle.py @@ -0,0 +1,335 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Vehicle(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'created_at': 'datetime', + 'embedded': 'object', + 'links': 'VehicleLinks', + 'brand': 'str', + 'engine': 'list[VehicleEngine]', + 'id': 'str', + 'label': 'str', + 'pictures': 'list[Url]', + 'vin': 'str' + } + + attribute_map = { + 'created_at': 'createdAt', + 'embedded': '_embedded', + 'links': '_links', + 'brand': 'brand', + 'engine': 'engine', + 'id': 'id', + 'label': 'label', + 'pictures': 'pictures', + 'vin': 'vin' + } + + def __init__(self, created_at=None, embedded=None, links=None, brand=None, engine=None, id=None, label=None, pictures=None, vin=None): # noqa: E501 + """Vehicle - a model defined in Swagger""" # noqa: E501 + + self._created_at = None + self._embedded = None + self._links = None + self._brand = None + self._engine = None + self._id = None + self._label = None + self._pictures = None + self._vin = None + self.discriminator = None + + if created_at is not None: + self.created_at = created_at + if embedded is not None: + self.embedded = embedded + if links is not None: + self.links = links + if brand is not None: + self.brand = brand + if engine is not None: + self.engine = engine + if id is not None: + self.id = id + if label is not None: + self.label = label + if pictures is not None: + self.pictures = pictures + if vin is not None: + self.vin = vin + + @property + def created_at(self): + """Gets the created_at of this Vehicle. # noqa: E501 + + Date when the resource has been created. # noqa: E501 + + :return: The created_at of this Vehicle. # noqa: E501 + :rtype: datetime + """ + return self._created_at + + @created_at.setter + def created_at(self, created_at): + """Sets the created_at of this Vehicle. + + Date when the resource has been created. # noqa: E501 + + :param created_at: The created_at of this Vehicle. # noqa: E501 + :type: datetime + """ + + self._created_at = created_at + + @property + def embedded(self): + """Gets the embedded of this Vehicle. # noqa: E501 + + + :return: The embedded of this Vehicle. # noqa: E501 + :rtype: object + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Vehicle. + + + :param embedded: The embedded of this Vehicle. # noqa: E501 + :type: object + """ + + self._embedded = embedded + + @property + def links(self): + """Gets the links of this Vehicle. # noqa: E501 + + + :return: The links of this Vehicle. # noqa: E501 + :rtype: VehicleLinks + """ + return self._links + + @links.setter + def links(self, links): + """Sets the links of this Vehicle. + + + :param links: The links of this Vehicle. # noqa: E501 + :type: VehicleLinks + """ + + self._links = links + + @property + def brand(self): + """Gets the brand of this Vehicle. # noqa: E501 + + Brand of a vehicle # noqa: E501 + + :return: The brand of this Vehicle. # noqa: E501 + :rtype: str + """ + return self._brand + + @brand.setter + def brand(self, brand): + """Sets the brand of this Vehicle. + + Brand of a vehicle # noqa: E501 + + :param brand: The brand of this Vehicle. # noqa: E501 + :type: str + """ + + self._brand = brand + + @property + def engine(self): + """Gets the engine of this Vehicle. # noqa: E501 + + Engine of a vehicle # noqa: E501 + + :return: The engine of this Vehicle. # noqa: E501 + :rtype: list[VehicleEngine] + """ + return self._engine + + @engine.setter + def engine(self, engine): + """Sets the engine of this Vehicle. + + Engine of a vehicle # noqa: E501 + + :param engine: The engine of this Vehicle. # noqa: E501 + :type: list[VehicleEngine] + """ + + self._engine = engine + + @property + def id(self): + """Gets the id of this Vehicle. # noqa: E501 + + + :return: The id of this Vehicle. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Vehicle. + + + :param id: The id of this Vehicle. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def label(self): + """Gets the label of this Vehicle. # noqa: E501 + + Version of a vehicle # noqa: E501 + + :return: The label of this Vehicle. # noqa: E501 + :rtype: str + """ + return self._label + + @label.setter + def label(self, label): + """Sets the label of this Vehicle. + + Version of a vehicle # noqa: E501 + + :param label: The label of this Vehicle. # noqa: E501 + :type: str + """ + + self._label = label + + @property + def pictures(self): + """Gets the pictures of this Vehicle. # noqa: E501 + + With the links it's possible to see the pictures of the vehicle # noqa: E501 + + :return: The pictures of this Vehicle. # noqa: E501 + :rtype: list[Url] + """ + return self._pictures + + @pictures.setter + def pictures(self, pictures): + """Sets the pictures of this Vehicle. + + With the links it's possible to see the pictures of the vehicle # noqa: E501 + + :param pictures: The pictures of this Vehicle. # noqa: E501 + :type: list[Url] + """ + + self._pictures = pictures + + @property + def vin(self): + """Gets the vin of this Vehicle. # noqa: E501 + + Vehicle Identification Number # noqa: E501 + + :return: The vin of this Vehicle. # noqa: E501 + :rtype: str + """ + return self._vin + + @vin.setter + def vin(self, vin): + """Sets the vin of this Vehicle. + + Vehicle Identification Number # noqa: E501 + + :param vin: The vin of this Vehicle. # noqa: E501 + :type: str + """ + + self._vin = vin + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Vehicle, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Vehicle): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/vehicle_engine.py b/psa_connectedcar/models/vehicle_engine.py new file mode 100644 index 0000000..924cd59 --- /dev/null +++ b/psa_connectedcar/models/vehicle_engine.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class VehicleEngine(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + '_class': 'str', + 'energy': 'str' + } + + attribute_map = { + '_class': 'class', + 'energy': 'energy' + } + + def __init__(self, _class='Thermic', energy=None): # noqa: E501 + """VehicleEngine - a model defined in Swagger""" # noqa: E501 + + self.__class = None + self._energy = None + self.discriminator = None + + if _class is not None: + self._class = _class + if energy is not None: + self.energy = energy + + @property + def _class(self): + """Gets the _class of this VehicleEngine. # noqa: E501 + + + :return: The _class of this VehicleEngine. # noqa: E501 + :rtype: str + """ + return self.__class + + @_class.setter + def _class(self, _class): + """Sets the _class of this VehicleEngine. + + + :param _class: The _class of this VehicleEngine. # noqa: E501 + :type: str + """ + allowed_values = ["Thermic", "Electric"] # noqa: E501 + if _class not in allowed_values: + raise ValueError( + "Invalid value for `_class` ({0}), must be one of {1}" # noqa: E501 + .format(_class, allowed_values) + ) + + self.__class = _class + + @property + def energy(self): + """Gets the energy of this VehicleEngine. # noqa: E501 + + Type of energy of a vehicle (Not available for Electric class) # noqa: E501 + + :return: The energy of this VehicleEngine. # noqa: E501 + :rtype: str + """ + return self._energy + + @energy.setter + def energy(self, energy): + """Sets the energy of this VehicleEngine. + + Type of energy of a vehicle (Not available for Electric class) # noqa: E501 + + :param energy: The energy of this VehicleEngine. # noqa: E501 + :type: str + """ + allowed_values = ["GPL", "Gasoil", "Petrol", "Biologic"] # noqa: E501 + if energy not in allowed_values: + raise ValueError( + "Invalid value for `energy` ({0}), must be one of {1}" # noqa: E501 + .format(energy, allowed_values) + ) + + self._energy = energy + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VehicleEngine, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VehicleEngine): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/vehicle_links.py b/psa_connectedcar/models/vehicle_links.py new file mode 100644 index 0000000..e582500 --- /dev/null +++ b/psa_connectedcar/models/vehicle_links.py @@ -0,0 +1,271 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class VehicleLinks(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'alerts': 'Link', + 'last_position': 'Link', + 'maintenance': 'Link', + '_self': 'Link', + 'status': 'Link', + 'telemetry': 'Link', + 'trips': 'Link' + } + + attribute_map = { + 'alerts': 'alerts', + 'last_position': 'lastPosition', + 'maintenance': 'maintenance', + '_self': 'self', + 'status': 'status', + 'telemetry': 'telemetry', + 'trips': 'trips' + } + + def __init__(self, alerts=None, last_position=None, maintenance=None, _self=None, status=None, telemetry=None, trips=None): # noqa: E501 + """VehicleLinks - a model defined in Swagger""" # noqa: E501 + + self._alerts = None + self._last_position = None + self._maintenance = None + self.__self = None + self._status = None + self._telemetry = None + self._trips = None + self.discriminator = None + + if alerts is not None: + self.alerts = alerts + if last_position is not None: + self.last_position = last_position + if maintenance is not None: + self.maintenance = maintenance + if _self is not None: + self._self = _self + if status is not None: + self.status = status + if telemetry is not None: + self.telemetry = telemetry + if trips is not None: + self.trips = trips + + @property + def alerts(self): + """Gets the alerts of this VehicleLinks. # noqa: E501 + + + :return: The alerts of this VehicleLinks. # noqa: E501 + :rtype: Link + """ + return self._alerts + + @alerts.setter + def alerts(self, alerts): + """Sets the alerts of this VehicleLinks. + + + :param alerts: The alerts of this VehicleLinks. # noqa: E501 + :type: Link + """ + + self._alerts = alerts + + @property + def last_position(self): + """Gets the last_position of this VehicleLinks. # noqa: E501 + + + :return: The last_position of this VehicleLinks. # noqa: E501 + :rtype: Link + """ + return self._last_position + + @last_position.setter + def last_position(self, last_position): + """Sets the last_position of this VehicleLinks. + + + :param last_position: The last_position of this VehicleLinks. # noqa: E501 + :type: Link + """ + + self._last_position = last_position + + @property + def maintenance(self): + """Gets the maintenance of this VehicleLinks. # noqa: E501 + + + :return: The maintenance of this VehicleLinks. # noqa: E501 + :rtype: Link + """ + return self._maintenance + + @maintenance.setter + def maintenance(self, maintenance): + """Sets the maintenance of this VehicleLinks. + + + :param maintenance: The maintenance of this VehicleLinks. # noqa: E501 + :type: Link + """ + + self._maintenance = maintenance + + @property + def _self(self): + """Gets the _self of this VehicleLinks. # noqa: E501 + + + :return: The _self of this VehicleLinks. # noqa: E501 + :rtype: Link + """ + return self.__self + + @_self.setter + def _self(self, _self): + """Sets the _self of this VehicleLinks. + + + :param _self: The _self of this VehicleLinks. # noqa: E501 + :type: Link + """ + + self.__self = _self + + @property + def status(self): + """Gets the status of this VehicleLinks. # noqa: E501 + + + :return: The status of this VehicleLinks. # noqa: E501 + :rtype: Link + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this VehicleLinks. + + + :param status: The status of this VehicleLinks. # noqa: E501 + :type: Link + """ + + self._status = status + + @property + def telemetry(self): + """Gets the telemetry of this VehicleLinks. # noqa: E501 + + + :return: The telemetry of this VehicleLinks. # noqa: E501 + :rtype: Link + """ + return self._telemetry + + @telemetry.setter + def telemetry(self, telemetry): + """Sets the telemetry of this VehicleLinks. + + + :param telemetry: The telemetry of this VehicleLinks. # noqa: E501 + :type: Link + """ + + self._telemetry = telemetry + + @property + def trips(self): + """Gets the trips of this VehicleLinks. # noqa: E501 + + + :return: The trips of this VehicleLinks. # noqa: E501 + :rtype: Link + """ + return self._trips + + @trips.setter + def trips(self, trips): + """Sets the trips of this VehicleLinks. + + + :param trips: The trips of this VehicleLinks. # noqa: E501 + :type: Link + """ + + self._trips = trips + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VehicleLinks, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VehicleLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/vehicle_odometer.py b/psa_connectedcar/models/vehicle_odometer.py new file mode 100644 index 0000000..4dac0db --- /dev/null +++ b/psa_connectedcar/models/vehicle_odometer.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class VehicleOdometer(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'mileage': 'float' + } + + attribute_map = { + 'mileage': 'mileage' + } + + def __init__(self, mileage=None): # noqa: E501 + """VehicleOdometer - a model defined in Swagger""" # noqa: E501 + + self._mileage = None + self.discriminator = None + + if mileage is not None: + self.mileage = mileage + + @property + def mileage(self): + """Gets the mileage of this VehicleOdometer. # noqa: E501 + + Vehicle mileage expressed in KM. # noqa: E501 + + :return: The mileage of this VehicleOdometer. # noqa: E501 + :rtype: float + """ + return self._mileage + + @mileage.setter + def mileage(self, mileage): + """Sets the mileage of this VehicleOdometer. + + Vehicle mileage expressed in KM. # noqa: E501 + + :param mileage: The mileage of this VehicleOdometer. # noqa: E501 + :type: float + """ + + self._mileage = mileage + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VehicleOdometer, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VehicleOdometer): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/vehicles.py b/psa_connectedcar/models/vehicles.py new file mode 100644 index 0000000..f6a8715 --- /dev/null +++ b/psa_connectedcar/models/vehicles.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class Vehicles(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'VehiclesEmbedded' + } + + attribute_map = { + 'embedded': '_embedded' + } + + def __init__(self, embedded=None): # noqa: E501 + """Vehicles - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + + @property + def embedded(self): + """Gets the embedded of this Vehicles. # noqa: E501 + + + :return: The embedded of this Vehicles. # noqa: E501 + :rtype: VehiclesEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this Vehicles. + + + :param embedded: The embedded of this Vehicles. # noqa: E501 + :type: VehiclesEmbedded + """ + + self._embedded = embedded + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Vehicles, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Vehicles): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/vehicles_embedded.py b/psa_connectedcar/models/vehicles_embedded.py new file mode 100644 index 0000000..4c9b293 --- /dev/null +++ b/psa_connectedcar/models/vehicles_embedded.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class VehiclesEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'vehicles': 'list[Vehicle]' + } + + attribute_map = { + 'vehicles': 'vehicles' + } + + def __init__(self, vehicles=None): # noqa: E501 + """VehiclesEmbedded - a model defined in Swagger""" # noqa: E501 + + self._vehicles = None + self.discriminator = None + + if vehicles is not None: + self.vehicles = vehicles + + @property + def vehicles(self): + """Gets the vehicles of this VehiclesEmbedded. # noqa: E501 + + + :return: The vehicles of this VehiclesEmbedded. # noqa: E501 + :rtype: list[Vehicle] + """ + return self._vehicles + + @vehicles.setter + def vehicles(self, vehicles): + """Sets the vehicles of this VehiclesEmbedded. + + + :param vehicles: The vehicles of this VehiclesEmbedded. # noqa: E501 + :type: list[Vehicle] + """ + + self._vehicles = vehicles + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(VehiclesEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, VehiclesEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/way_points.py b/psa_connectedcar/models/way_points.py new file mode 100644 index 0000000..ab02aa8 --- /dev/null +++ b/psa_connectedcar/models/way_points.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class WayPoints(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'embedded': 'WayPointsEmbedded' + } + + attribute_map = { + 'embedded': '_embedded' + } + + def __init__(self, embedded=None): # noqa: E501 + """WayPoints - a model defined in Swagger""" # noqa: E501 + + self._embedded = None + self.discriminator = None + + if embedded is not None: + self.embedded = embedded + + @property + def embedded(self): + """Gets the embedded of this WayPoints. # noqa: E501 + + + :return: The embedded of this WayPoints. # noqa: E501 + :rtype: WayPointsEmbedded + """ + return self._embedded + + @embedded.setter + def embedded(self, embedded): + """Sets the embedded of this WayPoints. + + + :param embedded: The embedded of this WayPoints. # noqa: E501 + :type: WayPointsEmbedded + """ + + self._embedded = embedded + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WayPoints, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WayPoints): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/way_points_embedded.py b/psa_connectedcar/models/way_points_embedded.py new file mode 100644 index 0000000..83d37f6 --- /dev/null +++ b/psa_connectedcar/models/way_points_embedded.py @@ -0,0 +1,144 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class WayPointsEmbedded(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'positions': 'list[Position]', + 'reduced': 'bool' + } + + attribute_map = { + 'positions': 'positions', + 'reduced': 'reduced' + } + + def __init__(self, positions=None, reduced=None): # noqa: E501 + """WayPointsEmbedded - a model defined in Swagger""" # noqa: E501 + + self._positions = None + self._reduced = None + self.discriminator = None + + self.positions = positions + if reduced is not None: + self.reduced = reduced + + @property + def positions(self): + """Gets the positions of this WayPointsEmbedded. # noqa: E501 + + + :return: The positions of this WayPointsEmbedded. # noqa: E501 + :rtype: list[Position] + """ + return self._positions + + @positions.setter + def positions(self, positions): + """Sets the positions of this WayPointsEmbedded. + + + :param positions: The positions of this WayPointsEmbedded. # noqa: E501 + :type: list[Position] + """ + if positions is None: + raise ValueError("Invalid value for `positions`, must not be `None`") # noqa: E501 + + self._positions = positions + + @property + def reduced(self): + """Gets the reduced of this WayPointsEmbedded. # noqa: E501 + + Determines whether this result set (page) has been reduced due to path simplifying (by providing a tolerance factor). ### Note: The number of results may be lower than the specified page 'size' due to the applying of the path simplifying after resolving the page resultset. # noqa: E501 + + :return: The reduced of this WayPointsEmbedded. # noqa: E501 + :rtype: bool + """ + return self._reduced + + @reduced.setter + def reduced(self, reduced): + """Sets the reduced of this WayPointsEmbedded. + + Determines whether this result set (page) has been reduced due to path simplifying (by providing a tolerance factor). ### Note: The number of results may be lower than the specified page 'size' due to the applying of the path simplifying after resolving the page resultset. # noqa: E501 + + :param reduced: The reduced of this WayPointsEmbedded. # noqa: E501 + :type: bool + """ + + self._reduced = reduced + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(WayPointsEmbedded, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WayPointsEmbedded): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/x_error.py b/psa_connectedcar/models/x_error.py new file mode 100644 index 0000000..36cc098 --- /dev/null +++ b/psa_connectedcar/models/x_error.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class XError(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'code': 'int', + 'debug': 'str', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'debug': 'debug', + 'message': 'message' + } + + def __init__(self, code=None, debug=None, message=None): # noqa: E501 + """XError - a model defined in Swagger""" # noqa: E501 + + self._code = None + self._debug = None + self._message = None + self.discriminator = None + + if code is not None: + self.code = code + if debug is not None: + self.debug = debug + if message is not None: + self.message = message + + @property + def code(self): + """Gets the code of this XError. # noqa: E501 + + + :return: The code of this XError. # noqa: E501 + :rtype: int + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this XError. + + + :param code: The code of this XError. # noqa: E501 + :type: int + """ + + self._code = code + + @property + def debug(self): + """Gets the debug of this XError. # noqa: E501 + + + :return: The debug of this XError. # noqa: E501 + :rtype: str + """ + return self._debug + + @debug.setter + def debug(self, debug): + """Sets the debug of this XError. + + + :param debug: The debug of this XError. # noqa: E501 + :type: str + """ + + self._debug = debug + + @property + def message(self): + """Gets the message of this XError. # noqa: E501 + + + :return: The message of this XError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this XError. + + + :param message: The message of this XError. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(XError, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, XError): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/zone_monitor_trigger.py b/psa_connectedcar/models/zone_monitor_trigger.py new file mode 100644 index 0000000..0f3fb42 --- /dev/null +++ b/psa_connectedcar/models/zone_monitor_trigger.py @@ -0,0 +1,175 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ZoneMonitorTrigger(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'place': 'object', + 'type': 'str', + 'within': 'str' + } + + attribute_map = { + 'place': 'place', + 'type': 'type', + 'within': 'within' + } + + def __init__(self, place=None, type='Spacial', within=None): # noqa: E501 + """ZoneMonitorTrigger - a model defined in Swagger""" # noqa: E501 + + self._place = None + self._type = None + self._within = None + self.discriminator = None + + if place is not None: + self.place = place + if type is not None: + self.type = type + if within is not None: + self.within = within + + @property + def place(self): + """Gets the place of this ZoneMonitorTrigger. # noqa: E501 + + + :return: The place of this ZoneMonitorTrigger. # noqa: E501 + :rtype: object + """ + return self._place + + @place.setter + def place(self, place): + """Sets the place of this ZoneMonitorTrigger. + + + :param place: The place of this ZoneMonitorTrigger. # noqa: E501 + :type: object + """ + + self._place = place + + @property + def type(self): + """Gets the type of this ZoneMonitorTrigger. # noqa: E501 + + + :return: The type of this ZoneMonitorTrigger. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this ZoneMonitorTrigger. + + + :param type: The type of this ZoneMonitorTrigger. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def within(self): + """Gets the within of this ZoneMonitorTrigger. # noqa: E501 + + containing mode. i.e wayPoints (such as Trip) start and /or end within or cross the container, # noqa: E501 + + :return: The within of this ZoneMonitorTrigger. # noqa: E501 + :rtype: str + """ + return self._within + + @within.setter + def within(self, within): + """Sets the within of this ZoneMonitorTrigger. + + containing mode. i.e wayPoints (such as Trip) start and /or end within or cross the container, # noqa: E501 + + :param within: The within of this ZoneMonitorTrigger. # noqa: E501 + :type: str + """ + allowed_values = ["start", "stop", "startOrStop", "startAndStop", "crossing"] # noqa: E501 + if within not in allowed_values: + raise ValueError( + "Invalid value for `within` ({0}), must be one of {1}" # noqa: E501 + .format(within, allowed_values) + ) + + self._within = within + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ZoneMonitorTrigger, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ZoneMonitorTrigger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/zone_trigger.py b/psa_connectedcar/models/zone_trigger.py new file mode 100644 index 0000000..44a92ac --- /dev/null +++ b/psa_connectedcar/models/zone_trigger.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ZoneTrigger(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'place': 'ZoneTriggerPlace', + 'transition': 'str' + } + + attribute_map = { + 'place': 'place', + 'transition': 'transition' + } + + def __init__(self, place=None, transition=None): # noqa: E501 + """ZoneTrigger - a model defined in Swagger""" # noqa: E501 + + self._place = None + self._transition = None + self.discriminator = None + + self.place = place + self.transition = transition + + @property + def place(self): + """Gets the place of this ZoneTrigger. # noqa: E501 + + + :return: The place of this ZoneTrigger. # noqa: E501 + :rtype: ZoneTriggerPlace + """ + return self._place + + @place.setter + def place(self, place): + """Sets the place of this ZoneTrigger. + + + :param place: The place of this ZoneTrigger. # noqa: E501 + :type: ZoneTriggerPlace + """ + if place is None: + raise ValueError("Invalid value for `place`, must not be `None`") # noqa: E501 + + self._place = place + + @property + def transition(self): + """Gets the transition of this ZoneTrigger. # noqa: E501 + + Zone monitoring type ('In' for monitoring entering zone and 'Out' formonitoring leaving zone), # noqa: E501 + + :return: The transition of this ZoneTrigger. # noqa: E501 + :rtype: str + """ + return self._transition + + @transition.setter + def transition(self, transition): + """Sets the transition of this ZoneTrigger. + + Zone monitoring type ('In' for monitoring entering zone and 'Out' formonitoring leaving zone), # noqa: E501 + + :param transition: The transition of this ZoneTrigger. # noqa: E501 + :type: str + """ + if transition is None: + raise ValueError("Invalid value for `transition`, must not be `None`") # noqa: E501 + allowed_values = ["In", "Out"] # noqa: E501 + if transition not in allowed_values: + raise ValueError( + "Invalid value for `transition` ({0}), must be one of {1}" # noqa: E501 + .format(transition, allowed_values) + ) + + self._transition = transition + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ZoneTrigger, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ZoneTrigger): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/zone_trigger_place.py b/psa_connectedcar/models/zone_trigger_place.py new file mode 100644 index 0000000..32f992d --- /dev/null +++ b/psa_connectedcar/models/zone_trigger_place.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ZoneTriggerPlace(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'center': 'ZoneTriggerPlaceCenter', + 'radius': 'float' + } + + attribute_map = { + 'center': 'center', + 'radius': 'radius' + } + + def __init__(self, center=None, radius=None): # noqa: E501 + """ZoneTriggerPlace - a model defined in Swagger""" # noqa: E501 + + self._center = None + self._radius = None + self.discriminator = None + + self.center = center + self.radius = radius + + @property + def center(self): + """Gets the center of this ZoneTriggerPlace. # noqa: E501 + + + :return: The center of this ZoneTriggerPlace. # noqa: E501 + :rtype: ZoneTriggerPlaceCenter + """ + return self._center + + @center.setter + def center(self, center): + """Sets the center of this ZoneTriggerPlace. + + + :param center: The center of this ZoneTriggerPlace. # noqa: E501 + :type: ZoneTriggerPlaceCenter + """ + if center is None: + raise ValueError("Invalid value for `center`, must not be `None`") # noqa: E501 + + self._center = center + + @property + def radius(self): + """Gets the radius of this ZoneTriggerPlace. # noqa: E501 + + Circle radius (expressed in KM) # noqa: E501 + + :return: The radius of this ZoneTriggerPlace. # noqa: E501 + :rtype: float + """ + return self._radius + + @radius.setter + def radius(self, radius): + """Sets the radius of this ZoneTriggerPlace. + + Circle radius (expressed in KM) # noqa: E501 + + :param radius: The radius of this ZoneTriggerPlace. # noqa: E501 + :type: float + """ + if radius is None: + raise ValueError("Invalid value for `radius`, must not be `None`") # noqa: E501 + + self._radius = radius + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ZoneTriggerPlace, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ZoneTriggerPlace): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/models/zone_trigger_place_center.py b/psa_connectedcar/models/zone_trigger_place_center.py new file mode 100644 index 0000000..35c855a --- /dev/null +++ b/psa_connectedcar/models/zone_trigger_place_center.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ZoneTriggerPlaceCenter(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'latitude': 'float', + 'longitude': 'float' + } + + attribute_map = { + 'latitude': 'latitude', + 'longitude': 'longitude' + } + + def __init__(self, latitude=None, longitude=None): # noqa: E501 + """ZoneTriggerPlaceCenter - a model defined in Swagger""" # noqa: E501 + + self._latitude = None + self._longitude = None + self.discriminator = None + + self.latitude = latitude + self.longitude = longitude + + @property + def latitude(self): + """Gets the latitude of this ZoneTriggerPlaceCenter. # noqa: E501 + + + :return: The latitude of this ZoneTriggerPlaceCenter. # noqa: E501 + :rtype: float + """ + return self._latitude + + @latitude.setter + def latitude(self, latitude): + """Sets the latitude of this ZoneTriggerPlaceCenter. + + + :param latitude: The latitude of this ZoneTriggerPlaceCenter. # noqa: E501 + :type: float + """ + if latitude is None: + raise ValueError("Invalid value for `latitude`, must not be `None`") # noqa: E501 + + self._latitude = latitude + + @property + def longitude(self): + """Gets the longitude of this ZoneTriggerPlaceCenter. # noqa: E501 + + + :return: The longitude of this ZoneTriggerPlaceCenter. # noqa: E501 + :rtype: float + """ + return self._longitude + + @longitude.setter + def longitude(self, longitude): + """Sets the longitude of this ZoneTriggerPlaceCenter. + + + :param longitude: The longitude of this ZoneTriggerPlaceCenter. # noqa: E501 + :type: float + """ + if longitude is None: + raise ValueError("Invalid value for `longitude`, must not be `None`") # noqa: E501 + + self._longitude = longitude + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ZoneTriggerPlaceCenter, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ZoneTriggerPlaceCenter): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/psa_connectedcar/rest.py b/psa_connectedcar/rest.py new file mode 100644 index 0000000..99559bb --- /dev/null +++ b/psa_connectedcar/rest.py @@ -0,0 +1,323 @@ +# coding: utf-8 + +""" + Groupe PSA Connected Car - WEB API B2C + + *PSA B2C Connected Car API* # Introduction This is the description of the *Groupe PSA Connected Car V2 API*. The speccification is is based on **OpenAPI Specification version 3** and can be displayed via [ReDoc](https://github.com/Rebilly/ReDoc)a or [Swagger](http://swagger.io). This API allows applications to fetch data from the connected Vehicles data platform. # Authentication PSA Connected Car APIs uses the [OAuth 2.0](https://tools.ietf.org/html/rfc6749) protocol for authentication and Authorization. any application require a valid [Access Token](https://tools.ietf.org/html/rfc6749#section-1.4) to access to user data. # Errors Error codes returned by all REST APIs comply with the standard. Nevertheless, PSA Services (callers) need to have more complete data structures (even when the answer is not Http-OK) to better detail the type of error by providing application code, message and a debugging code(for investigation purposes). The http code of the response is managed by the protocol itself (in the header). **Errors are returned as a generic error response:** * ```xError``` object model. # noqa: E501 + + OpenAPI spec version: 4.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = '{}' + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/server.py b/server.py new file mode 100644 index 0000000..035f601 --- /dev/null +++ b/server.py @@ -0,0 +1,91 @@ +import threading +from datetime import timedelta +from threading import Thread + +from oauth2_client.credentials_manager import OAuthError + +from ChargeControl import ChargeControls +from MyPSACC import * +from flask import Flask, request, jsonify +import argparse +parser = argparse.ArgumentParser() + +app = Flask(__name__) + +@app.route('/getvehicules') +def getvehicules(): + return jsonify(myp.getVIN()) + +@app.route('/get_vehiculeinfo/') +def getVehiculeInfo(vin): + response = app.response_class( + response=json.dumps(myp.getVehiculeinfo(vin).to_dict(),default=str), + status=200, + mimetype='application/json' + ) + return response + +@app.route('/charge_now//') +def chargeNow(vin,charge): + return jsonify(myp.charge_now(vin,charge != 0 )) + +@app.route('/charge_hour') +def change_charge_hour(): + return jsonify(myp.change_charge_hour(request.form['vin'],request.form['hour'],request.form['minute'])) + +@app.route('/wakeup/') +def wakeup(vin): + return jsonify(myp.wakeup(vin)) + +@app.route('/preconditioning//') +def preconditioning(vin, activate): + return jsonify(myp.preconditioning(vin, activate)) + +def saveconfig(mypeugeot:MyPSACC): + myp.saveconfig() + threading.Timer(30, saveconfig, args=[mypeugeot]).start() + +#Set a battery threshold and schedule an hour to stop the charge +@app.route('/charge_control') +def charge_control(): + print(request) + vin = request.args['vin'] + charge_control = chc.get(vin) + if charge_control is None: + return jsonify("error: VIN not in list") + if 'hour' in request.args or 'minute' in request.args: + charge_control.set_stop_hour([int(request.args["hour"]), int(request.args["minute"])]) + if 'percentage' in request.args : + charge_control.percentage_threshold = int(request.args['percentage']) + chc.saveconfig() + return jsonify(charge_control.get_dict()) + +def parse_args(): + parser = argparse.ArgumentParser() + parser.add_argument("-f","--config", help="config file",type = argparse.FileType('r')) + parser.add_argument("-c","--charge-control", help="enable charge control",action="store_true") + parser.parse_args() + return parser + +if __name__ == "__main__": + parser = parse_args() + args = parser.parse_args() + print(args.__dict__) + if args.config: + myp = MyPSACC.loadconfig(name=args.config.name) + else: + myp = MyPSACC.loadconfig() + try: + myp.manager._refresh_token() + except OAuthError: + client_email = input("mypeugeot email: ") + client_paswword = input("mypeugeot password: ") + myp.connect(client_email,client_paswword) + print(myp.get_vehicles()) + myp.startmqtt() + t1=Thread(target=app.run) + t1.start() + saveconfig(myp) + if args.charge_control: + chc = ChargeControls.load_config(myp) + chc.start()