"""mindbodypublicapi.

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

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


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

    This is the sales rep DTO

    Attributes:
        id (int): The unique Id of the sales rep
        first_name (str): The firstname of the sales rep
        last_name (str): The lastname of the sales rep
        sales_rep_numbers (List[int]): The sales rep Ids that are assigned to the rep

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": "Id",
        "first_name": "FirstName",
        "last_name": "LastName",
        "sales_rep_numbers": "SalesRepNumbers",
    }

    _optionals = [
        "id",
        "first_name",
        "last_name",
        "sales_rep_numbers",
    ]

    def __init__(
        self,
        id=APIHelper.SKIP,
        first_name=APIHelper.SKIP,
        last_name=APIHelper.SKIP,
        sales_rep_numbers=APIHelper.SKIP):
        """Initialize a SalesRepResponse instance."""
        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id
        if first_name is not APIHelper.SKIP:
            self.first_name = first_name
        if last_name is not APIHelper.SKIP:
            self.last_name = last_name
        if sales_rep_numbers is not APIHelper.SKIP:
            self.sales_rep_numbers = sales_rep_numbers

    @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
        id =\
            dictionary.get("Id")\
            if dictionary.get("Id")\
                else APIHelper.SKIP
        first_name =\
            dictionary.get("FirstName")\
            if dictionary.get("FirstName")\
                else APIHelper.SKIP
        last_name =\
            dictionary.get("LastName")\
            if dictionary.get("LastName")\
                else APIHelper.SKIP
        sales_rep_numbers =\
            dictionary.get("SalesRepNumbers")\
            if dictionary.get("SalesRepNumbers")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(id,
                   first_name,
                   last_name,
                   sales_rep_numbers)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _sales_rep_numbers=(
            self.sales_rep_numbers
            if hasattr(self, "sales_rep_numbers")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!r}, "
            f"first_name={_first_name!r}, "
            f"last_name={_last_name!r}, "
            f"sales_rep_numbers={_sales_rep_numbers!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _first_name=(
            self.first_name
            if hasattr(self, "first_name")
            else None
        )
        _last_name=(
            self.last_name
            if hasattr(self, "last_name")
            else None
        )
        _sales_rep_numbers=(
            self.sales_rep_numbers
            if hasattr(self, "sales_rep_numbers")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!s}, "
            f"first_name={_first_name!s}, "
            f"last_name={_last_name!s}, "
            f"sales_rep_numbers={_sales_rep_numbers!s}, "
            f")"
        )
