"""mindbodypublicapi.

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

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


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

    Attributes:
        id (int): The model property of type int.
        active (bool): The model property of type bool.
        provider_name (str): The model property of type str.
        provider_address (str): The model property of type str.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": "Id",
        "active": "Active",
        "provider_name": "ProviderName",
        "provider_address": "ProviderAddress",
    }

    _optionals = [
        "id",
        "active",
        "provider_name",
        "provider_address",
    ]

    def __init__(
        self,
        id=APIHelper.SKIP,
        active=APIHelper.SKIP,
        provider_name=APIHelper.SKIP,
        provider_address=APIHelper.SKIP):
        """Initialize a MobileProvider instance."""
        # Initialize members of the class
        if id is not APIHelper.SKIP:
            self.id = id
        if active is not APIHelper.SKIP:
            self.active = active
        if provider_name is not APIHelper.SKIP:
            self.provider_name = provider_name
        if provider_address is not APIHelper.SKIP:
            self.provider_address = provider_address

    @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
        id =\
            dictionary.get("Id")\
            if dictionary.get("Id")\
                else APIHelper.SKIP
        active =\
            dictionary.get("Active")\
            if "Active" in dictionary.keys()\
                else APIHelper.SKIP
        provider_name =\
            dictionary.get("ProviderName")\
            if dictionary.get("ProviderName")\
                else APIHelper.SKIP
        provider_address =\
            dictionary.get("ProviderAddress")\
            if dictionary.get("ProviderAddress")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(id,
                   active,
                   provider_name,
                   provider_address)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _active=(
            self.active
            if hasattr(self, "active")
            else None
        )
        _provider_name=(
            self.provider_name
            if hasattr(self, "provider_name")
            else None
        )
        _provider_address=(
            self.provider_address
            if hasattr(self, "provider_address")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!r}, "
            f"active={_active!r}, "
            f"provider_name={_provider_name!r}, "
            f"provider_address={_provider_address!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _active=(
            self.active
            if hasattr(self, "active")
            else None
        )
        _provider_name=(
            self.provider_name
            if hasattr(self, "provider_name")
            else None
        )
        _provider_address=(
            self.provider_address
            if hasattr(self, "provider_address")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"id={_id!s}, "
            f"active={_active!s}, "
            f"provider_name={_provider_name!s}, "
            f"provider_address={_provider_address!s}, "
            f")"
        )
