"""mindbodypublicapi.

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

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


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

    Attributes:
        balance_date (datetime): The date you want a balance relative to.   Default:
            **the current date**
        class_id (int): The class ID of the event for which you want a balance.
        client_ids (List[str]): The list of clients IDs for which you want account
            balances.
        limit (int): Number of results to include, defaults to 100
        offset (int): Page offset, defaults to 0.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "client_ids": "ClientIds",
        "balance_date": "BalanceDate",
        "class_id": "ClassId",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "balance_date",
        "class_id",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        client_ids=None,
        balance_date=APIHelper.SKIP,
        class_id=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetClientAccountBalancesRequest instance."""
        # Initialize members of the class
        if balance_date is not APIHelper.SKIP:
            self.balance_date =\
                 APIHelper.apply_datetime_converter(
                balance_date, APIHelper.RFC3339DateTime)\
                 if balance_date else None
        if class_id is not APIHelper.SKIP:
            self.class_id = class_id
        self.client_ids = client_ids
        if limit is not APIHelper.SKIP:
            self.limit = limit
        if offset is not APIHelper.SKIP:
            self.offset = offset

    @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
        client_ids =\
            dictionary.get("ClientIds")\
            if dictionary.get("ClientIds")\
                else None
        balance_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("BalanceDate")).datetime\
            if dictionary.get("BalanceDate") else APIHelper.SKIP
        class_id =\
            dictionary.get("ClassId")\
            if dictionary.get("ClassId")\
                else APIHelper.SKIP
        limit =\
            dictionary.get("Limit")\
            if dictionary.get("Limit")\
                else APIHelper.SKIP
        offset =\
            dictionary.get("Offset")\
            if dictionary.get("Offset")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(client_ids,
                   balance_date,
                   class_id,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _balance_date=(
            self.balance_date
            if hasattr(self, "balance_date")
            else None
        )
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _client_ids=self.client_ids
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"balance_date={_balance_date!r}, "
            f"class_id={_class_id!r}, "
            f"client_ids={_client_ids!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _balance_date=(
            self.balance_date
            if hasattr(self, "balance_date")
            else None
        )
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _client_ids=self.client_ids
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"balance_date={_balance_date!s}, "
            f"class_id={_class_id!s}, "
            f"client_ids={_client_ids!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
