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

"""
shelldatareportingapis

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


class CustomerPriceListRequest(object):

    """Implementation of the 'CustomerPriceListRequest' model.

    TODO: type model description here.

    Attributes:
        col_co_id (int): TODO: type description here.
        col_co_code (int): TODO: type description here.
        payer_id (int): Payer Id of the selected payer. Optional if
            PayerNumber is passed else Mandatory
        payer_number (str): Payer Number of the selected payer. Optional if
            PayerId is passed else Mandatory
        account_id (int): Account Id of the customer. Optional
        account_number (str): Account Number of the customer. Optional
        customer_specific_list (int): Whether customer specific price lists
            and customer specific discount values set on pump prices are to be
            returned or not.
        price_list_type (int): Specifies the type of price lists to be
            included in the response. Optional – default value is zero.  
            Allowed values: 0 – All 1 – National Only 2 – International Only
        del_co_id (int): Delivering Company ID Optional.
        from_date (str): Start date to fetch the price lists, discount values
            on pump prices and VAT rates.  Mandatory   Format: yyyyMMdd
        to_date (str): End date to fetch the price lists, discount values on
            pump prices and VAT rates. Mandatory and greater than or equal to
            FromDate. Maximum of 30 (configurable) day’s duration is allowed
            between ‘From’ and ‘To’ dates. Format: yyyyMMdd
        include_pump_price_discounts (bool): True / False. A flag to request
            the discount information set on pump prices for the customer to be
            included in the response. Optional Default value: False

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "from_date": 'FromDate',
        "to_date": 'ToDate',
        "col_co_id": 'ColCoId',
        "col_co_code": 'ColCoCode',
        "payer_id": 'PayerId',
        "payer_number": 'PayerNumber',
        "account_id": 'AccountId',
        "account_number": 'AccountNumber',
        "customer_specific_list": 'CustomerSpecificList',
        "price_list_type": 'PriceListType',
        "del_co_id": 'DelCoId',
        "include_pump_price_discounts": 'IncludePumpPriceDiscounts'
    }

    _optionals = [
        'col_co_id',
        'col_co_code',
        'payer_id',
        'payer_number',
        'account_id',
        'account_number',
        'customer_specific_list',
        'price_list_type',
        'del_co_id',
        'include_pump_price_discounts',
    ]

    _nullables = [
        'col_co_id',
        'col_co_code',
        'payer_id',
        'payer_number',
        'account_id',
        'account_number',
        'customer_specific_list',
        'price_list_type',
        'del_co_id',
        'from_date',
        'to_date',
        'include_pump_price_discounts',
    ]

    def __init__(self,
                 from_date=None,
                 to_date=None,
                 col_co_id=APIHelper.SKIP,
                 col_co_code=APIHelper.SKIP,
                 payer_id=APIHelper.SKIP,
                 payer_number=APIHelper.SKIP,
                 account_id=APIHelper.SKIP,
                 account_number=APIHelper.SKIP,
                 customer_specific_list=APIHelper.SKIP,
                 price_list_type=APIHelper.SKIP,
                 del_co_id=APIHelper.SKIP,
                 include_pump_price_discounts=APIHelper.SKIP):
        """Constructor for the CustomerPriceListRequest class"""

        # Initialize members of the class
        if col_co_id is not APIHelper.SKIP:
            self.col_co_id = col_co_id 
        if col_co_code is not APIHelper.SKIP:
            self.col_co_code = col_co_code 
        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 
        if customer_specific_list is not APIHelper.SKIP:
            self.customer_specific_list = customer_specific_list 
        if price_list_type is not APIHelper.SKIP:
            self.price_list_type = price_list_type 
        if del_co_id is not APIHelper.SKIP:
            self.del_co_id = del_co_id 
        self.from_date = from_date 
        self.to_date = to_date 
        if include_pump_price_discounts is not APIHelper.SKIP:
            self.include_pump_price_discounts = include_pump_price_discounts 

    @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
        from_date = dictionary.get("FromDate") if dictionary.get("FromDate") else None
        to_date = dictionary.get("ToDate") if dictionary.get("ToDate") else None
        col_co_id = dictionary.get("ColCoId") if "ColCoId" in dictionary.keys() else APIHelper.SKIP
        col_co_code = dictionary.get("ColCoCode") if "ColCoCode" in dictionary.keys() else APIHelper.SKIP
        payer_id = dictionary.get("PayerId") if "PayerId" in dictionary.keys() else APIHelper.SKIP
        payer_number = dictionary.get("PayerNumber") if "PayerNumber" in dictionary.keys() else APIHelper.SKIP
        account_id = dictionary.get("AccountId") if "AccountId" in dictionary.keys() else APIHelper.SKIP
        account_number = dictionary.get("AccountNumber") if "AccountNumber" in dictionary.keys() else APIHelper.SKIP
        customer_specific_list = dictionary.get("CustomerSpecificList") if "CustomerSpecificList" in dictionary.keys() else APIHelper.SKIP
        price_list_type = dictionary.get("PriceListType") if "PriceListType" in dictionary.keys() else APIHelper.SKIP
        del_co_id = dictionary.get("DelCoId") if "DelCoId" in dictionary.keys() else APIHelper.SKIP
        include_pump_price_discounts = dictionary.get("IncludePumpPriceDiscounts") if "IncludePumpPriceDiscounts" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(from_date,
                   to_date,
                   col_co_id,
                   col_co_code,
                   payer_id,
                   payer_number,
                   account_id,
                   account_number,
                   customer_specific_list,
                   price_list_type,
                   del_co_id,
                   include_pump_price_discounts)
