"""visaacceptancemergedspec.

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

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


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

    Attributes:
        agreement_id (str): Identifier for the mandate being signed for. This mandate
            id is required for all the subsequent transactions.
        id (str): The processor specific billing agreement ID. References an approved
            recurring payment for goods or services. This value is sent by merchant
            via Visa Acceptance to processor. The value sent in this field is
            procured by the merchant from the processor.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "agreement_id": "agreementId",
        "id": "id",
    }

    _optionals = [
        "agreement_id",
        "id",
    ]

    def __init__(
        self,
        agreement_id=APIHelper.SKIP,
        id=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a AgreementInformation instance."""
        # Initialize members of the class
        if agreement_id is not APIHelper.SKIP:
            self.agreement_id = agreement_id
        if id is not APIHelper.SKIP:
            self.id = id

        # 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
        agreement_id =\
            dictionary.get("agreementId")\
            if dictionary.get("agreementId")\
                else APIHelper.SKIP
        id =\
            dictionary.get("id")\
            if dictionary.get("id")\
                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(agreement_id,
                   id,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _agreement_id=(
            self.agreement_id
            if hasattr(self, "agreement_id")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"agreement_id={_agreement_id!r}, "
            f"id={_id!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _agreement_id=(
            self.agreement_id
            if hasattr(self, "agreement_id")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"agreement_id={_agreement_id!s}, "
            f"id={_id!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
