"""cellpointapi.

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

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


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

    Configuration for PayPal.

    Attributes:
        client_id (str): Merchant's PayPal client ID
        merchant_id (str): Merchant's PayPal merchant ID
        bn_code (str): Merchant's PayPal business number code, used for tracking and
            reporting.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "client_id": "clientId",
        "merchant_id": "merchantId",
        "bn_code": "bnCode",
    }

    _optionals = [
        "merchant_id",
        "bn_code",
    ]

    def __init__(
        self,
        client_id=None,
        merchant_id=APIHelper.SKIP,
        bn_code=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PaypalConfig instance."""
        # Initialize members of the class
        self.client_id = client_id
        if merchant_id is not APIHelper.SKIP:
            self.merchant_id = merchant_id
        if bn_code is not APIHelper.SKIP:
            self.bn_code = bn_code

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @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_id =\
            dictionary.get("clientId")\
            if dictionary.get("clientId")\
                else None
        merchant_id =\
            dictionary.get("merchantId")\
            if dictionary.get("merchantId")\
                else APIHelper.SKIP
        bn_code =\
            dictionary.get("bnCode")\
            if dictionary.get("bnCode")\
                else APIHelper.SKIP

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(client_id,
                   merchant_id,
                   bn_code,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _client_id=self.client_id
        _merchant_id=(
            self.merchant_id
            if hasattr(self, "merchant_id")
            else None
        )
        _bn_code=(
            self.bn_code
            if hasattr(self, "bn_code")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!r}, "
            f"merchant_id={_merchant_id!r}, "
            f"bn_code={_bn_code!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _client_id=self.client_id
        _merchant_id=(
            self.merchant_id
            if hasattr(self, "merchant_id")
            else None
        )
        _bn_code=(
            self.bn_code
            if hasattr(self, "bn_code")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"client_id={_client_id!s}, "
            f"merchant_id={_merchant_id!s}, "
            f"bn_code={_bn_code!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
