"""mindbodypublicapi.

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

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


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

    crosssite/copycreditcard

    Attributes:
        source_site_id (int): The siteId of the source clientId.
        source_client_id (str): The clientId at the source siteId.
        source_unique_client_id (int): The unique clidnetId at the source siteId.
        target_site_id (int): The siteId of the target clientId.
        target_client_id (str): The clientId at the target siteId.
        target_unique_client_id (int): The unique clidnetId at the target siteId.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "source_site_id": "SourceSiteId",
        "source_client_id": "SourceClientId",
        "source_unique_client_id": "SourceUniqueClientId",
        "target_site_id": "TargetSiteId",
        "target_client_id": "TargetClientId",
        "target_unique_client_id": "TargetUniqueClientId",
    }

    _optionals = [
        "source_site_id",
        "source_client_id",
        "source_unique_client_id",
        "target_site_id",
        "target_client_id",
        "target_unique_client_id",
    ]

    def __init__(
        self,
        source_site_id=APIHelper.SKIP,
        source_client_id=APIHelper.SKIP,
        source_unique_client_id=APIHelper.SKIP,
        target_site_id=APIHelper.SKIP,
        target_client_id=APIHelper.SKIP,
        target_unique_client_id=APIHelper.SKIP):
        """Initialize a CopyCreditCardRequest instance."""
        # Initialize members of the class
        if source_site_id is not APIHelper.SKIP:
            self.source_site_id = source_site_id
        if source_client_id is not APIHelper.SKIP:
            self.source_client_id = source_client_id
        if source_unique_client_id is not APIHelper.SKIP:
            self.source_unique_client_id = source_unique_client_id
        if target_site_id is not APIHelper.SKIP:
            self.target_site_id = target_site_id
        if target_client_id is not APIHelper.SKIP:
            self.target_client_id = target_client_id
        if target_unique_client_id is not APIHelper.SKIP:
            self.target_unique_client_id = target_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
        source_site_id =\
            dictionary.get("SourceSiteId")\
            if dictionary.get("SourceSiteId")\
                else APIHelper.SKIP
        source_client_id =\
            dictionary.get("SourceClientId")\
            if dictionary.get("SourceClientId")\
                else APIHelper.SKIP
        source_unique_client_id =\
            dictionary.get("SourceUniqueClientId")\
            if dictionary.get("SourceUniqueClientId")\
                else APIHelper.SKIP
        target_site_id =\
            dictionary.get("TargetSiteId")\
            if dictionary.get("TargetSiteId")\
                else APIHelper.SKIP
        target_client_id =\
            dictionary.get("TargetClientId")\
            if dictionary.get("TargetClientId")\
                else APIHelper.SKIP
        target_unique_client_id =\
            dictionary.get("TargetUniqueClientId")\
            if dictionary.get("TargetUniqueClientId")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(source_site_id,
                   source_client_id,
                   source_unique_client_id,
                   target_site_id,
                   target_client_id,
                   target_unique_client_id)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _source_site_id=(
            self.source_site_id
            if hasattr(self, "source_site_id")
            else None
        )
        _source_client_id=(
            self.source_client_id
            if hasattr(self, "source_client_id")
            else None
        )
        _source_unique_client_id=(
            self.source_unique_client_id
            if hasattr(self, "source_unique_client_id")
            else None
        )
        _target_site_id=(
            self.target_site_id
            if hasattr(self, "target_site_id")
            else None
        )
        _target_client_id=(
            self.target_client_id
            if hasattr(self, "target_client_id")
            else None
        )
        _target_unique_client_id=(
            self.target_unique_client_id
            if hasattr(self, "target_unique_client_id")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"source_site_id={_source_site_id!r}, "
            f"source_client_id={_source_client_id!r}, "
            f"source_unique_client_id={_source_unique_client_id!r}, "
            f"target_site_id={_target_site_id!r}, "
            f"target_client_id={_target_client_id!r}, "
            f"target_unique_client_id={_target_unique_client_id!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _source_site_id=(
            self.source_site_id
            if hasattr(self, "source_site_id")
            else None
        )
        _source_client_id=(
            self.source_client_id
            if hasattr(self, "source_client_id")
            else None
        )
        _source_unique_client_id=(
            self.source_unique_client_id
            if hasattr(self, "source_unique_client_id")
            else None
        )
        _target_site_id=(
            self.target_site_id
            if hasattr(self, "target_site_id")
            else None
        )
        _target_client_id=(
            self.target_client_id
            if hasattr(self, "target_client_id")
            else None
        )
        _target_unique_client_id=(
            self.target_unique_client_id
            if hasattr(self, "target_unique_client_id")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"source_site_id={_source_site_id!s}, "
            f"source_client_id={_source_client_id!s}, "
            f"source_unique_client_id={_source_unique_client_id!s}, "
            f"target_site_id={_target_site_id!s}, "
            f"target_client_id={_target_client_id!s}, "
            f"target_unique_client_id={_target_unique_client_id!s}, "
            f")"
        )
