"""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.client import (
    Client,
)


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

    Attributes:
        client (Client): The Client.

    """

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

    _optionals = [
        "client",
    ]

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

    @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
        client =\
            Client.from_dictionary(
                dictionary.get("Client"))\
                if "Client" in dictionary.keys()\
                else APIHelper.SKIP

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

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

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