"""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.mobile_provider import (
    MobileProvider,
)


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

    Get Mobile Providers Response Object

    Attributes:
        mobile_providers (List[MobileProvider]): A list of mobile providers.

    """

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

    _optionals = [
        "mobile_providers",
    ]

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

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

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

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

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