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

"""
pqapiv2

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


class PaperCheck(object):

    """Implementation of the 'paperCheck' model.

    Details of the paper check

    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>.
        created_on (datetime): Time at which the object was created.
        mtype (TransferTypesEnum): Transfer type
        amount (float): Amount of the transfer in the specified currency.
        currency (CurrencyTypesEnum): Currency code type for the object
        address_line_1 (string): First line of the address that specifies
            street number, street name, and building name
        address_line_2 (string): Second line of the address that specifies the
            apartment, suite, or space number (or any other designation not
            literally part of the physical address)
        address_line_3 (string): Third line of the address that specifies the
            international or business addresses that do not fit on
            addressLine2
        address_line_4 (string): Fourth line of the address, if any
        address_line_5 (string): Fifth line of the address, if any
        city (string): City or town of the business address
        region (string): State, province, or territory of the business
            address
        country (CountryTypesEnum): Two-digit country code types
        postal_code (string): Series of letters, digits, or both, included in
            a postal address for the purpose of sorting mail
        premise_number (string): House or building number of the business
            address
        address_type (AddressTypesEnum): Classifies the address type
            (<i>Home</i>, <i>Business</i>, <i>Billing</i>, <i>Shipping</i>)
        bank_account_ownership_type (BankAccountOwnershipTypesEnum): Account
            ownership types
        shipping_method (ShippingMethodTypesEnum): Shipping method type for a
            pre-paid card or paper check

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "amount": 'amount',
        "currency": 'currency',
        "token": 'token',
        "created_on": 'createdOn',
        "mtype": 'type',
        "address_line_1": 'addressLine1',
        "address_line_2": 'addressLine2',
        "address_line_3": 'addressLine3',
        "address_line_4": 'addressLine4',
        "address_line_5": 'addressLine5',
        "city": 'city',
        "region": 'region',
        "country": 'country',
        "postal_code": 'postalCode',
        "premise_number": 'premiseNumber',
        "address_type": 'addressType',
        "bank_account_ownership_type": 'bankAccountOwnershipType',
        "shipping_method": 'shippingMethod'
    }

    def __init__(self,
                 amount=None,
                 currency=None,
                 token=None,
                 created_on=None,
                 mtype=None,
                 address_line_1=None,
                 address_line_2=None,
                 address_line_3=None,
                 address_line_4=None,
                 address_line_5=None,
                 city=None,
                 region=None,
                 country=None,
                 postal_code=None,
                 premise_number=None,
                 address_type=None,
                 bank_account_ownership_type=None,
                 shipping_method=None):
        """Constructor for the PaperCheck class"""

        # Initialize members of the class
        self.token = token
        self.created_on = APIHelper.RFC3339DateTime(created_on) if created_on else None
        self.mtype = mtype
        self.amount = amount
        self.currency = currency
        self.address_line_1 = address_line_1
        self.address_line_2 = address_line_2
        self.address_line_3 = address_line_3
        self.address_line_4 = address_line_4
        self.address_line_5 = address_line_5
        self.city = city
        self.region = region
        self.country = country
        self.postal_code = postal_code
        self.premise_number = premise_number
        self.address_type = address_type
        self.bank_account_ownership_type = bank_account_ownership_type
        self.shipping_method = shipping_method

    @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
        amount = dictionary.get('amount')
        currency = dictionary.get('currency')
        token = dictionary.get('token')
        created_on = APIHelper.RFC3339DateTime.from_value(dictionary.get("createdOn")).datetime if dictionary.get("createdOn") else None
        mtype = dictionary.get('type')
        address_line_1 = dictionary.get('addressLine1')
        address_line_2 = dictionary.get('addressLine2')
        address_line_3 = dictionary.get('addressLine3')
        address_line_4 = dictionary.get('addressLine4')
        address_line_5 = dictionary.get('addressLine5')
        city = dictionary.get('city')
        region = dictionary.get('region')
        country = dictionary.get('country')
        postal_code = dictionary.get('postalCode')
        premise_number = dictionary.get('premiseNumber')
        address_type = dictionary.get('addressType')
        bank_account_ownership_type = dictionary.get('bankAccountOwnershipType')
        shipping_method = dictionary.get('shippingMethod')

        # Return an object of this model
        return cls(amount,
                   currency,
                   token,
                   created_on,
                   mtype,
                   address_line_1,
                   address_line_2,
                   address_line_3,
                   address_line_4,
                   address_line_5,
                   city,
                   region,
                   country,
                   postal_code,
                   premise_number,
                   address_type,
                   bank_account_ownership_type,
                   shipping_method)
