"""mindbodypublicapi.

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

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


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

    Represents a request to retrieve client services with various filtering options.
    Note: if you want to request for a single client, use UniqueClientId or ClientId.
    For multiple clients, use UniqueClientIds or ClientIds.

    Attributes:
        client_id (str): The ID of the client to query. The results are a list of
            pricing options that the client has purchased. Note that “service” and
            “pricing option” are synonymous in this section of the documentation.
        unique_client_id (int): The unique ID of the client to query. Note that
            UniqueClientId takes precedence over ClientId.
        client_ids (List[str]): The IDs of the clients to query. The results are a
            list of pricing options that the clients have purchased.  ClientId
            parameter takes priority over ClientIds due to backward compatibility.
            So if you want to use ClientIds, then ClientId needs to be empty.  Either
            of ClientId or ClientIds need to be specified
        unique_client_ids (List[int]): The Unique IDs of the clients to query. Note
            that UniqueClientIds collection takes precedence over ClientIds
            collection.
        class_id (int): Filters results to only those pricing options that can be
            used to pay for this class.
        program_ids (List[int]): Filters results to pricing options that belong to
            one of the given program IDs.
        session_type_id (int): Filters results to pricing options that will pay for
            the given session type ID. Use this to find pricing options that will pay
            for a specific appointment type.
        location_ids (List[int]): Filters results to pricing options that can be used
            at the listed location IDs.
        visit_count (int): A filter on the minimum number of visits a service can pay
            for.
        start_date (datetime): Filters results to pricing options that are purchased
            on or after this date.  Default: **today’s date**
        end_date (datetime): Filters results to pricing options that are purchased on
            or before this date.   Default: **today’s date**
        show_active_only (bool): When `true`, includes active services only.
            Default: **false**
        cross_regional_lookup (bool): Used to retrieve a client’s pricing options
            from multiple sites within an organization. When included and set to
            `true`, it searches a maximum of ten sites with which this client is
            associated. When a client is associated with more than ten sites, use
            `ClientAssociatedSitesOffset` as many times as needed to search the
            additional sites with which the client is associated. You can use the
            `CrossRegionalClientAssociations` value from `GET
            CrossRegionalClientAssociations` to determine how many sites the client
            is associated with. Note that a `SiteID` is returned and populated in the
            `ClientServices` response when `CrossRegionalLookup` is set to `true`.
            Default: **false**
        ignore_cross_regional_site_limit (bool): Used to specify if the number of
            cross regional sites used to search for client’s pricing options should
            be ignored.   Default: **false**
        client_associated_sites_offset (int): Used to retrieve a client’s pricing
            options from multiple sites within an organization when the client is
            associated with more than ten sites. To change which ten sites are
            searched, change this offset value. A value of 0 means that no sites are
            skipped and the first ten sites are returned. You can use the
            `CrossRegionalClientAssociations` value from `GET
            CrossRegionalClientAssociations` to determine how many sites the client
            is associated with. Note that you must always have `CrossRegionalLookup`
            set to `true` to use this parameter.<br />  Default: **0**    For
            example, if a client is associated with 25 sites, you need to call
            `GetClientServices` three times, as follows:  * Use `GET
            CrossRegionalClientAssociations` to determine how many sites a client is
            associated with, which tells you how many additional calls you need to
            make.  * Either omit `ClientAssociatedSitesOffset` or set it to 0 to
            return the client’s services (pricing options) from sites 1-10.  * Set
            `ClientAssociatedSitesOffset` to 10 to return the client pricing options
            from sites 11-20  * Set `ClientAssociatedSitesOffset` to 20 to return the
            client pricing options from sites 21-25
        exclude_inactive_sites (bool): When this flag is set to `true`, will exclude
            inactive sites from the response.  Default: **false**
        use_activate_date (bool): When this flag is set to `true`, the date filtering
            will use activate date to filter the pricing options.  When this flag is
            set to `false`, the date filtering will use purchase date to filter the
            pricing options.  Default: **false**
        class_schedule_id (List[int]): Filters results to pricing options which are
            associated with one of the ClassScheduleIDs
        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_ids": "ClientIds",
        "unique_client_ids": "UniqueClientIds",
        "class_id": "ClassId",
        "program_ids": "ProgramIds",
        "session_type_id": "SessionTypeId",
        "location_ids": "LocationIds",
        "visit_count": "VisitCount",
        "start_date": "StartDate",
        "end_date": "EndDate",
        "show_active_only": "ShowActiveOnly",
        "cross_regional_lookup": "CrossRegionalLookup",
        "ignore_cross_regional_site_limit": "IgnoreCrossRegionalSiteLimit",
        "client_associated_sites_offset": "ClientAssociatedSitesOffset",
        "exclude_inactive_sites": "ExcludeInactiveSites",
        "use_activate_date": "UseActivateDate",
        "class_schedule_id": "ClassScheduleID",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "client_id",
        "unique_client_id",
        "client_ids",
        "unique_client_ids",
        "class_id",
        "program_ids",
        "session_type_id",
        "location_ids",
        "visit_count",
        "start_date",
        "end_date",
        "show_active_only",
        "cross_regional_lookup",
        "ignore_cross_regional_site_limit",
        "client_associated_sites_offset",
        "exclude_inactive_sites",
        "use_activate_date",
        "class_schedule_id",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        client_id=APIHelper.SKIP,
        unique_client_id=APIHelper.SKIP,
        client_ids=APIHelper.SKIP,
        unique_client_ids=APIHelper.SKIP,
        class_id=APIHelper.SKIP,
        program_ids=APIHelper.SKIP,
        session_type_id=APIHelper.SKIP,
        location_ids=APIHelper.SKIP,
        visit_count=APIHelper.SKIP,
        start_date=APIHelper.SKIP,
        end_date=APIHelper.SKIP,
        show_active_only=APIHelper.SKIP,
        cross_regional_lookup=APIHelper.SKIP,
        ignore_cross_regional_site_limit=APIHelper.SKIP,
        client_associated_sites_offset=APIHelper.SKIP,
        exclude_inactive_sites=APIHelper.SKIP,
        use_activate_date=APIHelper.SKIP,
        class_schedule_id=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetClientServicesRequest 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_ids is not APIHelper.SKIP:
            self.client_ids = client_ids
        if unique_client_ids is not APIHelper.SKIP:
            self.unique_client_ids = unique_client_ids
        if class_id is not APIHelper.SKIP:
            self.class_id = class_id
        if program_ids is not APIHelper.SKIP:
            self.program_ids = program_ids
        if session_type_id is not APIHelper.SKIP:
            self.session_type_id = session_type_id
        if location_ids is not APIHelper.SKIP:
            self.location_ids = location_ids
        if visit_count is not APIHelper.SKIP:
            self.visit_count = visit_count
        if start_date is not APIHelper.SKIP:
            self.start_date =\
                 APIHelper.apply_datetime_converter(
                start_date, APIHelper.RFC3339DateTime)\
                 if start_date else None
        if end_date is not APIHelper.SKIP:
            self.end_date =\
                 APIHelper.apply_datetime_converter(
                end_date, APIHelper.RFC3339DateTime)\
                 if end_date else None
        if show_active_only is not APIHelper.SKIP:
            self.show_active_only = show_active_only
        if cross_regional_lookup is not APIHelper.SKIP:
            self.cross_regional_lookup = cross_regional_lookup
        if ignore_cross_regional_site_limit is not APIHelper.SKIP:
            self.ignore_cross_regional_site_limit = ignore_cross_regional_site_limit
        if client_associated_sites_offset is not APIHelper.SKIP:
            self.client_associated_sites_offset = client_associated_sites_offset
        if exclude_inactive_sites is not APIHelper.SKIP:
            self.exclude_inactive_sites = exclude_inactive_sites
        if use_activate_date is not APIHelper.SKIP:
            self.use_activate_date = use_activate_date
        if class_schedule_id is not APIHelper.SKIP:
            self.class_schedule_id = class_schedule_id
        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_ids =\
            dictionary.get("ClientIds")\
            if dictionary.get("ClientIds")\
                else APIHelper.SKIP
        unique_client_ids =\
            dictionary.get("UniqueClientIds")\
            if dictionary.get("UniqueClientIds")\
                else APIHelper.SKIP
        class_id =\
            dictionary.get("ClassId")\
            if dictionary.get("ClassId")\
                else APIHelper.SKIP
        program_ids =\
            dictionary.get("ProgramIds")\
            if dictionary.get("ProgramIds")\
                else APIHelper.SKIP
        session_type_id =\
            dictionary.get("SessionTypeId")\
            if dictionary.get("SessionTypeId")\
                else APIHelper.SKIP
        location_ids =\
            dictionary.get("LocationIds")\
            if dictionary.get("LocationIds")\
                else APIHelper.SKIP
        visit_count =\
            dictionary.get("VisitCount")\
            if dictionary.get("VisitCount")\
                else APIHelper.SKIP
        start_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("StartDate")).datetime\
            if dictionary.get("StartDate") else APIHelper.SKIP
        end_date = APIHelper.RFC3339DateTime.from_value(
            dictionary.get("EndDate")).datetime\
            if dictionary.get("EndDate") else APIHelper.SKIP
        show_active_only =\
            dictionary.get("ShowActiveOnly")\
            if "ShowActiveOnly" in dictionary.keys()\
                else APIHelper.SKIP
        cross_regional_lookup =\
            dictionary.get("CrossRegionalLookup")\
            if "CrossRegionalLookup" in dictionary.keys()\
                else APIHelper.SKIP
        ignore_cross_regional_site_limit =\
            dictionary.get("IgnoreCrossRegionalSiteLimit")\
            if "IgnoreCrossRegionalSiteLimit" in dictionary.keys()\
                else APIHelper.SKIP
        client_associated_sites_offset =\
            dictionary.get("ClientAssociatedSitesOffset")\
            if dictionary.get("ClientAssociatedSitesOffset")\
                else APIHelper.SKIP
        exclude_inactive_sites =\
            dictionary.get("ExcludeInactiveSites")\
            if "ExcludeInactiveSites" in dictionary.keys()\
                else APIHelper.SKIP
        use_activate_date =\
            dictionary.get("UseActivateDate")\
            if "UseActivateDate" in dictionary.keys()\
                else APIHelper.SKIP
        class_schedule_id =\
            dictionary.get("ClassScheduleID")\
            if dictionary.get("ClassScheduleID")\
                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_ids,
                   unique_client_ids,
                   class_id,
                   program_ids,
                   session_type_id,
                   location_ids,
                   visit_count,
                   start_date,
                   end_date,
                   show_active_only,
                   cross_regional_lookup,
                   ignore_cross_regional_site_limit,
                   client_associated_sites_offset,
                   exclude_inactive_sites,
                   use_activate_date,
                   class_schedule_id,
                   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_ids=(
            self.client_ids
            if hasattr(self, "client_ids")
            else None
        )
        _unique_client_ids=(
            self.unique_client_ids
            if hasattr(self, "unique_client_ids")
            else None
        )
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _session_type_id=(
            self.session_type_id
            if hasattr(self, "session_type_id")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            else None
        )
        _visit_count=(
            self.visit_count
            if hasattr(self, "visit_count")
            else None
        )
        _start_date=(
            self.start_date
            if hasattr(self, "start_date")
            else None
        )
        _end_date=(
            self.end_date
            if hasattr(self, "end_date")
            else None
        )
        _show_active_only=(
            self.show_active_only
            if hasattr(self, "show_active_only")
            else None
        )
        _cross_regional_lookup=(
            self.cross_regional_lookup
            if hasattr(self, "cross_regional_lookup")
            else None
        )
        _ignore_cross_regional_site_limit=(
            self.ignore_cross_regional_site_limit
            if hasattr(self, "ignore_cross_regional_site_limit")
            else None
        )
        _client_associated_sites_offset=(
            self.client_associated_sites_offset
            if hasattr(self, "client_associated_sites_offset")
            else None
        )
        _exclude_inactive_sites=(
            self.exclude_inactive_sites
            if hasattr(self, "exclude_inactive_sites")
            else None
        )
        _use_activate_date=(
            self.use_activate_date
            if hasattr(self, "use_activate_date")
            else None
        )
        _class_schedule_id=(
            self.class_schedule_id
            if hasattr(self, "class_schedule_id")
            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_ids={_client_ids!r}, "
            f"unique_client_ids={_unique_client_ids!r}, "
            f"class_id={_class_id!r}, "
            f"program_ids={_program_ids!r}, "
            f"session_type_id={_session_type_id!r}, "
            f"location_ids={_location_ids!r}, "
            f"visit_count={_visit_count!r}, "
            f"start_date={_start_date!r}, "
            f"end_date={_end_date!r}, "
            f"show_active_only={_show_active_only!r}, "
            f"cross_regional_lookup={_cross_regional_lookup!r}, "
            f"ignore_cross_regional_site_limit={_ignore_cross_regional_site_limit!r}, "
            f"client_associated_sites_offset={_client_associated_sites_offset!r}, "
            f"exclude_inactive_sites={_exclude_inactive_sites!r}, "
            f"use_activate_date={_use_activate_date!r}, "
            f"class_schedule_id={_class_schedule_id!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_ids=(
            self.client_ids
            if hasattr(self, "client_ids")
            else None
        )
        _unique_client_ids=(
            self.unique_client_ids
            if hasattr(self, "unique_client_ids")
            else None
        )
        _class_id=(
            self.class_id
            if hasattr(self, "class_id")
            else None
        )
        _program_ids=(
            self.program_ids
            if hasattr(self, "program_ids")
            else None
        )
        _session_type_id=(
            self.session_type_id
            if hasattr(self, "session_type_id")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            else None
        )
        _visit_count=(
            self.visit_count
            if hasattr(self, "visit_count")
            else None
        )
        _start_date=(
            self.start_date
            if hasattr(self, "start_date")
            else None
        )
        _end_date=(
            self.end_date
            if hasattr(self, "end_date")
            else None
        )
        _show_active_only=(
            self.show_active_only
            if hasattr(self, "show_active_only")
            else None
        )
        _cross_regional_lookup=(
            self.cross_regional_lookup
            if hasattr(self, "cross_regional_lookup")
            else None
        )
        _ignore_cross_regional_site_limit=(
            self.ignore_cross_regional_site_limit
            if hasattr(self, "ignore_cross_regional_site_limit")
            else None
        )
        _client_associated_sites_offset=(
            self.client_associated_sites_offset
            if hasattr(self, "client_associated_sites_offset")
            else None
        )
        _exclude_inactive_sites=(
            self.exclude_inactive_sites
            if hasattr(self, "exclude_inactive_sites")
            else None
        )
        _use_activate_date=(
            self.use_activate_date
            if hasattr(self, "use_activate_date")
            else None
        )
        _class_schedule_id=(
            self.class_schedule_id
            if hasattr(self, "class_schedule_id")
            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_ids={_client_ids!s}, "
            f"unique_client_ids={_unique_client_ids!s}, "
            f"class_id={_class_id!s}, "
            f"program_ids={_program_ids!s}, "
            f"session_type_id={_session_type_id!s}, "
            f"location_ids={_location_ids!s}, "
            f"visit_count={_visit_count!s}, "
            f"start_date={_start_date!s}, "
            f"end_date={_end_date!s}, "
            f"show_active_only={_show_active_only!s}, "
            f"cross_regional_lookup={_cross_regional_lookup!s}, "
            f"ignore_cross_regional_site_limit={_ignore_cross_regional_site_limit!s}, "
            f"client_associated_sites_offset={_client_associated_sites_offset!s}, "
            f"exclude_inactive_sites={_exclude_inactive_sites!s}, "
            f"use_activate_date={_use_activate_date!s}, "
            f"class_schedule_id={_class_schedule_id!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
