"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper
from mindbodypublicapi.models.alternative_payment_method import (
    AlternativePaymentMethod,
)


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

    Response for the GetAlternativePaymentMethods method.

    Attributes:
        payment_methods (List[AlternativePaymentMethod]): Contains information about
            the alternative payment methods.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payment_methods": "PaymentMethods",
    }

    _optionals = [
        "payment_methods",
    ]

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

    @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
        payment_methods = None
        if dictionary.get("PaymentMethods") is not None:
            payment_methods = [
                AlternativePaymentMethod.from_dictionary(x)
                    for x in dictionary.get("PaymentMethods")
            ]
        else:
            payment_methods = APIHelper.SKIP

        # Return an object of this model
        return cls(payment_methods)

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

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