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

"""
shelldatareportingapis

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


class MultiPricedTransactionRequestAccountsItems(object):

    """Implementation of the 'MultiPricedTransactionRequestAccountsItems' model.

    TODO: type model description here.

    Attributes:
        payer_id (int): Payer Id of the selected payer. Optional if
            PayerNumber is passed else Mandatory Example: 123456
        payer_number (str): Payer Number (Ex: GB000000123) of the selected
            payer. Optional if PayerId is passed else Mandatory Example:
            GB000000123
        account_id (int): Account Id  of the selected account.
        account_number (str): Account Number (ex: GB000000123) of the selected
            account.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payer_id": 'PayerId',
        "payer_number": 'PayerNumber',
        "account_id": 'AccountId',
        "account_number": 'AccountNumber'
    }

    _optionals = [
        'payer_id',
        'payer_number',
        'account_id',
        'account_number',
    ]

    def __init__(self,
                 payer_id=APIHelper.SKIP,
                 payer_number=APIHelper.SKIP,
                 account_id=APIHelper.SKIP,
                 account_number=APIHelper.SKIP):
        """Constructor for the MultiPricedTransactionRequestAccountsItems class"""

        # Initialize members of the class
        if payer_id is not APIHelper.SKIP:
            self.payer_id = payer_id 
        if payer_number is not APIHelper.SKIP:
            self.payer_number = payer_number 
        if account_id is not APIHelper.SKIP:
            self.account_id = account_id 
        if account_number is not APIHelper.SKIP:
            self.account_number = account_number 

    @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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        payer_id = dictionary.get("PayerId") if dictionary.get("PayerId") else APIHelper.SKIP
        payer_number = dictionary.get("PayerNumber") if dictionary.get("PayerNumber") else APIHelper.SKIP
        account_id = dictionary.get("AccountId") if dictionary.get("AccountId") else APIHelper.SKIP
        account_number = dictionary.get("AccountNumber") if dictionary.get("AccountNumber") else APIHelper.SKIP
        # Return an object of this model
        return cls(payer_id,
                   payer_number,
                   account_id,
                   account_number)
