"""mindbodypublicapi.

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

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


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

    Attributes:
        required_only (bool): When `true`, filters the results to only indexes that
            are required on creation.<br />  When `false` or omitted, returns all of
            the client indexes.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "required_only": "RequiredOnly",
    }

    _optionals = [
        "required_only",
    ]

    def __init__(
        self,
        required_only=APIHelper.SKIP):
        """Initialize a GetClientIndexesRequest instance."""
        # Initialize members of the class
        if required_only is not APIHelper.SKIP:
            self.required_only = required_only

    @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
        required_only =\
            dictionary.get("RequiredOnly")\
            if "RequiredOnly" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(required_only)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _required_only=(
            self.required_only
            if hasattr(self, "required_only")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"required_only={_required_only!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _required_only=(
            self.required_only
            if hasattr(self, "required_only")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"required_only={_required_only!s}, "
            f")"
        )
