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

"""
cookiesapi

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


class Address(object):

    """Implementation of the 'Address' model.

    Specifies a street address.

    Attributes:
        region_code (string): ISO country code (3-character).
        postal_code (string): Regional postal code or zip code.
        administrative_area (string): State or province, as a two-letter ISO
            or national code.
        locality (string): City, village, or municipality name.
        address_lines (list of string): Lines for the address itself.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "region_code": 'regionCode',
        "postal_code": 'postalCode',
        "administrative_area": 'administrativeArea',
        "locality": 'locality',
        "address_lines": 'addressLines'
    }

    def __init__(self,
                 region_code=None,
                 postal_code=None,
                 administrative_area=None,
                 locality=None,
                 address_lines=None):
        """Constructor for the Address class"""

        # Initialize members of the class
        self.region_code = region_code
        self.postal_code = postal_code
        self.administrative_area = administrative_area
        self.locality = locality
        self.address_lines = address_lines

    @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
        region_code = dictionary.get('regionCode')
        postal_code = dictionary.get('postalCode')
        administrative_area = dictionary.get('administrativeArea')
        locality = dictionary.get('locality')
        address_lines = dictionary.get('addressLines')

        # Return an object of this model
        return cls(region_code,
                   postal_code,
                   administrative_area,
                   locality,
                   address_lines)
