"""visaacceptancemergedspec.

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

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)
from visaacceptancemergedspec.models.sub_merchant_1 import (
    SubMerchant1,
)


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

    Attributes:
        aggregator_id (str): Value that identifies you as a payment aggregator. Get
            this value from the processor.  #### Visa Acceptance through VisaNet The
            value for this field corresponds to the following data in the TC 33
            capture file5: - Record: CP01 TCR6 - Position: 95-105 - Field: Payment
            Facilitator ID  This field is supported for Visa, Mastercard and Discover
            Transactions.  **FDC Compass**\ This value must consist of uppercase
            characters.
        name (str): Your payment aggregator business name.  **American Express
            Direct**\ The maximum length of the aggregator name depends on the length
            of the sub-merchant name. The combined length for both values must not
            exceed 36 characters.\  #### Visa Acceptance through VisaNet With
            American Express, the maximum length of the aggregator name depends on
            the length of the sub-merchant name. The combined length for both values
            must not exceed 36 characters. The value for this field does not map to
            the TC 33 capture file5.  **FDC Compass**\ This value must consist of
            uppercase characters.
        sub_merchant (SubMerchant1): The model property of type SubMerchant1.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "aggregator_id": "aggregatorId",
        "name": "name",
        "sub_merchant": "subMerchant",
    }

    _optionals = [
        "aggregator_id",
        "name",
        "sub_merchant",
    ]

    def __init__(
        self,
        aggregator_id=APIHelper.SKIP,
        name=APIHelper.SKIP,
        sub_merchant=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a AggregatorInformation1 instance."""
        # Initialize members of the class
        if aggregator_id is not APIHelper.SKIP:
            self.aggregator_id = aggregator_id
        if name is not APIHelper.SKIP:
            self.name = name
        if sub_merchant is not APIHelper.SKIP:
            self.sub_merchant = sub_merchant

        # 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
        aggregator_id =\
            dictionary.get("aggregatorId")\
            if dictionary.get("aggregatorId")\
                else APIHelper.SKIP
        name =\
            dictionary.get("name")\
            if dictionary.get("name")\
                else APIHelper.SKIP
        sub_merchant =\
            SubMerchant1.from_dictionary(
                dictionary.get("subMerchant"))\
                if "subMerchant" in dictionary.keys()\
                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(aggregator_id,
                   name,
                   sub_merchant,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _aggregator_id=(
            self.aggregator_id
            if hasattr(self, "aggregator_id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _sub_merchant=(
            self.sub_merchant
            if hasattr(self, "sub_merchant")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"aggregator_id={_aggregator_id!r}, "
            f"name={_name!r}, "
            f"sub_merchant={_sub_merchant!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _aggregator_id=(
            self.aggregator_id
            if hasattr(self, "aggregator_id")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _sub_merchant=(
            self.sub_merchant
            if hasattr(self, "sub_merchant")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"aggregator_id={_aggregator_id!s}, "
            f"name={_name!s}, "
            f"sub_merchant={_sub_merchant!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
