# -*- 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.address import Address
from shelldatareportingapis.models.delivery_addresses import DeliveryAddresses
from shelldatareportingapis.models.error_status import ErrorStatus
from shelldatareportingapis.models.pin_advice_types import PINAdviceTypes


class CustomerDetailResponse(object):

    """Implementation of the 'CustomerDetailResponse' model.

    TODO: type model description here.

    Attributes:
        account_id (int): Account Id of the selected account.
        account_name (str): Account Name of the selected account.
        account_number (str): Account Number of the selected account.
        account_short_name (str): Short name of the customer.
        account_trading_name (str): Trading name of the customer
        allow_fleet_id_input (bool): True/False. When false, users should not
            be allowed to enable Fleet Id prompt option while ordering cards
            under this account.
        band (str): Band Id and Description of the Payer in Card Platform e.g.
            (Id – Description): 1-Platinum 2-Gold 3-Silver 4-Bronze
        billing_address (Address): TODO: type description here.
        card_group_position (str): Card group position at – •    Payer – Payer
            level •    Account – Account level
        correspondence_address (Address): TODO: type description here.
        delivery_addresses (List[DeliveryAddresses]): TODO: type description
            here.
        fleet_pin (bool): Is Fleet Pin optional enabled for the selected
            account
        full_name (str): Full Name of the customer
        invoice_customer_id (int): Customer Id of the Invoice Point of the
            account
        invoice_customer_short_name (str): Short Name of the Invoice Point of
            the account
        is_invoice_point (bool): Whether the account is an invoice point.
        marketing_segmentation (str): Marketing Segmentation id and
            description e.g. (Id – Description): 1-National CRT
            2-International CRT & IKAs 3-Small Customers
            4-National/International Fleet/IKA
        vat_number (str): VAT Registration Number of Customer
        payer_id (int): Payer Id of the selected account.
        payer_name (str): Payer Name of the selected account.
        payer_number (str): Payer Number of the selected account.
        self_selected_pin (bool): Is Self-selected Pin enabled for the account
        status (str): Payer current status id and description  e.g. (Id –
            Description):  1-Active  2-Requested from UTA   3-Awaiting
            embossing   4-Manufactured  5-Awaiting despatch
        default_pin_advice_type (int): Default PIN AdviceType of the customer.
            Possible Values: 1.    Paper 2.    Email 3.    SMS 4.    None
        pin_advice_types (List[PINAdviceTypes]): TODO: type description here.
        error (ErrorStatus): TODO: type description here.
        request_id (str): API Request id
        pin_change_allowed_by_cardholder (bool): PIN change allowed for card
            holder or not.
        pin_change_allowed_from_fleet_pin (bool): PIN change allowed from
            fleetpin or not.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "account_id": 'AccountId',
        "account_name": 'AccountName',
        "account_number": 'AccountNumber',
        "account_short_name": 'AccountShortName',
        "account_trading_name": 'AccountTradingName',
        "allow_fleet_id_input": 'AllowFleetIdInput',
        "band": 'Band',
        "billing_address": 'BillingAddress',
        "card_group_position": 'CardGroupPosition',
        "correspondence_address": 'CorrespondenceAddress',
        "delivery_addresses": 'DeliveryAddresses',
        "fleet_pin": 'FleetPin',
        "full_name": 'FullName',
        "invoice_customer_id": 'InvoiceCustomerId',
        "invoice_customer_short_name": 'InvoiceCustomerShortName',
        "is_invoice_point": 'IsInvoicePoint',
        "marketing_segmentation": 'MarketingSegmentation',
        "vat_number": 'VATNumber',
        "payer_id": 'PayerId',
        "payer_name": 'PayerName',
        "payer_number": 'PayerNumber',
        "self_selected_pin": 'SelfSelectedPin',
        "status": 'Status',
        "default_pin_advice_type": 'DefaultPINAdviceType',
        "pin_advice_types": 'PINAdviceTypes',
        "error": 'Error',
        "request_id": 'RequestId',
        "pin_change_allowed_by_cardholder": 'PINChangeAllowedByCardholder',
        "pin_change_allowed_from_fleet_pin": 'PINChangeAllowedFromFleetPIN'
    }

    _optionals = [
        'account_id',
        'account_name',
        'account_number',
        'account_short_name',
        'account_trading_name',
        'allow_fleet_id_input',
        'band',
        'billing_address',
        'card_group_position',
        'correspondence_address',
        'delivery_addresses',
        'fleet_pin',
        'full_name',
        'invoice_customer_id',
        'invoice_customer_short_name',
        'is_invoice_point',
        'marketing_segmentation',
        'vat_number',
        'payer_id',
        'payer_name',
        'payer_number',
        'self_selected_pin',
        'status',
        'default_pin_advice_type',
        'pin_advice_types',
        'error',
        'request_id',
        'pin_change_allowed_by_cardholder',
        'pin_change_allowed_from_fleet_pin',
    ]

    _nullables = [
        'account_id',
        'account_name',
        'account_number',
        'account_short_name',
        'account_trading_name',
        'band',
        'card_group_position',
        'full_name',
        'invoice_customer_id',
        'invoice_customer_short_name',
        'is_invoice_point',
        'marketing_segmentation',
        'vat_number',
        'payer_id',
        'payer_name',
        'payer_number',
        'self_selected_pin',
        'status',
        'default_pin_advice_type',
        'request_id',
    ]

    def __init__(self,
                 account_id=APIHelper.SKIP,
                 account_name=APIHelper.SKIP,
                 account_number=APIHelper.SKIP,
                 account_short_name=APIHelper.SKIP,
                 account_trading_name=APIHelper.SKIP,
                 allow_fleet_id_input=APIHelper.SKIP,
                 band=APIHelper.SKIP,
                 billing_address=APIHelper.SKIP,
                 card_group_position=APIHelper.SKIP,
                 correspondence_address=APIHelper.SKIP,
                 delivery_addresses=APIHelper.SKIP,
                 fleet_pin=APIHelper.SKIP,
                 full_name=APIHelper.SKIP,
                 invoice_customer_id=APIHelper.SKIP,
                 invoice_customer_short_name=APIHelper.SKIP,
                 is_invoice_point=APIHelper.SKIP,
                 marketing_segmentation=APIHelper.SKIP,
                 vat_number=APIHelper.SKIP,
                 payer_id=APIHelper.SKIP,
                 payer_name=APIHelper.SKIP,
                 payer_number=APIHelper.SKIP,
                 self_selected_pin=APIHelper.SKIP,
                 status=APIHelper.SKIP,
                 default_pin_advice_type=APIHelper.SKIP,
                 pin_advice_types=APIHelper.SKIP,
                 error=APIHelper.SKIP,
                 request_id=APIHelper.SKIP,
                 pin_change_allowed_by_cardholder=APIHelper.SKIP,
                 pin_change_allowed_from_fleet_pin=APIHelper.SKIP):
        """Constructor for the CustomerDetailResponse class"""

        # Initialize members of the class
        if account_id is not APIHelper.SKIP:
            self.account_id = account_id 
        if account_name is not APIHelper.SKIP:
            self.account_name = account_name 
        if account_number is not APIHelper.SKIP:
            self.account_number = account_number 
        if account_short_name is not APIHelper.SKIP:
            self.account_short_name = account_short_name 
        if account_trading_name is not APIHelper.SKIP:
            self.account_trading_name = account_trading_name 
        if allow_fleet_id_input is not APIHelper.SKIP:
            self.allow_fleet_id_input = allow_fleet_id_input 
        if band is not APIHelper.SKIP:
            self.band = band 
        if billing_address is not APIHelper.SKIP:
            self.billing_address = billing_address 
        if card_group_position is not APIHelper.SKIP:
            self.card_group_position = card_group_position 
        if correspondence_address is not APIHelper.SKIP:
            self.correspondence_address = correspondence_address 
        if delivery_addresses is not APIHelper.SKIP:
            self.delivery_addresses = delivery_addresses 
        if fleet_pin is not APIHelper.SKIP:
            self.fleet_pin = fleet_pin 
        if full_name is not APIHelper.SKIP:
            self.full_name = full_name 
        if invoice_customer_id is not APIHelper.SKIP:
            self.invoice_customer_id = invoice_customer_id 
        if invoice_customer_short_name is not APIHelper.SKIP:
            self.invoice_customer_short_name = invoice_customer_short_name 
        if is_invoice_point is not APIHelper.SKIP:
            self.is_invoice_point = is_invoice_point 
        if marketing_segmentation is not APIHelper.SKIP:
            self.marketing_segmentation = marketing_segmentation 
        if vat_number is not APIHelper.SKIP:
            self.vat_number = vat_number 
        if payer_id is not APIHelper.SKIP:
            self.payer_id = payer_id 
        if payer_name is not APIHelper.SKIP:
            self.payer_name = payer_name 
        if payer_number is not APIHelper.SKIP:
            self.payer_number = payer_number 
        if self_selected_pin is not APIHelper.SKIP:
            self.self_selected_pin = self_selected_pin 
        if status is not APIHelper.SKIP:
            self.status = status 
        if default_pin_advice_type is not APIHelper.SKIP:
            self.default_pin_advice_type = default_pin_advice_type 
        if pin_advice_types is not APIHelper.SKIP:
            self.pin_advice_types = pin_advice_types 
        if error is not APIHelper.SKIP:
            self.error = error 
        if request_id is not APIHelper.SKIP:
            self.request_id = request_id 
        if pin_change_allowed_by_cardholder is not APIHelper.SKIP:
            self.pin_change_allowed_by_cardholder = pin_change_allowed_by_cardholder 
        if pin_change_allowed_from_fleet_pin is not APIHelper.SKIP:
            self.pin_change_allowed_from_fleet_pin = pin_change_allowed_from_fleet_pin 

    @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
        account_id = dictionary.get("AccountId") if "AccountId" in dictionary.keys() else APIHelper.SKIP
        account_name = dictionary.get("AccountName") if "AccountName" in dictionary.keys() else APIHelper.SKIP
        account_number = dictionary.get("AccountNumber") if "AccountNumber" in dictionary.keys() else APIHelper.SKIP
        account_short_name = dictionary.get("AccountShortName") if "AccountShortName" in dictionary.keys() else APIHelper.SKIP
        account_trading_name = dictionary.get("AccountTradingName") if "AccountTradingName" in dictionary.keys() else APIHelper.SKIP
        allow_fleet_id_input = dictionary.get("AllowFleetIdInput") if "AllowFleetIdInput" in dictionary.keys() else APIHelper.SKIP
        band = dictionary.get("Band") if "Band" in dictionary.keys() else APIHelper.SKIP
        billing_address = Address.from_dictionary(dictionary.get('BillingAddress')) if 'BillingAddress' in dictionary.keys() else APIHelper.SKIP
        card_group_position = dictionary.get("CardGroupPosition") if "CardGroupPosition" in dictionary.keys() else APIHelper.SKIP
        correspondence_address = Address.from_dictionary(dictionary.get('CorrespondenceAddress')) if 'CorrespondenceAddress' in dictionary.keys() else APIHelper.SKIP
        delivery_addresses = None
        if dictionary.get('DeliveryAddresses') is not None:
            delivery_addresses = [DeliveryAddresses.from_dictionary(x) for x in dictionary.get('DeliveryAddresses')]
        else:
            delivery_addresses = APIHelper.SKIP
        fleet_pin = dictionary.get("FleetPin") if "FleetPin" in dictionary.keys() else APIHelper.SKIP
        full_name = dictionary.get("FullName") if "FullName" in dictionary.keys() else APIHelper.SKIP
        invoice_customer_id = dictionary.get("InvoiceCustomerId") if "InvoiceCustomerId" in dictionary.keys() else APIHelper.SKIP
        invoice_customer_short_name = dictionary.get("InvoiceCustomerShortName") if "InvoiceCustomerShortName" in dictionary.keys() else APIHelper.SKIP
        is_invoice_point = dictionary.get("IsInvoicePoint") if "IsInvoicePoint" in dictionary.keys() else APIHelper.SKIP
        marketing_segmentation = dictionary.get("MarketingSegmentation") if "MarketingSegmentation" in dictionary.keys() else APIHelper.SKIP
        vat_number = dictionary.get("VATNumber") if "VATNumber" in dictionary.keys() else APIHelper.SKIP
        payer_id = dictionary.get("PayerId") if "PayerId" in dictionary.keys() else APIHelper.SKIP
        payer_name = dictionary.get("PayerName") if "PayerName" in dictionary.keys() else APIHelper.SKIP
        payer_number = dictionary.get("PayerNumber") if "PayerNumber" in dictionary.keys() else APIHelper.SKIP
        self_selected_pin = dictionary.get("SelfSelectedPin") if "SelfSelectedPin" in dictionary.keys() else APIHelper.SKIP
        status = dictionary.get("Status") if "Status" in dictionary.keys() else APIHelper.SKIP
        default_pin_advice_type = dictionary.get("DefaultPINAdviceType") if "DefaultPINAdviceType" in dictionary.keys() else APIHelper.SKIP
        pin_advice_types = None
        if dictionary.get('PINAdviceTypes') is not None:
            pin_advice_types = [PINAdviceTypes.from_dictionary(x) for x in dictionary.get('PINAdviceTypes')]
        else:
            pin_advice_types = APIHelper.SKIP
        error = ErrorStatus.from_dictionary(dictionary.get('Error')) if 'Error' in dictionary.keys() else APIHelper.SKIP
        request_id = dictionary.get("RequestId") if "RequestId" in dictionary.keys() else APIHelper.SKIP
        pin_change_allowed_by_cardholder = dictionary.get("PINChangeAllowedByCardholder") if "PINChangeAllowedByCardholder" in dictionary.keys() else APIHelper.SKIP
        pin_change_allowed_from_fleet_pin = dictionary.get("PINChangeAllowedFromFleetPIN") if "PINChangeAllowedFromFleetPIN" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(account_id,
                   account_name,
                   account_number,
                   account_short_name,
                   account_trading_name,
                   allow_fleet_id_input,
                   band,
                   billing_address,
                   card_group_position,
                   correspondence_address,
                   delivery_addresses,
                   fleet_pin,
                   full_name,
                   invoice_customer_id,
                   invoice_customer_short_name,
                   is_invoice_point,
                   marketing_segmentation,
                   vat_number,
                   payer_id,
                   payer_name,
                   payer_number,
                   self_selected_pin,
                   status,
                   default_pin_advice_type,
                   pin_advice_types,
                   error,
                   request_id,
                   pin_change_allowed_by_cardholder,
                   pin_change_allowed_from_fleet_pin)
