"""mindbodypublicapi.

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

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


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

    request for GetClientCompleteInfoRequest

    Attributes:
        client_id (str): Filters results to client with these ID.
        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**.
        cross_regional_lookup (bool): Used to retrieve a clients 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**
        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
        required_client_data (List[str]): Used to retrieve list of purchased
            services, contract details, membership details and arrival programs for a
            specific client.   Default `ClientServices`, `ClientContracts`,
            `ClientMemberships` and `ClientArrivals` will be returned when
            `RequiredClientDatais` not set.   When `RequiredClientData` is set to
            `Contracts` then only `ClientContracts` will be returned in the response.
            When `RequiredClientData` is set to Services then only `ClientServices`
            will be returned in the response.  When `RequiredClientData` is set to
            `Memberships` then only `ClientMemberships` will be returned in the
            response.   When `RequiredClientData` is set to `ArrivalPrograms` then
            only `ClientArrivals` will be returned in the response.
        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**
        show_active_only (bool): When `true`, includes active services only. Set this
            field to `true` when trying to determine if a client has a   service that
            can pay for a class or appointment.  Default: **false**
        unique_client_id (int): The unique ID of the client who is viewing this class
            list.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "client_id": "ClientId",
        "start_date": "StartDate",
        "end_date": "EndDate",
        "cross_regional_lookup": "CrossRegionalLookup",
        "client_associated_sites_offset": "ClientAssociatedSitesOffset",
        "required_client_data": "RequiredClientData",
        "exclude_inactive_sites": "ExcludeInactiveSites",
        "use_activate_date": "UseActivateDate",
        "show_active_only": "ShowActiveOnly",
        "unique_client_id": "UniqueClientId",
    }

    _optionals = [
        "start_date",
        "end_date",
        "cross_regional_lookup",
        "client_associated_sites_offset",
        "required_client_data",
        "exclude_inactive_sites",
        "use_activate_date",
        "show_active_only",
        "unique_client_id",
    ]

    def __init__(
        self,
        client_id=None,
        start_date=APIHelper.SKIP,
        end_date=APIHelper.SKIP,
        cross_regional_lookup=APIHelper.SKIP,
        client_associated_sites_offset=APIHelper.SKIP,
        required_client_data=APIHelper.SKIP,
        exclude_inactive_sites=APIHelper.SKIP,
        use_activate_date=APIHelper.SKIP,
        show_active_only=APIHelper.SKIP,
        unique_client_id=APIHelper.SKIP):
        """Initialize a GetClientCompleteInfoRequest instance."""
        # Initialize members of the class
        self.client_id = client_id
        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 cross_regional_lookup is not APIHelper.SKIP:
            self.cross_regional_lookup = cross_regional_lookup
        if client_associated_sites_offset is not APIHelper.SKIP:
            self.client_associated_sites_offset = client_associated_sites_offset
        if required_client_data is not APIHelper.SKIP:
            self.required_client_data = required_client_data
        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 show_active_only is not APIHelper.SKIP:
            self.show_active_only = show_active_only
        if unique_client_id is not APIHelper.SKIP:
            self.unique_client_id = unique_client_id

    @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 None
        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
        cross_regional_lookup =\
            dictionary.get("CrossRegionalLookup")\
            if "CrossRegionalLookup" in dictionary.keys()\
                else APIHelper.SKIP
        client_associated_sites_offset =\
            dictionary.get("ClientAssociatedSitesOffset")\
            if dictionary.get("ClientAssociatedSitesOffset")\
                else APIHelper.SKIP
        required_client_data =\
            dictionary.get("RequiredClientData")\
            if dictionary.get("RequiredClientData")\
                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
        show_active_only =\
            dictionary.get("ShowActiveOnly")\
            if "ShowActiveOnly" in dictionary.keys()\
                else APIHelper.SKIP
        unique_client_id =\
            dictionary.get("UniqueClientId")\
            if dictionary.get("UniqueClientId")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(client_id,
                   start_date,
                   end_date,
                   cross_regional_lookup,
                   client_associated_sites_offset,
                   required_client_data,
                   exclude_inactive_sites,
                   use_activate_date,
                   show_active_only,
                   unique_client_id)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _client_id=self.client_id
        _start_date=(
            self.start_date
            if hasattr(self, "start_date")
            else None
        )
        _end_date=(
            self.end_date
            if hasattr(self, "end_date")
            else None
        )
        _cross_regional_lookup=(
            self.cross_regional_lookup
            if hasattr(self, "cross_regional_lookup")
            else None
        )
        _client_associated_sites_offset=(
            self.client_associated_sites_offset
            if hasattr(self, "client_associated_sites_offset")
            else None
        )
        _required_client_data=(
            self.required_client_data
            if hasattr(self, "required_client_data")
            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
        )
        _show_active_only=(
            self.show_active_only
            if hasattr(self, "show_active_only")
            else None
        )
        _unique_client_id=(
            self.unique_client_id
            if hasattr(self, "unique_client_id")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!r}, "
            f"start_date={_start_date!r}, "
            f"end_date={_end_date!r}, "
            f"cross_regional_lookup={_cross_regional_lookup!r}, "
            f"client_associated_sites_offset={_client_associated_sites_offset!r}, "
            f"required_client_data={_required_client_data!r}, "
            f"exclude_inactive_sites={_exclude_inactive_sites!r}, "
            f"use_activate_date={_use_activate_date!r}, "
            f"show_active_only={_show_active_only!r}, "
            f"unique_client_id={_unique_client_id!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _client_id=self.client_id
        _start_date=(
            self.start_date
            if hasattr(self, "start_date")
            else None
        )
        _end_date=(
            self.end_date
            if hasattr(self, "end_date")
            else None
        )
        _cross_regional_lookup=(
            self.cross_regional_lookup
            if hasattr(self, "cross_regional_lookup")
            else None
        )
        _client_associated_sites_offset=(
            self.client_associated_sites_offset
            if hasattr(self, "client_associated_sites_offset")
            else None
        )
        _required_client_data=(
            self.required_client_data
            if hasattr(self, "required_client_data")
            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
        )
        _show_active_only=(
            self.show_active_only
            if hasattr(self, "show_active_only")
            else None
        )
        _unique_client_id=(
            self.unique_client_id
            if hasattr(self, "unique_client_id")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!s}, "
            f"start_date={_start_date!s}, "
            f"end_date={_end_date!s}, "
            f"cross_regional_lookup={_cross_regional_lookup!s}, "
            f"client_associated_sites_offset={_client_associated_sites_offset!s}, "
            f"required_client_data={_required_client_data!s}, "
            f"exclude_inactive_sites={_exclude_inactive_sites!s}, "
            f"use_activate_date={_use_activate_date!s}, "
            f"show_active_only={_show_active_only!s}, "
            f"unique_client_id={_unique_client_id!s}, "
            f")"
        )
