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

"""
shelldatareportingapis

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


class PayerRequest(object):

    """Implementation of the 'PayerRequest' model.

    TODO: type model description here.

    Attributes:
        payers (List[Payers]): List of Payer entity. Optional. Note: •    Max
            number of payers allowed in the input is 10, if it exceeds in the
            input it will throw an error. •    This value is configurable.
            Initial configuration will be 1000 and will change to 10 once SFH
            changes are integrated.
        return_basic_details_only (bool): Returns only the high-level basic
            details of payers. Set this field to ‘true’ when only the basic
            details are required to get the result quicker.
        include_addresses (bool): Include address related fields on the
            response. Set this field to ‘False’ when Address fields are not
            required to get the result quicker.
        include_bonus_parameters (bool): Include the Finance Currency, used
            for Finance Widget, in the response
        current_page (int): Page Number
        page_size (int): Page Size – Number of records to show on a page   
            Default value 50  Return 250 rows only in the response if -1 is
            supplied as page size.    Note:   •    Max page size is 250, if
            the user provided value is more than 250 then it will throw error.
            •    This value is configurable.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "payers": 'Payers',
        "return_basic_details_only": 'ReturnBasicDetailsOnly',
        "include_addresses": 'IncludeAddresses',
        "include_bonus_parameters": 'IncludeBonusParameters',
        "current_page": 'CurrentPage',
        "page_size": 'PageSize'
    }

    _optionals = [
        'payers',
        'return_basic_details_only',
        'include_addresses',
        'include_bonus_parameters',
        'current_page',
        'page_size',
    ]

    def __init__(self,
                 payers=APIHelper.SKIP,
                 return_basic_details_only=False,
                 include_addresses=False,
                 include_bonus_parameters=False,
                 current_page=APIHelper.SKIP,
                 page_size=APIHelper.SKIP):
        """Constructor for the PayerRequest class"""

        # Initialize members of the class
        if payers is not APIHelper.SKIP:
            self.payers = payers 
        self.return_basic_details_only = return_basic_details_only 
        self.include_addresses = include_addresses 
        self.include_bonus_parameters = include_bonus_parameters 
        if current_page is not APIHelper.SKIP:
            self.current_page = current_page 
        if page_size is not APIHelper.SKIP:
            self.page_size = page_size 

    @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
        payers = None
        if dictionary.get('Payers') is not None:
            payers = [Payers.from_dictionary(x) for x in dictionary.get('Payers')]
        else:
            payers = APIHelper.SKIP
        return_basic_details_only = dictionary.get("ReturnBasicDetailsOnly") if dictionary.get("ReturnBasicDetailsOnly") else False
        include_addresses = dictionary.get("IncludeAddresses") if dictionary.get("IncludeAddresses") else False
        include_bonus_parameters = dictionary.get("IncludeBonusParameters") if dictionary.get("IncludeBonusParameters") else False
        current_page = dictionary.get("CurrentPage") if dictionary.get("CurrentPage") else APIHelper.SKIP
        page_size = dictionary.get("PageSize") if dictionary.get("PageSize") else APIHelper.SKIP
        # Return an object of this model
        return cls(payers,
                   return_basic_details_only,
                   include_addresses,
                   include_bonus_parameters,
                   current_page,
                   page_size)
