"""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.capture_1 import (
    Capture1,
)
from visaacceptancemergedspec.models.consumerauthentication import (
    Consumerauthentication,
)
from visaacceptancemergedspec.models.decision import (
    Decision,
)
from visaacceptancemergedspec.models.tokencreate import (
    Tokencreate,
)
from visaacceptancemergedspec.models.tokenupdate import (
    Tokenupdate,
)
from visaacceptancemergedspec.models.validateconsumerauthentication import (
    Validateconsumerauthentication,
)
from visaacceptancemergedspec.models.watchlistscreening import (
    Watchlistscreening,
)


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

    Attributes:
        capture (Capture1): The model property of type Capture1.
        decision (Decision): The model property of type Decision.
        consumer_authentication (Consumerauthentication): The model property of type
            Consumerauthentication.
        validate_consumer_authentication (Validateconsumerauthentication): The model
            property of type Validateconsumerauthentication.
        watchlist_screening (Watchlistscreening): The model property of type
            Watchlistscreening.
        token_create (Tokencreate): The model property of type Tokencreate.
        token_update (Tokenupdate): The model property of type Tokenupdate.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "capture": "CAPTURE",
        "decision": "DECISION",
        "consumer_authentication": "CONSUMER_AUTHENTICATION",
        "validate_consumer_authentication": "VALIDATE_CONSUMER_AUTHENTICATION",
        "watchlist_screening": "WATCHLIST_SCREENING",
        "token_create": "TOKEN_CREATE",
        "token_update": "TOKEN_UPDATE",
    }

    _optionals = [
        "capture",
        "decision",
        "consumer_authentication",
        "validate_consumer_authentication",
        "watchlist_screening",
        "token_create",
        "token_update",
    ]

    def __init__(
        self,
        capture=APIHelper.SKIP,
        decision=APIHelper.SKIP,
        consumer_authentication=APIHelper.SKIP,
        validate_consumer_authentication=APIHelper.SKIP,
        watchlist_screening=APIHelper.SKIP,
        token_create=APIHelper.SKIP,
        token_update=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a EmbeddedActions2 instance."""
        # Initialize members of the class
        if capture is not APIHelper.SKIP:
            self.capture = capture
        if decision is not APIHelper.SKIP:
            self.decision = decision
        if consumer_authentication is not APIHelper.SKIP:
            self.consumer_authentication = consumer_authentication
        if validate_consumer_authentication is not APIHelper.SKIP:
            self.validate_consumer_authentication = validate_consumer_authentication
        if watchlist_screening is not APIHelper.SKIP:
            self.watchlist_screening = watchlist_screening
        if token_create is not APIHelper.SKIP:
            self.token_create = token_create
        if token_update is not APIHelper.SKIP:
            self.token_update = token_update

        # 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
        capture =\
            Capture1.from_dictionary(
                dictionary.get("CAPTURE"))\
                if "CAPTURE" in dictionary.keys()\
                else APIHelper.SKIP
        decision =\
            Decision.from_dictionary(
                dictionary.get("DECISION"))\
                if "DECISION" in dictionary.keys()\
                else APIHelper.SKIP
        consumer_authentication =\
            Consumerauthentication.from_dictionary(
                dictionary.get("CONSUMER_AUTHENTICATION"))\
                if "CONSUMER_AUTHENTICATION" in dictionary.keys()\
                else APIHelper.SKIP
        validate_consumer_authentication =\
            Validateconsumerauthentication.from_dictionary(
                dictionary.get("VALIDATE_CONSUMER_AUTHENTICATION"))\
                if "VALIDATE_CONSUMER_AUTHENTICATION" in dictionary.keys()\
                else APIHelper.SKIP
        watchlist_screening =\
            Watchlistscreening.from_dictionary(
                dictionary.get("WATCHLIST_SCREENING"))\
                if "WATCHLIST_SCREENING" in dictionary.keys()\
                else APIHelper.SKIP
        token_create =\
            Tokencreate.from_dictionary(
                dictionary.get("TOKEN_CREATE"))\
                if "TOKEN_CREATE" in dictionary.keys()\
                else APIHelper.SKIP
        token_update =\
            Tokenupdate.from_dictionary(
                dictionary.get("TOKEN_UPDATE"))\
                if "TOKEN_UPDATE" 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(capture,
                   decision,
                   consumer_authentication,
                   validate_consumer_authentication,
                   watchlist_screening,
                   token_create,
                   token_update,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _capture=(
            self.capture
            if hasattr(self, "capture")
            else None
        )
        _decision=(
            self.decision
            if hasattr(self, "decision")
            else None
        )
        _consumer_authentication=(
            self.consumer_authentication
            if hasattr(self, "consumer_authentication")
            else None
        )
        _validate_consumer_authentication=(
            self.validate_consumer_authentication
            if hasattr(self, "validate_consumer_authentication")
            else None
        )
        _watchlist_screening=(
            self.watchlist_screening
            if hasattr(self, "watchlist_screening")
            else None
        )
        _token_create=(
            self.token_create
            if hasattr(self, "token_create")
            else None
        )
        _token_update=(
            self.token_update
            if hasattr(self, "token_update")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"capture={_capture!r}, "
            f"decision={_decision!r}, "
            f"consumer_authentication={_consumer_authentication!r}, "
            f"validate_consumer_authentication={_validate_consumer_authentication!r}, "
            f"watchlist_screening={_watchlist_screening!r}, "
            f"token_create={_token_create!r}, "
            f"token_update={_token_update!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _capture=(
            self.capture
            if hasattr(self, "capture")
            else None
        )
        _decision=(
            self.decision
            if hasattr(self, "decision")
            else None
        )
        _consumer_authentication=(
            self.consumer_authentication
            if hasattr(self, "consumer_authentication")
            else None
        )
        _validate_consumer_authentication=(
            self.validate_consumer_authentication
            if hasattr(self, "validate_consumer_authentication")
            else None
        )
        _watchlist_screening=(
            self.watchlist_screening
            if hasattr(self, "watchlist_screening")
            else None
        )
        _token_create=(
            self.token_create
            if hasattr(self, "token_create")
            else None
        )
        _token_update=(
            self.token_update
            if hasattr(self, "token_update")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"capture={_capture!s}, "
            f"decision={_decision!s}, "
            f"consumer_authentication={_consumer_authentication!s}, "
            f"validate_consumer_authentication={_validate_consumer_authentication!s}, "
            f"watchlist_screening={_watchlist_screening!s}, "
            f"token_create={_token_create!s}, "
            f"token_update={_token_update!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
