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

"""
pqapiv2

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
import dateutil.parser

from pqapiv2.api_helper import APIHelper


class User(object):

    """Implementation of the 'user' model.

    Object for user

    Attributes:
        first_name (string): User's first name. <i>Required</i> if the user is
            registered as an individual.
        last_name (string): User's last name. <i>Required</i> if the user is
            registered as an individual.
        date_of_birth (date): User's date of birth
        business_name (string): Legal name for the business
        business_operating_name (string): Name under which the business
            operates
        business_registration_id (string): Registration number or ID assigned
            by a government body
        business_registration_region (string): State, province, or territory
            where the business is registered
        business_registration_country (CountryTypesEnum): Two-digit country
            code types
        business_contact_role (BusinessContactRoleEnum): Role of the user
            within the business
        business_address_line_1 (string): First line of the business address
            that specifies street number, street name, and building name
        business_address_line_2 (string): Second line of the business address
            that specifies the apartment, suite, or space number (or any other
            designation not literally part of the physical address)
        business_address_line_3 (string): Third line of the business address
            that specifies the international or business addresses that do not
            fit on businessAddressLine3
        business_address_line_4 (string): fourth line of the business address
            street address
        business_address_line_5 (string): Fifth line of the business address
            street address
        business_city (string): City the business is registered
        business_region (string): State, province, or region the business is
            registered
        business_country (CountryTypesEnum): Two-digit country code types
        business_postal_code (string): Postal code for the business address
        business_premise_number (string): House number for the business
            address
        business_type (BusinessTypesEnum): Type of business
            (<i>Corporation</i> or <i>Partnership</i>)
        driver_license_id (string): User's driver's license number
        passport_id (string): User's passport number
        government_id_type (GovernmentIdTypeEnum): User's government ID type
        government_id (string): User's government ID number, such as a
            <i>SSN</i>, <i>EIN</i>, or <i>SIN</i>
        phone_number (string): The E.164 formatted primary phone number. This
            can be the same as the mobile number.
        mobile_number (string): The E.164 formatted mobile phone number,
            required by most financial institutions for account creation,
            verification, or PSD2 (3DS). Mobile numbers must be unique to a
            user within a tenant and cannot be shared.
        phone_number_country (CountryTypesEnum): Two-digit country code types
        mobile_number_country (CountryTypesEnum): Two-digit country code
            types
        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>)
        email (string): Email address for the user account
        employer_id (string): User's employer identifier
        gender (GenderTypesEnum): Gender as a user identifies
        user_type (UserTypesEnum): Account holder's profile type
        program_user_id (string): Program identifier for the user
        language (LanguageTypesEnum): Language type in IETF's BCP 47 format
        country_of_birth (CountryTypesEnum): Two-digit country code types
        country_of_nationality (CountryTypesEnum): Two-digit country code
            types
        occupation (OccupationTypesEnum): Type of occupation for the user
        tax_resident_status (TaxResidentStatusTypesEnum): Tax resident status
            type of a country
        currency (CurrencyTypesEnum): Currency code type for the object
        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 (UserStatusTypesEnum): Current status of the user
        created_on (datetime): Time at which the object was created.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "phone_number": 'phoneNumber',
        "mobile_number": 'mobileNumber',
        "phone_number_country": 'phoneNumberCountry',
        "mobile_number_country": 'mobileNumberCountry',
        "first_name": 'firstName',
        "last_name": 'lastName',
        "date_of_birth": 'dateOfBirth',
        "business_name": 'businessName',
        "business_operating_name": 'businessOperatingName',
        "business_registration_id": 'businessRegistrationId',
        "business_registration_region": 'businessRegistrationRegion',
        "business_registration_country": 'businessRegistrationCountry',
        "business_contact_role": 'businessContactRole',
        "business_address_line_1": 'businessAddressLine1',
        "business_address_line_2": 'businessAddressLine2',
        "business_address_line_3": 'businessAddressLine3',
        "business_address_line_4": 'businessAddressLine4',
        "business_address_line_5": 'businessAddressLine5',
        "business_city": 'businessCity',
        "business_region": 'businessRegion',
        "business_country": 'businessCountry',
        "business_postal_code": 'businessPostalCode',
        "business_premise_number": 'businessPremiseNumber',
        "business_type": 'businessType',
        "driver_license_id": 'driverLicenseId',
        "passport_id": 'passportId',
        "government_id_type": 'governmentIdType',
        "government_id": 'governmentId',
        "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',
        "email": 'email',
        "employer_id": 'employerId',
        "gender": 'gender',
        "user_type": 'userType',
        "program_user_id": 'programUserId',
        "language": 'language',
        "country_of_birth": 'countryOfBirth',
        "country_of_nationality": 'countryOfNationality',
        "occupation": 'occupation',
        "tax_resident_status": 'taxResidentStatus',
        "currency": 'currency',
        "token": 'token',
        "status": 'status',
        "created_on": 'createdOn'
    }

    def __init__(self,
                 phone_number=None,
                 mobile_number=None,
                 phone_number_country=None,
                 mobile_number_country=None,
                 first_name=None,
                 last_name=None,
                 date_of_birth=None,
                 business_name=None,
                 business_operating_name=None,
                 business_registration_id=None,
                 business_registration_region=None,
                 business_registration_country=None,
                 business_contact_role=None,
                 business_address_line_1=None,
                 business_address_line_2=None,
                 business_address_line_3=None,
                 business_address_line_4=None,
                 business_address_line_5=None,
                 business_city=None,
                 business_region=None,
                 business_country=None,
                 business_postal_code=None,
                 business_premise_number=None,
                 business_type=None,
                 driver_license_id=None,
                 passport_id=None,
                 government_id_type=None,
                 government_id=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,
                 email=None,
                 employer_id=None,
                 gender=None,
                 user_type=None,
                 program_user_id=None,
                 language=None,
                 country_of_birth=None,
                 country_of_nationality=None,
                 occupation=None,
                 tax_resident_status=None,
                 currency=None,
                 token=None,
                 status=None,
                 created_on=None):
        """Constructor for the User class"""

        # Initialize members of the class
        self.first_name = first_name
        self.last_name = last_name
        self.date_of_birth = date_of_birth
        self.business_name = business_name
        self.business_operating_name = business_operating_name
        self.business_registration_id = business_registration_id
        self.business_registration_region = business_registration_region
        self.business_registration_country = business_registration_country
        self.business_contact_role = business_contact_role
        self.business_address_line_1 = business_address_line_1
        self.business_address_line_2 = business_address_line_2
        self.business_address_line_3 = business_address_line_3
        self.business_address_line_4 = business_address_line_4
        self.business_address_line_5 = business_address_line_5
        self.business_city = business_city
        self.business_region = business_region
        self.business_country = business_country
        self.business_postal_code = business_postal_code
        self.business_premise_number = business_premise_number
        self.business_type = business_type
        self.driver_license_id = driver_license_id
        self.passport_id = passport_id
        self.government_id_type = government_id_type
        self.government_id = government_id
        self.phone_number = phone_number
        self.mobile_number = mobile_number
        self.phone_number_country = phone_number_country
        self.mobile_number_country = mobile_number_country
        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.email = email
        self.employer_id = employer_id
        self.gender = gender
        self.user_type = user_type
        self.program_user_id = program_user_id
        self.language = language
        self.country_of_birth = country_of_birth
        self.country_of_nationality = country_of_nationality
        self.occupation = occupation
        self.tax_resident_status = tax_resident_status
        self.currency = currency
        self.token = token
        self.status = status
        self.created_on = APIHelper.RFC3339DateTime(created_on) if created_on else None

    @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
        phone_number = dictionary.get('phoneNumber')
        mobile_number = dictionary.get('mobileNumber')
        phone_number_country = dictionary.get('phoneNumberCountry')
        mobile_number_country = dictionary.get('mobileNumberCountry')
        first_name = dictionary.get('firstName')
        last_name = dictionary.get('lastName')
        date_of_birth = dateutil.parser.parse(dictionary.get('dateOfBirth')).date() if dictionary.get('dateOfBirth') else None
        business_name = dictionary.get('businessName')
        business_operating_name = dictionary.get('businessOperatingName')
        business_registration_id = dictionary.get('businessRegistrationId')
        business_registration_region = dictionary.get('businessRegistrationRegion')
        business_registration_country = dictionary.get('businessRegistrationCountry')
        business_contact_role = dictionary.get('businessContactRole')
        business_address_line_1 = dictionary.get('businessAddressLine1')
        business_address_line_2 = dictionary.get('businessAddressLine2')
        business_address_line_3 = dictionary.get('businessAddressLine3')
        business_address_line_4 = dictionary.get('businessAddressLine4')
        business_address_line_5 = dictionary.get('businessAddressLine5')
        business_city = dictionary.get('businessCity')
        business_region = dictionary.get('businessRegion')
        business_country = dictionary.get('businessCountry')
        business_postal_code = dictionary.get('businessPostalCode')
        business_premise_number = dictionary.get('businessPremiseNumber')
        business_type = dictionary.get('businessType')
        driver_license_id = dictionary.get('driverLicenseId')
        passport_id = dictionary.get('passportId')
        government_id_type = dictionary.get('governmentIdType')
        government_id = dictionary.get('governmentId')
        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')
        email = dictionary.get('email')
        employer_id = dictionary.get('employerId')
        gender = dictionary.get('gender')
        user_type = dictionary.get('userType')
        program_user_id = dictionary.get('programUserId')
        language = dictionary.get('language')
        country_of_birth = dictionary.get('countryOfBirth')
        country_of_nationality = dictionary.get('countryOfNationality')
        occupation = dictionary.get('occupation')
        tax_resident_status = dictionary.get('taxResidentStatus')
        currency = dictionary.get('currency')
        token = dictionary.get('token')
        status = dictionary.get('status')
        created_on = APIHelper.RFC3339DateTime.from_value(dictionary.get("createdOn")).datetime if dictionary.get("createdOn") else None

        # Return an object of this model
        return cls(phone_number,
                   mobile_number,
                   phone_number_country,
                   mobile_number_country,
                   first_name,
                   last_name,
                   date_of_birth,
                   business_name,
                   business_operating_name,
                   business_registration_id,
                   business_registration_region,
                   business_registration_country,
                   business_contact_role,
                   business_address_line_1,
                   business_address_line_2,
                   business_address_line_3,
                   business_address_line_4,
                   business_address_line_5,
                   business_city,
                   business_region,
                   business_country,
                   business_postal_code,
                   business_premise_number,
                   business_type,
                   driver_license_id,
                   passport_id,
                   government_id_type,
                   government_id,
                   address_line_1,
                   address_line_2,
                   address_line_3,
                   address_line_4,
                   address_line_5,
                   city,
                   region,
                   country,
                   postal_code,
                   premise_number,
                   address_type,
                   email,
                   employer_id,
                   gender,
                   user_type,
                   program_user_id,
                   language,
                   country_of_birth,
                   country_of_nationality,
                   occupation,
                   tax_resident_status,
                   currency,
                   token,
                   status,
                   created_on)
