"""mindbodypublicapi.

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

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


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

    Attributes:
        pays_for (List[int]): The model property of type List[int].
        paid_by (List[int]): The model property of type List[int].

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "pays_for": "PaysFor",
        "paid_by": "PaidBy",
    }

    _optionals = [
        "pays_for",
        "paid_by",
    ]

    def __init__(
        self,
        pays_for=APIHelper.SKIP,
        paid_by=APIHelper.SKIP):
        """Initialize a PricingRelationships instance."""
        # Initialize members of the class
        if pays_for is not APIHelper.SKIP:
            self.pays_for = pays_for
        if paid_by is not APIHelper.SKIP:
            self.paid_by = paid_by

    @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
        pays_for =\
            dictionary.get("PaysFor")\
            if dictionary.get("PaysFor")\
                else APIHelper.SKIP
        paid_by =\
            dictionary.get("PaidBy")\
            if dictionary.get("PaidBy")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(pays_for,
                   paid_by)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _pays_for=(
            self.pays_for
            if hasattr(self, "pays_for")
            else None
        )
        _paid_by=(
            self.paid_by
            if hasattr(self, "paid_by")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"pays_for={_pays_for!r}, "
            f"paid_by={_paid_by!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _pays_for=(
            self.pays_for
            if hasattr(self, "pays_for")
            else None
        )
        _paid_by=(
            self.paid_by
            if hasattr(self, "paid_by")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"pays_for={_pays_for!s}, "
            f"paid_by={_paid_by!s}, "
            f")"
        )
