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

"""
    collection

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

import collection.models.party
import collection.models.error_reason

class PreApprovalResult(object):

    """Implementation of the 'PreApprovalResult' model.

    TODO: type model description here.

    Attributes:
        payer (Party): Party identifies a account holder in the wallet
            platform. Party consists of two parameters, type and partyId. Each
            type have its own validation of the partyId<br> MSISDN - Mobile
            Number validated according to ITU-T E.164. Validated with
            IsMSISDN<br> EMAIL - Validated to be a valid e-mail format.
            Validated with IsEmail<br> PARTY_CODE - UUID of the party.
            Validated with IsUuid
        payer_currency (string): ISO4217 Currency
        payer_message (string): The mesage that is shown to the approver.
        validity_time (int): The request validity time of the pre-approval
        status (StatusEnum): TODO: type description here.
        reason (ErrorReason): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payer":'payer',
        "payer_currency":'payerCurrency',
        "payer_message":'payerMessage',
        "validity_time":'validityTime',
        "status":'status',
        "reason":'reason'
    }

    def __init__(self,
                 payer=None,
                 payer_currency=None,
                 payer_message=None,
                 validity_time=None,
                 status=None,
                 reason=None):
        """Constructor for the PreApprovalResult class"""

        # Initialize members of the class
        self.payer = payer
        self.payer_currency = payer_currency
        self.payer_message = payer_message
        self.validity_time = validity_time
        self.status = status
        self.reason = reason


    @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
        payer = collection.models.party.Party.from_dictionary(dictionary.get('payer')) if dictionary.get('payer') else None
        payer_currency = dictionary.get('payerCurrency')
        payer_message = dictionary.get('payerMessage')
        validity_time = dictionary.get('validityTime')
        status = dictionary.get('status')
        reason = collection.models.error_reason.ErrorReason.from_dictionary(dictionary.get('reason')) if dictionary.get('reason') else None

        # Return an object of this model
        return cls(payer,
                   payer_currency,
                   payer_message,
                   validity_time,
                   status,
                   reason)



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

"""
    collection

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

import collection.models.party
import collection.models.error_reason

class PreApprovalResult(object):

    """Implementation of the 'PreApprovalResult' model.

    TODO: type model description here.

    Attributes:
        payer (Party): Party identifies a account holder in the wallet
            platform. Party consists of two parameters, type and partyId. Each
            type have its own validation of the partyId<br> MSISDN - Mobile
            Number validated according to ITU-T E.164. Validated with
            IsMSISDN<br> EMAIL - Validated to be a valid e-mail format.
            Validated with IsEmail<br> PARTY_CODE - UUID of the party.
            Validated with IsUuid
        payer_currency (string): ISO4217 Currency
        payer_message (string): The mesage that is shown to the approver.
        validity_time (int): The request validity time of the pre-approval
        status (StatusEnum): TODO: type description here.
        reason (ErrorReason): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payer":'payer',
        "payer_currency":'payerCurrency',
        "payer_message":'payerMessage',
        "validity_time":'validityTime',
        "status":'status',
        "reason":'reason'
    }

    def __init__(self,
                 payer=None,
                 payer_currency=None,
                 payer_message=None,
                 validity_time=None,
                 status=None,
                 reason=None):
        """Constructor for the PreApprovalResult class"""

        # Initialize members of the class
        self.payer = payer
        self.payer_currency = payer_currency
        self.payer_message = payer_message
        self.validity_time = validity_time
        self.status = status
        self.reason = reason


    @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
        payer = collection.models.party.Party.from_dictionary(dictionary.get('payer')) if dictionary.get('payer') else None
        payer_currency = dictionary.get('payerCurrency')
        payer_message = dictionary.get('payerMessage')
        validity_time = dictionary.get('validityTime')
        status = dictionary.get('status')
        reason = collection.models.error_reason.ErrorReason.from_dictionary(dictionary.get('reason')) if dictionary.get('reason') else None

        # Return an object of this model
        return cls(payer,
                   payer_currency,
                   payer_message,
                   validity_time,
                   status,
                   reason)



# -*- coding: utf-8 -*- collection
 
     This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). Implementation of the 'PreApprovalResult' model.
 
     TODO: type model description here.
 
     Attributes:
         payer (Party): Party identifies a account holder in the wallet
             platform. Party consists of two parameters, type and partyId. Each
             type have its own validation of the partyId<br> MSISDN - Mobile
             Number validated according to ITU-T E.164. Validated with
             IsMSISDN<br> EMAIL - Validated to be a valid e-mail format.
             Validated with IsEmail<br> PARTY_CODE - UUID of the party.
             Validated with IsUuid
         payer_currency (string): ISO4217 Currency
         payer_message (string): The mesage that is shown to the approver.
         validity_time (int): The request validity time of the pre-approval
         status (StatusEnum): TODO: type description here.
         reason (ErrorReason): TODO: type description here. # Create a mapping from Model property names to API property names Constructor for the PreApprovalResult class # Initialize members of the class 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. # Extract variables from the dictionary # Return an object of this model