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

"""
pqapiv2

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


class Address(object):

    """Implementation of the '_address' model.

    Classifies the mailing address

    Attributes:
        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>)

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "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'
    }

    def __init__(self,
                 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):
        """Constructor for the Address class"""

        # Initialize members of the class
        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

    @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
        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')

        # Return an object of this model
        return cls(address_line_1,
                   address_line_2,
                   address_line_3,
                   address_line_4,
                   address_line_5,
                   city,
                   region,
                   country,
                   postal_code,
                   premise_number,
                   address_type)
