"""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.agreement_information_9 import (
    AgreementInformation9,
)
from visaacceptancemergedspec.models.client_reference_information_29 import (
    ClientReferenceInformation29,
)
from visaacceptancemergedspec.models.installment_information_5 import (
    InstallmentInformation5,
)
from visaacceptancemergedspec.models.links_16 import (
    Links16,
)
from visaacceptancemergedspec.models.order_information_22 import (
    OrderInformation22,
)
from visaacceptancemergedspec.models.payment_information_18 import (
    PaymentInformation18,
)
from visaacceptancemergedspec.models.processor_information_16 import (
    ProcessorInformation16,
)
from visaacceptancemergedspec.models.risk_information_2 import (
    RiskInformation2,
)


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

    Attributes:
        links (Links16): The model property of type Links16.
        id (str): An unique identification number generated by Visa Acceptance to
            identify the submitted request. Returned by all services. It is also
            appended to the endpoint of the resource. On incremental authorizations,
            this value with be the same as the identification number returned in the
            original authorization response.
        submit_time_utc (str): Time of request in UTC. Format: `YYYY-MM-DDThh:mm:ssZ`
            **Example** `2016-08-11T22:47:57Z` equals August 11, 2016, at 22:47:57
            (10:47:57 p.m.). The `T` separates the date and the time. The `Z`
            indicates UTC.  Returned by Visa Acceptance for all services.
        status (str): The status of the billing agreement. Possible value is:   -
            PENDING   - REVOKED   - ACTIVE   - FAILED   - EXPIRED   - INACTIVE
        processor_information (ProcessorInformation16): The model property of type
            ProcessorInformation16.
        installment_information (InstallmentInformation5): The model property of type
            InstallmentInformation5.
        client_reference_information (ClientReferenceInformation29): The model
            property of type ClientReferenceInformation29.
        risk_information (RiskInformation2): The model property of type
            RiskInformation2.
        agreement_information (AgreementInformation9): The model property of type
            AgreementInformation9.
        order_information (OrderInformation22): The model property of type
            OrderInformation22.
        payment_information (PaymentInformation18): The model property of type
            PaymentInformation18.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "links": "_links",
        "id": "id",
        "submit_time_utc": "submitTimeUtc",
        "status": "status",
        "processor_information": "processorInformation",
        "installment_information": "installmentInformation",
        "client_reference_information": "clientReferenceInformation",
        "risk_information": "riskInformation",
        "agreement_information": "agreementInformation",
        "order_information": "orderInformation",
        "payment_information": "paymentInformation",
    }

    _optionals = [
        "links",
        "id",
        "submit_time_utc",
        "status",
        "processor_information",
        "installment_information",
        "client_reference_information",
        "risk_information",
        "agreement_information",
        "order_information",
        "payment_information",
    ]

    def __init__(
        self,
        links=APIHelper.SKIP,
        id=APIHelper.SKIP,
        submit_time_utc=APIHelper.SKIP,
        status=APIHelper.SKIP,
        processor_information=APIHelper.SKIP,
        installment_information=APIHelper.SKIP,
        client_reference_information=APIHelper.SKIP,
        risk_information=APIHelper.SKIP,
        agreement_information=APIHelper.SKIP,
        order_information=APIHelper.SKIP,
        payment_information=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a PtsV2ModifyBillingAgreementPost201Response instance."""
        # Initialize members of the class
        if links is not APIHelper.SKIP:
            self.links = links
        if id is not APIHelper.SKIP:
            self.id = id
        if submit_time_utc is not APIHelper.SKIP:
            self.submit_time_utc = submit_time_utc
        if status is not APIHelper.SKIP:
            self.status = status
        if processor_information is not APIHelper.SKIP:
            self.processor_information = processor_information
        if installment_information is not APIHelper.SKIP:
            self.installment_information = installment_information
        if client_reference_information is not APIHelper.SKIP:
            self.client_reference_information = client_reference_information
        if risk_information is not APIHelper.SKIP:
            self.risk_information = risk_information
        if agreement_information is not APIHelper.SKIP:
            self.agreement_information = agreement_information
        if order_information is not APIHelper.SKIP:
            self.order_information = order_information
        if payment_information is not APIHelper.SKIP:
            self.payment_information = payment_information

        # 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
        links =\
            Links16.from_dictionary(
                dictionary.get("_links"))\
                if "_links" in dictionary.keys()\
                else APIHelper.SKIP
        id =\
            dictionary.get("id")\
            if dictionary.get("id")\
                else APIHelper.SKIP
        submit_time_utc =\
            dictionary.get("submitTimeUtc")\
            if dictionary.get("submitTimeUtc")\
                else APIHelper.SKIP
        status =\
            dictionary.get("status")\
            if dictionary.get("status")\
                else APIHelper.SKIP
        processor_information =\
            ProcessorInformation16.from_dictionary(
                dictionary.get("processorInformation"))\
                if "processorInformation" in dictionary.keys()\
                else APIHelper.SKIP
        installment_information =\
            InstallmentInformation5.from_dictionary(
                dictionary.get("installmentInformation"))\
                if "installmentInformation" in dictionary.keys()\
                else APIHelper.SKIP
        client_reference_information =\
            ClientReferenceInformation29.from_dictionary(
                dictionary.get("clientReferenceInformation"))\
                if "clientReferenceInformation" in dictionary.keys()\
                else APIHelper.SKIP
        risk_information =\
            RiskInformation2.from_dictionary(
                dictionary.get("riskInformation"))\
                if "riskInformation" in dictionary.keys()\
                else APIHelper.SKIP
        agreement_information =\
            AgreementInformation9.from_dictionary(
                dictionary.get("agreementInformation"))\
                if "agreementInformation" in dictionary.keys()\
                else APIHelper.SKIP
        order_information =\
            OrderInformation22.from_dictionary(
                dictionary.get("orderInformation"))\
                if "orderInformation" in dictionary.keys()\
                else APIHelper.SKIP
        payment_information =\
            PaymentInformation18.from_dictionary(
                dictionary.get("paymentInformation"))\
                if "paymentInformation" 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(links,
                   id,
                   submit_time_utc,
                   status,
                   processor_information,
                   installment_information,
                   client_reference_information,
                   risk_information,
                   agreement_information,
                   order_information,
                   payment_information,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _links=(
            self.links
            if hasattr(self, "links")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _submit_time_utc=(
            self.submit_time_utc
            if hasattr(self, "submit_time_utc")
            else None
        )
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        _processor_information=(
            self.processor_information
            if hasattr(self, "processor_information")
            else None
        )
        _installment_information=(
            self.installment_information
            if hasattr(self, "installment_information")
            else None
        )
        _client_reference_information=(
            self.client_reference_information
            if hasattr(self, "client_reference_information")
            else None
        )
        _risk_information=(
            self.risk_information
            if hasattr(self, "risk_information")
            else None
        )
        _agreement_information=(
            self.agreement_information
            if hasattr(self, "agreement_information")
            else None
        )
        _order_information=(
            self.order_information
            if hasattr(self, "order_information")
            else None
        )
        _payment_information=(
            self.payment_information
            if hasattr(self, "payment_information")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"links={_links!r}, "
            f"id={_id!r}, "
            f"submit_time_utc={_submit_time_utc!r}, "
            f"status={_status!r}, "
            f"processor_information={_processor_information!r}, "
            f"installment_information={_installment_information!r}, "
            f"client_reference_information={_client_reference_information!r}, "
            f"risk_information={_risk_information!r}, "
            f"agreement_information={_agreement_information!r}, "
            f"order_information={_order_information!r}, "
            f"payment_information={_payment_information!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _links=(
            self.links
            if hasattr(self, "links")
            else None
        )
        _id=(
            self.id
            if hasattr(self, "id")
            else None
        )
        _submit_time_utc=(
            self.submit_time_utc
            if hasattr(self, "submit_time_utc")
            else None
        )
        _status=(
            self.status
            if hasattr(self, "status")
            else None
        )
        _processor_information=(
            self.processor_information
            if hasattr(self, "processor_information")
            else None
        )
        _installment_information=(
            self.installment_information
            if hasattr(self, "installment_information")
            else None
        )
        _client_reference_information=(
            self.client_reference_information
            if hasattr(self, "client_reference_information")
            else None
        )
        _risk_information=(
            self.risk_information
            if hasattr(self, "risk_information")
            else None
        )
        _agreement_information=(
            self.agreement_information
            if hasattr(self, "agreement_information")
            else None
        )
        _order_information=(
            self.order_information
            if hasattr(self, "order_information")
            else None
        )
        _payment_information=(
            self.payment_information
            if hasattr(self, "payment_information")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"links={_links!s}, "
            f"id={_id!s}, "
            f"submit_time_utc={_submit_time_utc!s}, "
            f"status={_status!s}, "
            f"processor_information={_processor_information!s}, "
            f"installment_information={_installment_information!s}, "
            f"client_reference_information={_client_reference_information!s}, "
            f"risk_information={_risk_information!s}, "
            f"agreement_information={_agreement_information!s}, "
            f"order_information={_order_information!s}, "
            f"payment_information={_payment_information!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
