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

"""
pqapiv2

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


class PrepaidCard(object):

    """Implementation of the 'prepaidCard' model.

    TODO: type model description here.

    Attributes:
        token (string): Token representing the resource, prefixed with
            <i>user-</i>, <i>dest-</i>, <i>xfer-</i>, <i>acct-</i>,
            <i>pmnt-</i>, or <i>docu-</i>.
        status (StatusEnum): Current status of the prepaid card
        created_on (datetime): Time at which the object was created.
        country (CountryTypesEnum): Two-digit country code types
        currency (CurrencyTypesEnum): Currency code type for the object
        card_personalization (PrepaidCardPersonalizationTypesEnum): Specifies
            a card is <i>Personalized</i> or <i>Non-personalized</i> (i.e.,
            issued to Preferred Customer)
        card_package (string): Package for the card being displayed
            (<i>Virtual<,i>) or <i>Produced (physical)</i>
        card_network (CardNetworkTypesEnum): Major credit card network types
        expires (datetime): Quote expiration, ISO-8601 format, UTC by default
            unless overridden.
        card_number (string): Masked card number with only the first 6 and
            last 4 digits visible
        cvv (string): Card Verification Value (CVV) on the credit card or
            debit card. (3-digit number on VISA®, MasterCard® branded credit
            and debit cards)

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "country": 'country',
        "token": 'token',
        "status": 'status',
        "created_on": 'createdOn',
        "currency": 'currency',
        "card_personalization": 'cardPersonalization',
        "card_package": 'cardPackage',
        "card_network": 'cardNetwork',
        "expires": 'expires',
        "card_number": 'cardNumber',
        "cvv": 'cvv'
    }

    def __init__(self,
                 country=None,
                 token=None,
                 status=None,
                 created_on=None,
                 currency=None,
                 card_personalization=None,
                 card_package=None,
                 card_network=None,
                 expires=None,
                 card_number=None,
                 cvv=None):
        """Constructor for the PrepaidCard class"""

        # Initialize members of the class
        self.token = token
        self.status = status
        self.created_on = APIHelper.RFC3339DateTime(created_on) if created_on else None
        self.country = country
        self.currency = currency
        self.card_personalization = card_personalization
        self.card_package = card_package
        self.card_network = card_network
        self.expires = APIHelper.RFC3339DateTime(expires) if expires else None
        self.card_number = card_number
        self.cvv = cvv

    @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 dictionary is None:
            return None

        # Extract variables from the dictionary
        country = dictionary.get('country')
        token = dictionary.get('token')
        status = dictionary.get('status')
        created_on = APIHelper.RFC3339DateTime.from_value(dictionary.get("createdOn")).datetime if dictionary.get("createdOn") else None
        currency = dictionary.get('currency')
        card_personalization = dictionary.get('cardPersonalization')
        card_package = dictionary.get('cardPackage')
        card_network = dictionary.get('cardNetwork')
        expires = APIHelper.RFC3339DateTime.from_value(dictionary.get("expires")).datetime if dictionary.get("expires") else None
        card_number = dictionary.get('cardNumber')
        cvv = dictionary.get('cvv')

        # Return an object of this model
        return cls(country,
                   token,
                   status,
                   created_on,
                   currency,
                   card_personalization,
                   card_package,
                   card_network,
                   expires,
                   card_number,
                   cvv)
