"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper


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

    Attributes:
        arrival_program_id (int): Arrival program id
        arrival_program_name (str): Arrival program name
        can_access (bool): Property to check client can access arrival service.
        locations_i_ds (List[int]): List of locations where arrival service can
            availed

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "arrival_program_id": "ArrivalProgramID",
        "arrival_program_name": "ArrivalProgramName",
        "can_access": "CanAccess",
        "locations_i_ds": "LocationsIDs",
    }

    _optionals = [
        "arrival_program_id",
        "arrival_program_name",
        "can_access",
        "locations_i_ds",
    ]

    def __init__(
        self,
        arrival_program_id=APIHelper.SKIP,
        arrival_program_name=APIHelper.SKIP,
        can_access=APIHelper.SKIP,
        locations_i_ds=APIHelper.SKIP):
        """Initialize a ClientArrival instance."""
        # Initialize members of the class
        if arrival_program_id is not APIHelper.SKIP:
            self.arrival_program_id = arrival_program_id
        if arrival_program_name is not APIHelper.SKIP:
            self.arrival_program_name = arrival_program_name
        if can_access is not APIHelper.SKIP:
            self.can_access = can_access
        if locations_i_ds is not APIHelper.SKIP:
            self.locations_i_ds = locations_i_ds

    @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
        arrival_program_id =\
            dictionary.get("ArrivalProgramID")\
            if dictionary.get("ArrivalProgramID")\
                else APIHelper.SKIP
        arrival_program_name =\
            dictionary.get("ArrivalProgramName")\
            if dictionary.get("ArrivalProgramName")\
                else APIHelper.SKIP
        can_access =\
            dictionary.get("CanAccess")\
            if "CanAccess" in dictionary.keys()\
                else APIHelper.SKIP
        locations_i_ds =\
            dictionary.get("LocationsIDs")\
            if dictionary.get("LocationsIDs")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(arrival_program_id,
                   arrival_program_name,
                   can_access,
                   locations_i_ds)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _arrival_program_id=(
            self.arrival_program_id
            if hasattr(self, "arrival_program_id")
            else None
        )
        _arrival_program_name=(
            self.arrival_program_name
            if hasattr(self, "arrival_program_name")
            else None
        )
        _can_access=(
            self.can_access
            if hasattr(self, "can_access")
            else None
        )
        _locations_i_ds=(
            self.locations_i_ds
            if hasattr(self, "locations_i_ds")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"arrival_program_id={_arrival_program_id!r}, "
            f"arrival_program_name={_arrival_program_name!r}, "
            f"can_access={_can_access!r}, "
            f"locations_i_ds={_locations_i_ds!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _arrival_program_id=(
            self.arrival_program_id
            if hasattr(self, "arrival_program_id")
            else None
        )
        _arrival_program_name=(
            self.arrival_program_name
            if hasattr(self, "arrival_program_name")
            else None
        )
        _can_access=(
            self.can_access
            if hasattr(self, "can_access")
            else None
        )
        _locations_i_ds=(
            self.locations_i_ds
            if hasattr(self, "locations_i_ds")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"arrival_program_id={_arrival_program_id!s}, "
            f"arrival_program_name={_arrival_program_name!s}, "
            f"can_access={_can_access!s}, "
            f"locations_i_ds={_locations_i_ds!s}, "
            f")"
        )
