Source code for pyevr.openapi_client.models.transport

# coding: utf-8

"""
    EVR API

    OpenAPI Generator'i jaoks kohandatud EVR API kirjeldus. Kasuta seda juhul, kui spetsifikatsioonile vastava EVR API kirjeldusega ei õnnestu klienti genereerida.  # noqa: E501

    The version of the OpenAPI document: 1.5.0
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from pyevr.openapi_client.configuration import Configuration


[docs]class Transport(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ """ Attributes: openapi_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. """ openapi_types = { 'transporter': 'Transporter', 'driver_name': 'str', 'driver_id_code': 'str', 'driver_phone': 'str', 'van_registration_number': 'str', 'trailer_registration_number': 'str' } attribute_map = { 'transporter': 'transporter', 'driver_name': 'driverName', 'driver_id_code': 'driverIdCode', 'driver_phone': 'driverPhone', 'van_registration_number': 'vanRegistrationNumber', 'trailer_registration_number': 'trailerRegistrationNumber' } def __init__(self, transporter=None, driver_name=None, driver_id_code=None, driver_phone=None, van_registration_number=None, trailer_registration_number=None, local_vars_configuration=None): # noqa: E501 """Transport - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local_vars_configuration self._transporter = None self._driver_name = None self._driver_id_code = None self._driver_phone = None self._van_registration_number = None self._trailer_registration_number = None self.discriminator = None self.transporter = transporter self.driver_name = driver_name self.driver_id_code = driver_id_code self.driver_phone = driver_phone self.van_registration_number = van_registration_number self.trailer_registration_number = trailer_registration_number @property def transporter(self): """Gets the transporter of this Transport. # noqa: E501 :return: The transporter of this Transport. # noqa: E501 :rtype: Transporter """ return self._transporter @transporter.setter def transporter(self, transporter): """Sets the transporter of this Transport. :param transporter: The transporter of this Transport. # noqa: E501 :type: Transporter """ if self.local_vars_configuration.client_side_validation and transporter is None: # noqa: E501 raise ValueError("Invalid value for `transporter`, must not be `None`") # noqa: E501 self._transporter = transporter @property def driver_name(self): """Gets the driver_name of this Transport. # noqa: E501 Autojuhi nimi # noqa: E501 :return: The driver_name of this Transport. # noqa: E501 :rtype: str """ return self._driver_name @driver_name.setter def driver_name(self, driver_name): """Sets the driver_name of this Transport. Autojuhi nimi # noqa: E501 :param driver_name: The driver_name of this Transport. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and driver_name is None: # noqa: E501 raise ValueError("Invalid value for `driver_name`, must not be `None`") # noqa: E501 if (self.local_vars_configuration.client_side_validation and driver_name is not None and len(driver_name) > 200): raise ValueError("Invalid value for `driver_name`, length must be less than or equal to `200`") # noqa: E501 if (self.local_vars_configuration.client_side_validation and driver_name is not None and len(driver_name) < 0): raise ValueError("Invalid value for `driver_name`, length must be greater than or equal to `0`") # noqa: E501 self._driver_name = driver_name @property def driver_id_code(self): """Gets the driver_id_code of this Transport. # noqa: E501 Autojuhi isikukood # noqa: E501 :return: The driver_id_code of this Transport. # noqa: E501 :rtype: str """ return self._driver_id_code @driver_id_code.setter def driver_id_code(self, driver_id_code): """Sets the driver_id_code of this Transport. Autojuhi isikukood # noqa: E501 :param driver_id_code: The driver_id_code of this Transport. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and driver_id_code is None: # noqa: E501 raise ValueError("Invalid value for `driver_id_code`, must not be `None`") # noqa: E501 if (self.local_vars_configuration.client_side_validation and driver_id_code is not None and len(driver_id_code) > 11): raise ValueError("Invalid value for `driver_id_code`, length must be less than or equal to `11`") # noqa: E501 if (self.local_vars_configuration.client_side_validation and driver_id_code is not None and len(driver_id_code) < 0): raise ValueError("Invalid value for `driver_id_code`, length must be greater than or equal to `0`") # noqa: E501 self._driver_id_code = driver_id_code @property def driver_phone(self): """Gets the driver_phone of this Transport. # noqa: E501 Autojuhi telefoninumber # noqa: E501 :return: The driver_phone of this Transport. # noqa: E501 :rtype: str """ return self._driver_phone @driver_phone.setter def driver_phone(self, driver_phone): """Sets the driver_phone of this Transport. Autojuhi telefoninumber # noqa: E501 :param driver_phone: The driver_phone of this Transport. # noqa: E501 :type: str """ if (self.local_vars_configuration.client_side_validation and driver_phone is not None and len(driver_phone) > 25): raise ValueError("Invalid value for `driver_phone`, length must be less than or equal to `25`") # noqa: E501 self._driver_phone = driver_phone @property def van_registration_number(self): """Gets the van_registration_number of this Transport. # noqa: E501 Veoki riiklik registreerimisnumber # noqa: E501 :return: The van_registration_number of this Transport. # noqa: E501 :rtype: str """ return self._van_registration_number @van_registration_number.setter def van_registration_number(self, van_registration_number): """Sets the van_registration_number of this Transport. Veoki riiklik registreerimisnumber # noqa: E501 :param van_registration_number: The van_registration_number of this Transport. # noqa: E501 :type: str """ if self.local_vars_configuration.client_side_validation and van_registration_number is None: # noqa: E501 raise ValueError("Invalid value for `van_registration_number`, must not be `None`") # noqa: E501 if (self.local_vars_configuration.client_side_validation and van_registration_number is not None and len(van_registration_number) > 10): raise ValueError("Invalid value for `van_registration_number`, length must be less than or equal to `10`") # noqa: E501 if (self.local_vars_configuration.client_side_validation and van_registration_number is not None and len(van_registration_number) < 0): raise ValueError("Invalid value for `van_registration_number`, length must be greater than or equal to `0`") # noqa: E501 self._van_registration_number = van_registration_number @property def trailer_registration_number(self): """Gets the trailer_registration_number of this Transport. # noqa: E501 Haagise kasutamise korral haagise riiklik registreerimisnumber # noqa: E501 :return: The trailer_registration_number of this Transport. # noqa: E501 :rtype: str """ return self._trailer_registration_number @trailer_registration_number.setter def trailer_registration_number(self, trailer_registration_number): """Sets the trailer_registration_number of this Transport. Haagise kasutamise korral haagise riiklik registreerimisnumber # noqa: E501 :param trailer_registration_number: The trailer_registration_number of this Transport. # noqa: E501 :type: str """ if (self.local_vars_configuration.client_side_validation and trailer_registration_number is not None and len(trailer_registration_number) > 10): raise ValueError("Invalid value for `trailer_registration_number`, length must be less than or equal to `10`") # noqa: E501 self._trailer_registration_number = trailer_registration_number
[docs] def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.openapi_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 return result
[docs] 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, Transport): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" if not isinstance(other, Transport): return True return self.to_dict() != other.to_dict()