# -*- 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.card_day_time_restrictions import CardDayTimeRestrictions
from shelldatareportingapis.models.card_usage_restrictions import CardUsageRestrictions
from shelldatareportingapis.models.purchase_categories import PurchaseCategories


class CardTypeResponseCustomerCardTypesItems(object):

    """Implementation of the 'CardTypeResponseCustomerCardTypesItems' model.

    TODO: type model description here.

    Attributes:
        can_have_pin (bool): True/False – Whether the cards of this card type
            can have PIN.
        card_type_id (int): Card Type Id
        card_type_name (str): Card Type Name.
        col_co_currency_code (str): ISO currency code of the country.
        customer_card_type_id (int): Customer Card Type Id
        day_time_restrictions (CardDayTimeRestrictions): TODO: type
            description here.
        default_purchase_category_id (int): Default Purchase category of the
            card type.
        emboss_account_name (str): Default Name to be embossed on the card
        expiry_period (int): Default Expiry period.
        is_crt (bool): True/False – Wether it is a CRT Card type or not.
        is_fleet (bool): True/False – Whether it is it a Fleet Card typeor not.
        is_international (bool): True/False – Whether it is an International
            Card type or not.
        is_national (bool): True/False – Whether it is a National Card type or
            not.
        is_partner_sites_included (bool): True/False – Whether this card type
            is allowed in partner Stations.
        is_shell_sites_only (bool): True/False – Whether it is only allowed in
            Shell Stations or not.
        is_virtual (bool): True/False - Whether it is a Virtual Card type or
            not.
        is_visible_to_customers (bool): True/False – Whether this card type is
            visible in SFH for card ordering.
        is_active (bool): Whether card type is active or not.
        is_card_available_for_download (bool): TODO: type description here.
        is_card_visible_to_customers (bool): TODO: type description here.
        pan_length (int): PAN Length
        purchase_categories (List[PurchaseCategories]): TODO: type description
            here.
        token_type_id (int): Token type identifier.
        token_type_name (str): Token Type Name.
        usage_restrictions (CardUsageRestrictions): TODO: type description
            here.
        emv_contactless (bool): Is Europay, MasterCard, and Visa Contactless
            enabled or not
        rfid (bool): Whether the card type is enabled for RFID (Radio
            Frequency Identification)
        pin_change_supported (bool): PIN change supported or not.
        require_pin (bool): Whether a PIN is mandatory for the cards of this
            card type.
        offline_pin (bool): Whether offline PIN is enabled or not.
        is_default (bool): Whether card type is default or not.
        applications_to_show_npii_tokens (bool): True/False   Note:
            ApplicationsToShowNPIITokens will be set as ‘True’ when the
            accessing application API key exists in the
            “ApplicationsToShowNPIITokens” card type configuration else
            “False”.
        medium_type_id (int): Id of the medium type identifier. Example: 1,2,4
            Full list below: 1 - Fuel Card 2 - Fuel Card with EV 3 - EV only 4
            - Fuel Card and Key Fob 5 - Key Fob 6 - Virtual Card 7 - NPII
            Token 8 – Smartpay Token
        medium_type (str): Name of the medium type identifier.  Example: Fuel
            Card, Fuel Card with EV, Key Fob      Full list below:  1 - Fuel
            Card  2 - Fuel Card with EV  3 - EV only  4 - Fuel Card and Key
            Fob  5 - Key Fob  6 - Virtual Card  7 - NPII Token  8 - Smartpay
            Token
        col_co_currency_symbol (str): Currency symbol of the country.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "can_have_pin": 'CanHavePIN',
        "card_type_id": 'CardTypeId',
        "card_type_name": 'CardTypeName',
        "col_co_currency_code": 'ColCoCurrencyCode',
        "customer_card_type_id": 'CustomerCardTypeId',
        "day_time_restrictions": 'DayTimeRestrictions',
        "default_purchase_category_id": 'DefaultPurchaseCategoryId',
        "emboss_account_name": 'EmbossAccountName',
        "expiry_period": 'ExpiryPeriod',
        "is_crt": 'IsCRT',
        "is_fleet": 'IsFleet',
        "is_international": 'IsInternational',
        "is_national": 'IsNational',
        "is_partner_sites_included": 'IsPartnerSitesIncluded',
        "is_shell_sites_only": 'IsShellSitesOnly',
        "is_virtual": 'IsVirtual',
        "is_visible_to_customers": 'IsVisibleToCustomers',
        "is_active": 'IsActive',
        "is_card_available_for_download": 'IsCardAvailableForDownload',
        "is_card_visible_to_customers": 'IsCardVisibleToCustomers',
        "pan_length": 'PANLength',
        "purchase_categories": 'PurchaseCategories',
        "token_type_id": 'TokenTypeId',
        "token_type_name": 'TokenTypeName',
        "usage_restrictions": 'UsageRestrictions',
        "emv_contactless": 'EMVContactless',
        "rfid": 'RFID',
        "pin_change_supported": 'PINChangeSupported',
        "require_pin": 'RequirePIN',
        "offline_pin": 'OfflinePIN',
        "is_default": 'IsDefault',
        "applications_to_show_npii_tokens": 'ApplicationsToShowNPIITokens',
        "medium_type_id": 'MediumTypeID',
        "medium_type": 'MediumType',
        "col_co_currency_symbol": 'ColCoCurrencySymbol'
    }

    _optionals = [
        'can_have_pin',
        'card_type_id',
        'card_type_name',
        'col_co_currency_code',
        'customer_card_type_id',
        'day_time_restrictions',
        'default_purchase_category_id',
        'emboss_account_name',
        'expiry_period',
        'is_crt',
        'is_fleet',
        'is_international',
        'is_national',
        'is_partner_sites_included',
        'is_shell_sites_only',
        'is_virtual',
        'is_visible_to_customers',
        'is_active',
        'is_card_available_for_download',
        'is_card_visible_to_customers',
        'pan_length',
        'purchase_categories',
        'token_type_id',
        'token_type_name',
        'usage_restrictions',
        'emv_contactless',
        'rfid',
        'pin_change_supported',
        'require_pin',
        'offline_pin',
        'is_default',
        'applications_to_show_npii_tokens',
        'medium_type_id',
        'medium_type',
        'col_co_currency_symbol',
    ]

    _nullables = [
        'card_type_id',
        'card_type_name',
        'col_co_currency_code',
        'customer_card_type_id',
        'default_purchase_category_id',
        'emboss_account_name',
        'expiry_period',
        'pan_length',
        'purchase_categories',
        'token_type_id',
        'token_type_name',
        'medium_type_id',
        'medium_type',
        'col_co_currency_symbol',
    ]

    def __init__(self,
                 can_have_pin=APIHelper.SKIP,
                 card_type_id=APIHelper.SKIP,
                 card_type_name=APIHelper.SKIP,
                 col_co_currency_code=APIHelper.SKIP,
                 customer_card_type_id=APIHelper.SKIP,
                 day_time_restrictions=APIHelper.SKIP,
                 default_purchase_category_id=APIHelper.SKIP,
                 emboss_account_name=APIHelper.SKIP,
                 expiry_period=APIHelper.SKIP,
                 is_crt=APIHelper.SKIP,
                 is_fleet=APIHelper.SKIP,
                 is_international=APIHelper.SKIP,
                 is_national=APIHelper.SKIP,
                 is_partner_sites_included=APIHelper.SKIP,
                 is_shell_sites_only=APIHelper.SKIP,
                 is_virtual=APIHelper.SKIP,
                 is_visible_to_customers=APIHelper.SKIP,
                 is_active=APIHelper.SKIP,
                 is_card_available_for_download=APIHelper.SKIP,
                 is_card_visible_to_customers=APIHelper.SKIP,
                 pan_length=APIHelper.SKIP,
                 purchase_categories=APIHelper.SKIP,
                 token_type_id=APIHelper.SKIP,
                 token_type_name=APIHelper.SKIP,
                 usage_restrictions=APIHelper.SKIP,
                 emv_contactless=APIHelper.SKIP,
                 rfid=APIHelper.SKIP,
                 pin_change_supported=APIHelper.SKIP,
                 require_pin=APIHelper.SKIP,
                 offline_pin=APIHelper.SKIP,
                 is_default=APIHelper.SKIP,
                 applications_to_show_npii_tokens=APIHelper.SKIP,
                 medium_type_id=APIHelper.SKIP,
                 medium_type=APIHelper.SKIP,
                 col_co_currency_symbol=APIHelper.SKIP):
        """Constructor for the CardTypeResponseCustomerCardTypesItems class"""

        # Initialize members of the class
        if can_have_pin is not APIHelper.SKIP:
            self.can_have_pin = can_have_pin 
        if card_type_id is not APIHelper.SKIP:
            self.card_type_id = card_type_id 
        if card_type_name is not APIHelper.SKIP:
            self.card_type_name = card_type_name 
        if col_co_currency_code is not APIHelper.SKIP:
            self.col_co_currency_code = col_co_currency_code 
        if customer_card_type_id is not APIHelper.SKIP:
            self.customer_card_type_id = customer_card_type_id 
        if day_time_restrictions is not APIHelper.SKIP:
            self.day_time_restrictions = day_time_restrictions 
        if default_purchase_category_id is not APIHelper.SKIP:
            self.default_purchase_category_id = default_purchase_category_id 
        if emboss_account_name is not APIHelper.SKIP:
            self.emboss_account_name = emboss_account_name 
        if expiry_period is not APIHelper.SKIP:
            self.expiry_period = expiry_period 
        if is_crt is not APIHelper.SKIP:
            self.is_crt = is_crt 
        if is_fleet is not APIHelper.SKIP:
            self.is_fleet = is_fleet 
        if is_international is not APIHelper.SKIP:
            self.is_international = is_international 
        if is_national is not APIHelper.SKIP:
            self.is_national = is_national 
        if is_partner_sites_included is not APIHelper.SKIP:
            self.is_partner_sites_included = is_partner_sites_included 
        if is_shell_sites_only is not APIHelper.SKIP:
            self.is_shell_sites_only = is_shell_sites_only 
        if is_virtual is not APIHelper.SKIP:
            self.is_virtual = is_virtual 
        if is_visible_to_customers is not APIHelper.SKIP:
            self.is_visible_to_customers = is_visible_to_customers 
        if is_active is not APIHelper.SKIP:
            self.is_active = is_active 
        if is_card_available_for_download is not APIHelper.SKIP:
            self.is_card_available_for_download = is_card_available_for_download 
        if is_card_visible_to_customers is not APIHelper.SKIP:
            self.is_card_visible_to_customers = is_card_visible_to_customers 
        if pan_length is not APIHelper.SKIP:
            self.pan_length = pan_length 
        if purchase_categories is not APIHelper.SKIP:
            self.purchase_categories = purchase_categories 
        if token_type_id is not APIHelper.SKIP:
            self.token_type_id = token_type_id 
        if token_type_name is not APIHelper.SKIP:
            self.token_type_name = token_type_name 
        if usage_restrictions is not APIHelper.SKIP:
            self.usage_restrictions = usage_restrictions 
        if emv_contactless is not APIHelper.SKIP:
            self.emv_contactless = emv_contactless 
        if rfid is not APIHelper.SKIP:
            self.rfid = rfid 
        if pin_change_supported is not APIHelper.SKIP:
            self.pin_change_supported = pin_change_supported 
        if require_pin is not APIHelper.SKIP:
            self.require_pin = require_pin 
        if offline_pin is not APIHelper.SKIP:
            self.offline_pin = offline_pin 
        if is_default is not APIHelper.SKIP:
            self.is_default = is_default 
        if applications_to_show_npii_tokens is not APIHelper.SKIP:
            self.applications_to_show_npii_tokens = applications_to_show_npii_tokens 
        if medium_type_id is not APIHelper.SKIP:
            self.medium_type_id = medium_type_id 
        if medium_type is not APIHelper.SKIP:
            self.medium_type = medium_type 
        if col_co_currency_symbol is not APIHelper.SKIP:
            self.col_co_currency_symbol = col_co_currency_symbol 

    @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
        can_have_pin = dictionary.get("CanHavePIN") if "CanHavePIN" in dictionary.keys() else APIHelper.SKIP
        card_type_id = dictionary.get("CardTypeId") if "CardTypeId" in dictionary.keys() else APIHelper.SKIP
        card_type_name = dictionary.get("CardTypeName") if "CardTypeName" in dictionary.keys() else APIHelper.SKIP
        col_co_currency_code = dictionary.get("ColCoCurrencyCode") if "ColCoCurrencyCode" in dictionary.keys() else APIHelper.SKIP
        customer_card_type_id = dictionary.get("CustomerCardTypeId") if "CustomerCardTypeId" in dictionary.keys() else APIHelper.SKIP
        day_time_restrictions = CardDayTimeRestrictions.from_dictionary(dictionary.get('DayTimeRestrictions')) if 'DayTimeRestrictions' in dictionary.keys() else APIHelper.SKIP
        default_purchase_category_id = dictionary.get("DefaultPurchaseCategoryId") if "DefaultPurchaseCategoryId" in dictionary.keys() else APIHelper.SKIP
        emboss_account_name = dictionary.get("EmbossAccountName") if "EmbossAccountName" in dictionary.keys() else APIHelper.SKIP
        expiry_period = dictionary.get("ExpiryPeriod") if "ExpiryPeriod" in dictionary.keys() else APIHelper.SKIP
        is_crt = dictionary.get("IsCRT") if "IsCRT" in dictionary.keys() else APIHelper.SKIP
        is_fleet = dictionary.get("IsFleet") if "IsFleet" in dictionary.keys() else APIHelper.SKIP
        is_international = dictionary.get("IsInternational") if "IsInternational" in dictionary.keys() else APIHelper.SKIP
        is_national = dictionary.get("IsNational") if "IsNational" in dictionary.keys() else APIHelper.SKIP
        is_partner_sites_included = dictionary.get("IsPartnerSitesIncluded") if "IsPartnerSitesIncluded" in dictionary.keys() else APIHelper.SKIP
        is_shell_sites_only = dictionary.get("IsShellSitesOnly") if "IsShellSitesOnly" in dictionary.keys() else APIHelper.SKIP
        is_virtual = dictionary.get("IsVirtual") if "IsVirtual" in dictionary.keys() else APIHelper.SKIP
        is_visible_to_customers = dictionary.get("IsVisibleToCustomers") if "IsVisibleToCustomers" in dictionary.keys() else APIHelper.SKIP
        is_active = dictionary.get("IsActive") if "IsActive" in dictionary.keys() else APIHelper.SKIP
        is_card_available_for_download = dictionary.get("IsCardAvailableForDownload") if "IsCardAvailableForDownload" in dictionary.keys() else APIHelper.SKIP
        is_card_visible_to_customers = dictionary.get("IsCardVisibleToCustomers") if "IsCardVisibleToCustomers" in dictionary.keys() else APIHelper.SKIP
        pan_length = dictionary.get("PANLength") if "PANLength" in dictionary.keys() else APIHelper.SKIP
        if 'PurchaseCategories' in dictionary.keys():
            purchase_categories = [PurchaseCategories.from_dictionary(x) for x in dictionary.get('PurchaseCategories')] if dictionary.get('PurchaseCategories') else None
        else:
            purchase_categories = APIHelper.SKIP
        token_type_id = dictionary.get("TokenTypeId") if "TokenTypeId" in dictionary.keys() else APIHelper.SKIP
        token_type_name = dictionary.get("TokenTypeName") if "TokenTypeName" in dictionary.keys() else APIHelper.SKIP
        usage_restrictions = CardUsageRestrictions.from_dictionary(dictionary.get('UsageRestrictions')) if 'UsageRestrictions' in dictionary.keys() else APIHelper.SKIP
        emv_contactless = dictionary.get("EMVContactless") if "EMVContactless" in dictionary.keys() else APIHelper.SKIP
        rfid = dictionary.get("RFID") if "RFID" in dictionary.keys() else APIHelper.SKIP
        pin_change_supported = dictionary.get("PINChangeSupported") if "PINChangeSupported" in dictionary.keys() else APIHelper.SKIP
        require_pin = dictionary.get("RequirePIN") if "RequirePIN" in dictionary.keys() else APIHelper.SKIP
        offline_pin = dictionary.get("OfflinePIN") if "OfflinePIN" in dictionary.keys() else APIHelper.SKIP
        is_default = dictionary.get("IsDefault") if "IsDefault" in dictionary.keys() else APIHelper.SKIP
        applications_to_show_npii_tokens = dictionary.get("ApplicationsToShowNPIITokens") if "ApplicationsToShowNPIITokens" in dictionary.keys() else APIHelper.SKIP
        medium_type_id = dictionary.get("MediumTypeID") if "MediumTypeID" in dictionary.keys() else APIHelper.SKIP
        medium_type = dictionary.get("MediumType") if "MediumType" in dictionary.keys() else APIHelper.SKIP
        col_co_currency_symbol = dictionary.get("ColCoCurrencySymbol") if "ColCoCurrencySymbol" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(can_have_pin,
                   card_type_id,
                   card_type_name,
                   col_co_currency_code,
                   customer_card_type_id,
                   day_time_restrictions,
                   default_purchase_category_id,
                   emboss_account_name,
                   expiry_period,
                   is_crt,
                   is_fleet,
                   is_international,
                   is_national,
                   is_partner_sites_included,
                   is_shell_sites_only,
                   is_virtual,
                   is_visible_to_customers,
                   is_active,
                   is_card_available_for_download,
                   is_card_visible_to_customers,
                   pan_length,
                   purchase_categories,
                   token_type_id,
                   token_type_name,
                   usage_restrictions,
                   emv_contactless,
                   rfid,
                   pin_change_supported,
                   require_pin,
                   offline_pin,
                   is_default,
                   applications_to_show_npii_tokens,
                   medium_type_id,
                   medium_type,
                   col_co_currency_symbol)
