# -*- coding: utf-8 -*-

"""
pqapiv2

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from pqapiv2.api_helper import APIHelper
from pqapiv2.models.haetos_params import HaetosParams


class IdentityVerificationResponse(object):

    """Implementation of the 'identityVerification-Response' model.

    TODO: type model description here.

    Attributes:
        idv_provider_reference (string): IDV provider unique ID for the IDV
            check performed
        idv_result (IdentityVerificationResultTypesEnum): In combination with
            the <i>Disposition</i> type, the <i>Result</i> type provides the
            results of an IDV check. A <i>Dispositioned</i> result of <i>FINAL
            PASS</i> represents a passing check, whereas a <i>TRANSIENT
            FAIL</i> is still being processed but has failed at least one
            phase of the check. Until the disposition is <i>FINAL</i>, a
            result has not been determined.
        idv_sub_result (IdentityVerificationResultSubTypesEnum): If used by a
            provider, sub-results that give additional insight into the
            results, including whether they result was <i>Soft</i> or
            <i>Hard</i>. <i>Soft</i> results may have additional recourse that
            can be leveraged to validate a user’s identity.
        idv_provider (IdentityVerificationProviderTypesEnum): Provider types
            of verification that can be used for performing identity checks
        created_on (datetime): Time at which the object was created.
        raw (string): Contains the raw (unprocessed) output from the IDV
            provider. Format of the raw output can vary widely and is not
            documented. *For reference/debugging only
        idv_check_type (IdentityVerificationCheckTypesEnum): Types of
            verification used for performing identity checks
            (<i>documentary</i>, <i>non-documentary</i>, <i>OFAC</i>, etc.)
        idv_dispostion (IdentityVerificationDispositionTypesEnum): In
            combination with the <i>Disposition</i> type, the <i>Result</i>
            type provides the results of an IDV check. A <i>Dispositioned</i>
            result of <i>FINAL PASS</i> represents a passing check, whereas a
            <i>TRANSIENT FAIL</i> is still being processed but has failed at
            least one phase of the check. Until the disposition is
            <i>FINAL</i>, a result has not been determined.
        token (string): Token representing the resource, prefixed with
            <i>user-</i>, <i>dest-</i>, <i>xfer-</i>, <i>acct-</i>,
            <i>pmnt-</i>, or <i>docu-</i>.
        links (list of HaetosParams): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "idv_provider_reference": 'idvProviderReference',
        "idv_result": 'idvResult',
        "idv_sub_result": 'idvSubResult',
        "idv_provider": 'idvProvider',
        "created_on": 'createdOn',
        "raw": 'raw',
        "idv_check_type": 'idvCheckType',
        "idv_dispostion": 'idvDispostion',
        "token": 'token',
        "links": 'links'
    }

    def __init__(self,
                 idv_provider_reference=None,
                 idv_result=None,
                 idv_sub_result=None,
                 idv_provider=None,
                 created_on=None,
                 raw=None,
                 idv_check_type=None,
                 idv_dispostion=None,
                 token=None,
                 links=None):
        """Constructor for the IdentityVerificationResponse class"""

        # Initialize members of the class
        self.idv_provider_reference = idv_provider_reference
        self.idv_result = idv_result
        self.idv_sub_result = idv_sub_result
        self.idv_provider = idv_provider
        self.created_on = APIHelper.RFC3339DateTime(created_on) if created_on else None
        self.raw = raw
        self.idv_check_type = idv_check_type
        self.idv_dispostion = idv_dispostion
        self.token = token
        self.links = links

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates 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 dictionary is None:
            return None

        # Extract variables from the dictionary
        idv_provider_reference = dictionary.get('idvProviderReference')
        idv_result = dictionary.get('idvResult')
        idv_sub_result = dictionary.get('idvSubResult')
        idv_provider = dictionary.get('idvProvider')
        created_on = APIHelper.RFC3339DateTime.from_value(dictionary.get("createdOn")).datetime if dictionary.get("createdOn") else None
        raw = dictionary.get('raw')
        idv_check_type = dictionary.get('idvCheckType')
        idv_dispostion = dictionary.get('idvDispostion')
        token = dictionary.get('token')
        links = None
        if dictionary.get('links') is not None:
            links = [HaetosParams.from_dictionary(x) for x in dictionary.get('links')]

        # Return an object of this model
        return cls(idv_provider_reference,
                   idv_result,
                   idv_sub_result,
                   idv_provider,
                   created_on,
                   raw,
                   idv_check_type,
                   idv_dispostion,
                   token,
                   links)
