"""mindbodypublicapi.

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

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


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

    A client cross region association

    Attributes:
        site_id (int): The ID of the site to which the client belongs.
        client_id (str): The client’s RSSID.
        unique_id (int): The client’s unique ID.
        site_is_active (bool): Indicates if site is active

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "site_id": "SiteId",
        "client_id": "ClientId",
        "unique_id": "UniqueId",
        "site_is_active": "SiteIsActive",
    }

    _optionals = [
        "site_id",
        "client_id",
        "unique_id",
        "site_is_active",
    ]

    def __init__(
        self,
        site_id=APIHelper.SKIP,
        client_id=APIHelper.SKIP,
        unique_id=APIHelper.SKIP,
        site_is_active=APIHelper.SKIP):
        """Initialize a CrossRegionalClientAssociation instance."""
        # Initialize members of the class
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id
        if client_id is not APIHelper.SKIP:
            self.client_id = client_id
        if unique_id is not APIHelper.SKIP:
            self.unique_id = unique_id
        if site_is_active is not APIHelper.SKIP:
            self.site_is_active = site_is_active

    @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
        site_id =\
            dictionary.get("SiteId")\
            if dictionary.get("SiteId")\
                else APIHelper.SKIP
        client_id =\
            dictionary.get("ClientId")\
            if dictionary.get("ClientId")\
                else APIHelper.SKIP
        unique_id =\
            dictionary.get("UniqueId")\
            if dictionary.get("UniqueId")\
                else APIHelper.SKIP
        site_is_active =\
            dictionary.get("SiteIsActive")\
            if "SiteIsActive" in dictionary.keys()\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(site_id,
                   client_id,
                   unique_id,
                   site_is_active)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _site_id=(
            self.site_id
            if hasattr(self, "site_id")
            else None
        )
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _unique_id=(
            self.unique_id
            if hasattr(self, "unique_id")
            else None
        )
        _site_is_active=(
            self.site_is_active
            if hasattr(self, "site_is_active")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"site_id={_site_id!r}, "
            f"client_id={_client_id!r}, "
            f"unique_id={_unique_id!r}, "
            f"site_is_active={_site_is_active!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _site_id=(
            self.site_id
            if hasattr(self, "site_id")
            else None
        )
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _unique_id=(
            self.unique_id
            if hasattr(self, "unique_id")
            else None
        )
        _site_is_active=(
            self.site_is_active
            if hasattr(self, "site_is_active")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"site_id={_site_id!s}, "
            f"client_id={_client_id!s}, "
            f"unique_id={_unique_id!s}, "
            f"site_is_active={_site_is_active!s}, "
            f")"
        )
