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

"""
shelldatareportingapis

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


class EIDSearchReq(object):

    """Implementation of the 'EIDSearchReq' model.

    TODO: type model description here.

    Attributes:
        col_co_code (int): Collecting Company Code of the selected payer.  
            Mandatory
        account_group_country (int): Country code (colco code) of the account
            group. Mandatory
        account_group_id (List[str]): List of IDs of the account groups that
            user has access to. Mandatory
        account_group_name (str): Account group name Optional. This input is a
            search criterion, if given.
        from_date (str): EID date searched from this date. Optional.
        to_date (str): Invoice date searched until this date. Optional.
        invoice_type (str): Invoice type. Optional. Possible values: •    NAT
            (National) •    INT (International)
        invoice_status (str): Status of the document.   Optional.  Possible
            values:  •    NEW  •    VIEWED  •    DOWNLOADED  •    RESTORED
        sort_by (List[str]): Sort option – •    InvoiceNumber ASC •   
            InvoiceDate ASC •    InvoiceNumber DESC •    InvoiceDate DESC
            Optional

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "col_co_code": 'ColCoCode',
        "account_group_country": 'AccountGroupCountry',
        "account_group_id": 'AccountGroupId',
        "account_group_name": 'AccountGroupName',
        "from_date": 'FromDate',
        "to_date": 'ToDate',
        "invoice_type": 'InvoiceType',
        "invoice_status": 'InvoiceStatus',
        "sort_by": 'SortBy'
    }

    _optionals = [
        'account_group_name',
        'from_date',
        'to_date',
        'invoice_type',
        'invoice_status',
        'sort_by',
    ]

    _nullables = [
        'col_co_code',
        'account_group_country',
        'account_group_name',
        'from_date',
        'to_date',
        'invoice_type',
        'invoice_status',
    ]

    def __init__(self,
                 col_co_code=None,
                 account_group_country=None,
                 account_group_id=None,
                 account_group_name=APIHelper.SKIP,
                 from_date=APIHelper.SKIP,
                 to_date=APIHelper.SKIP,
                 invoice_type=APIHelper.SKIP,
                 invoice_status=APIHelper.SKIP,
                 sort_by=APIHelper.SKIP):
        """Constructor for the EIDSearchReq class"""

        # Initialize members of the class
        self.col_co_code = col_co_code 
        self.account_group_country = account_group_country 
        self.account_group_id = account_group_id 
        if account_group_name is not APIHelper.SKIP:
            self.account_group_name = account_group_name 
        if from_date is not APIHelper.SKIP:
            self.from_date = from_date 
        if to_date is not APIHelper.SKIP:
            self.to_date = to_date 
        if invoice_type is not APIHelper.SKIP:
            self.invoice_type = invoice_type 
        if invoice_status is not APIHelper.SKIP:
            self.invoice_status = invoice_status 
        if sort_by is not APIHelper.SKIP:
            self.sort_by = sort_by 

    @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
        col_co_code = dictionary.get("ColCoCode") if dictionary.get("ColCoCode") else None
        account_group_country = dictionary.get("AccountGroupCountry") if dictionary.get("AccountGroupCountry") else None
        account_group_id = dictionary.get("AccountGroupId") if dictionary.get("AccountGroupId") else None
        account_group_name = dictionary.get("AccountGroupName") if "AccountGroupName" in dictionary.keys() else APIHelper.SKIP
        from_date = dictionary.get("FromDate") if "FromDate" in dictionary.keys() else APIHelper.SKIP
        to_date = dictionary.get("ToDate") if "ToDate" in dictionary.keys() else APIHelper.SKIP
        invoice_type = dictionary.get("InvoiceType") if "InvoiceType" in dictionary.keys() else APIHelper.SKIP
        invoice_status = dictionary.get("InvoiceStatus") if "InvoiceStatus" in dictionary.keys() else APIHelper.SKIP
        sort_by = dictionary.get("SortBy") if dictionary.get("SortBy") else APIHelper.SKIP
        # Return an object of this model
        return cls(col_co_code,
                   account_group_country,
                   account_group_id,
                   account_group_name,
                   from_date,
                   to_date,
                   invoice_type,
                   invoice_status,
                   sort_by)
