"""visaacceptancemergedspec.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)


class VehicleData(object):
    """Implementation of the 'VehicleData' model.

    Attributes:
        connector_type (str): This field will contain connector type values for
            electric vehicle transactions.  Possible Values: 001 (AC - J1772 Type 1)
            002 (AC - Mennekes - Type 2) 003 (AC - GB/T) 100 (DC - CCS1) 101 (DC -
            CHAdeMO) 102 (DC - CCS2) 103 (DC - GB/T) 200 (NACS – Tesla)
        charging_reason_code (str): This field will contain charging reason code
            values for electric vehicle transactions.  Possible Values: 010 (Other
            Error) 011 (Connector Lock Failure) 012 (EV Communication Error) 013
            (Ground Failure) 014 (High Temperature) 015 (Internal Error) 016 (Over
            Current Failure) 017 (Over Voltage) 018 (Power Meter Failure) 019 (Power
            Switch Failure) 020 (Reader Failure) 021 (Reset Failure) 022 (Under
            Voltage) 023 (Weak Signal) 100 (No Error) 200 (Payment Related Error)
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "connector_type": "connectorType",
        "charging_reason_code": "chargingReasonCode",
    }

    _optionals = [
        "connector_type",
        "charging_reason_code",
    ]

    def __init__(
        self,
        connector_type=APIHelper.SKIP,
        charging_reason_code=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a VehicleData instance."""
        # Initialize members of the class
        if connector_type is not APIHelper.SKIP:
            self.connector_type = connector_type
        if charging_reason_code is not APIHelper.SKIP:
            self.charging_reason_code = charging_reason_code

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        connector_type =\
            dictionary.get("connectorType")\
            if dictionary.get("connectorType")\
                else APIHelper.SKIP
        charging_reason_code =\
            dictionary.get("chargingReasonCode")\
            if dictionary.get("chargingReasonCode")\
                else APIHelper.SKIP

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(connector_type,
                   charging_reason_code,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _connector_type=(
            self.connector_type
            if hasattr(self, "connector_type")
            else None
        )
        _charging_reason_code=(
            self.charging_reason_code
            if hasattr(self, "charging_reason_code")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"connector_type={_connector_type!r}, "
            f"charging_reason_code={_charging_reason_code!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _connector_type=(
            self.connector_type
            if hasattr(self, "connector_type")
            else None
        )
        _charging_reason_code=(
            self.charging_reason_code
            if hasattr(self, "charging_reason_code")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"connector_type={_connector_type!s}, "
            f"charging_reason_code={_charging_reason_code!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
