"""mindbodypublicapi.

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

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


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

    Attributes:
        client_id (str): The ID of the requested client.
        unique_client_id (int): The unique ID of the requested client.  Note: you
            need to provide the 'UniqueClientId' OR the 'ClientId'. If both are
            provided, the 'UniqueClientId' takes precedence.
        client_associated_sites_offset (int): The number of sites to skip when
            returning the site associated with a client.
        cross_regional_lookup (bool): When `true`, indicates that past and scheduled
            client visits across all sites in the region are returned.  When `false`,
            indicates that only visits at the current site are returned.
        end_date (datetime): The date past which class visits are not returned.
            Default is today’s date
        start_date (datetime): The date before which class visits are not returned.
            Default is the end date
        include_waitlist_entries (bool): When `true`, waitlist entries are included
            in the response.  When `false`, waitlist entries are removed from the
            response.  Default: **false**
        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_id": "ClientId",
        "unique_client_id": "UniqueClientId",
        "client_associated_sites_offset": "ClientAssociatedSitesOffset",
        "cross_regional_lookup": "CrossRegionalLookup",
        "end_date": "EndDate",
        "start_date": "StartDate",
        "include_waitlist_entries": "IncludeWaitlistEntries",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "client_id",
        "unique_client_id",
        "client_associated_sites_offset",
        "cross_regional_lookup",
        "end_date",
        "start_date",
        "include_waitlist_entries",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        client_id=APIHelper.SKIP,
        unique_client_id=APIHelper.SKIP,
        client_associated_sites_offset=APIHelper.SKIP,
        cross_regional_lookup=APIHelper.SKIP,
        end_date=APIHelper.SKIP,
        start_date=APIHelper.SKIP,
        include_waitlist_entries=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetClientScheduleRequest instance."""
        # Initialize members of the class
        if client_id is not APIHelper.SKIP:
            self.client_id = client_id
        if unique_client_id is not APIHelper.SKIP:
            self.unique_client_id = unique_client_id
        if client_associated_sites_offset is not APIHelper.SKIP:
            self.client_associated_sites_offset = client_associated_sites_offset
        if cross_regional_lookup is not APIHelper.SKIP:
            self.cross_regional_lookup = cross_regional_lookup
        if end_date is not APIHelper.SKIP:
            self.end_date =\
                 APIHelper.apply_datetime_converter(
                end_date, APIHelper.RFC3339DateTime)\
                 if end_date else None
        if start_date is not APIHelper.SKIP:
            self.start_date =\
                 APIHelper.apply_datetime_converter(
                start_date, APIHelper.RFC3339DateTime)\
                 if start_date else None
        if include_waitlist_entries is not APIHelper.SKIP:
            self.include_waitlist_entries = include_waitlist_entries
        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_id =\
            dictionary.get("ClientId")\
            if dictionary.get("ClientId")\
                else APIHelper.SKIP
        unique_client_id =\
            dictionary.get("UniqueClientId")\
            if dictionary.get("UniqueClientId")\
                else APIHelper.SKIP
        client_associated_sites_offset =\
            dictionary.get("ClientAssociatedSitesOffset")\
            if dictionary.get("ClientAssociatedSitesOffset")\
                else APIHelper.SKIP
        cross_regional_lookup =\
            dictionary.get("CrossRegionalLookup")\
            if "CrossRegionalLookup" in dictionary.keys()\
                else APIHelper.SKIP
        end_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("EndDate")).datetime\
            if dictionary.get("EndDate") else APIHelper.SKIP
        start_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("StartDate")).datetime\
            if dictionary.get("StartDate") else APIHelper.SKIP
        include_waitlist_entries =\
            dictionary.get("IncludeWaitlistEntries")\
            if "IncludeWaitlistEntries" in dictionary.keys()\
                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_id,
                   unique_client_id,
                   client_associated_sites_offset,
                   cross_regional_lookup,
                   end_date,
                   start_date,
                   include_waitlist_entries,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _unique_client_id=(
            self.unique_client_id
            if hasattr(self, "unique_client_id")
            else None
        )
        _client_associated_sites_offset=(
            self.client_associated_sites_offset
            if hasattr(self, "client_associated_sites_offset")
            else None
        )
        _cross_regional_lookup=(
            self.cross_regional_lookup
            if hasattr(self, "cross_regional_lookup")
            else None
        )
        _end_date=(
            self.end_date
            if hasattr(self, "end_date")
            else None
        )
        _start_date=(
            self.start_date
            if hasattr(self, "start_date")
            else None
        )
        _include_waitlist_entries=(
            self.include_waitlist_entries
            if hasattr(self, "include_waitlist_entries")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!r}, "
            f"unique_client_id={_unique_client_id!r}, "
            f"client_associated_sites_offset={_client_associated_sites_offset!r}, "
            f"cross_regional_lookup={_cross_regional_lookup!r}, "
            f"end_date={_end_date!r}, "
            f"start_date={_start_date!r}, "
            f"include_waitlist_entries={_include_waitlist_entries!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _unique_client_id=(
            self.unique_client_id
            if hasattr(self, "unique_client_id")
            else None
        )
        _client_associated_sites_offset=(
            self.client_associated_sites_offset
            if hasattr(self, "client_associated_sites_offset")
            else None
        )
        _cross_regional_lookup=(
            self.cross_regional_lookup
            if hasattr(self, "cross_regional_lookup")
            else None
        )
        _end_date=(
            self.end_date
            if hasattr(self, "end_date")
            else None
        )
        _start_date=(
            self.start_date
            if hasattr(self, "start_date")
            else None
        )
        _include_waitlist_entries=(
            self.include_waitlist_entries
            if hasattr(self, "include_waitlist_entries")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!s}, "
            f"unique_client_id={_unique_client_id!s}, "
            f"client_associated_sites_offset={_client_associated_sites_offset!s}, "
            f"cross_regional_lookup={_cross_regional_lookup!s}, "
            f"end_date={_end_date!s}, "
            f"start_date={_start_date!s}, "
            f"include_waitlist_entries={_include_waitlist_entries!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
