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

"""
shelldatareportingapis

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


class DeliveryAddresses(object):

    """Implementation of the 'DeliveryAddresses' model.

    TODO: type model description here.

    Attributes:
        address_id (int): Address Id
        address_line_1 (str): AddressLine1
        address_line_2 (str): AddressLine2
        address_line_3 (str): AddressLine3
        city (str): City
        company_name (str): Account Name
        contact_fore_name (str): Contact fore name of the delivery address.
        contact_last_name (str): Contact last name of the delivery address.
        contact_middle_name (str): Contact middle name of the delivery address.
        contact_title (str): ContactTitle
        country (str): Country
        country_id (int): Country Id
        country_iso_code (str): Country ISO code
        fax (str): Fax number of the address contact.
        region (str): Region of the Card Delivery address
        region_id (int): Region Id of the address.
        telephone (str): Telephone number of the address contact
        zip_code (str): Delivery Zip code
        address_type (int): Delivery address type. Possible Values: 1 – Card
            and PIN delivery address 2 – Card delivery address 3 – PIN
            delivery address

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "address_id": 'AddressId',
        "address_line_1": 'AddressLine1',
        "address_line_2": 'AddressLine2',
        "address_line_3": 'AddressLine3',
        "city": 'City',
        "company_name": 'CompanyName',
        "contact_fore_name": 'ContactForeName',
        "contact_last_name": 'ContactLastName',
        "contact_middle_name": 'ContactMiddleName',
        "contact_title": 'ContactTitle',
        "country": 'Country',
        "country_id": 'CountryId',
        "country_iso_code": 'CountryISOCode',
        "fax": 'Fax',
        "region": 'Region',
        "region_id": 'RegionId',
        "telephone": 'Telephone',
        "zip_code": 'ZipCode',
        "address_type": 'AddressType'
    }

    _optionals = [
        'address_id',
        'address_line_1',
        'address_line_2',
        'address_line_3',
        'city',
        'company_name',
        'contact_fore_name',
        'contact_last_name',
        'contact_middle_name',
        'contact_title',
        'country',
        'country_id',
        'country_iso_code',
        'fax',
        'region',
        'region_id',
        'telephone',
        'zip_code',
        'address_type',
    ]

    _nullables = [
        'address_id',
        'address_line_1',
        'address_line_2',
        'address_line_3',
        'city',
        'company_name',
        'contact_fore_name',
        'contact_last_name',
        'contact_middle_name',
        'contact_title',
        'country',
        'country_id',
        'country_iso_code',
        'fax',
        'region',
        'region_id',
        'telephone',
        'zip_code',
        'address_type',
    ]

    def __init__(self,
                 address_id=APIHelper.SKIP,
                 address_line_1=APIHelper.SKIP,
                 address_line_2=APIHelper.SKIP,
                 address_line_3=APIHelper.SKIP,
                 city=APIHelper.SKIP,
                 company_name=APIHelper.SKIP,
                 contact_fore_name=APIHelper.SKIP,
                 contact_last_name=APIHelper.SKIP,
                 contact_middle_name=APIHelper.SKIP,
                 contact_title=APIHelper.SKIP,
                 country=APIHelper.SKIP,
                 country_id=APIHelper.SKIP,
                 country_iso_code=APIHelper.SKIP,
                 fax=APIHelper.SKIP,
                 region=APIHelper.SKIP,
                 region_id=APIHelper.SKIP,
                 telephone=APIHelper.SKIP,
                 zip_code=APIHelper.SKIP,
                 address_type=APIHelper.SKIP):
        """Constructor for the DeliveryAddresses class"""

        # Initialize members of the class
        if address_id is not APIHelper.SKIP:
            self.address_id = address_id 
        if address_line_1 is not APIHelper.SKIP:
            self.address_line_1 = address_line_1 
        if address_line_2 is not APIHelper.SKIP:
            self.address_line_2 = address_line_2 
        if address_line_3 is not APIHelper.SKIP:
            self.address_line_3 = address_line_3 
        if city is not APIHelper.SKIP:
            self.city = city 
        if company_name is not APIHelper.SKIP:
            self.company_name = company_name 
        if contact_fore_name is not APIHelper.SKIP:
            self.contact_fore_name = contact_fore_name 
        if contact_last_name is not APIHelper.SKIP:
            self.contact_last_name = contact_last_name 
        if contact_middle_name is not APIHelper.SKIP:
            self.contact_middle_name = contact_middle_name 
        if contact_title is not APIHelper.SKIP:
            self.contact_title = contact_title 
        if country is not APIHelper.SKIP:
            self.country = country 
        if country_id is not APIHelper.SKIP:
            self.country_id = country_id 
        if country_iso_code is not APIHelper.SKIP:
            self.country_iso_code = country_iso_code 
        if fax is not APIHelper.SKIP:
            self.fax = fax 
        if region is not APIHelper.SKIP:
            self.region = region 
        if region_id is not APIHelper.SKIP:
            self.region_id = region_id 
        if telephone is not APIHelper.SKIP:
            self.telephone = telephone 
        if zip_code is not APIHelper.SKIP:
            self.zip_code = zip_code 
        if address_type is not APIHelper.SKIP:
            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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        address_id = dictionary.get("AddressId") if "AddressId" in dictionary.keys() else APIHelper.SKIP
        address_line_1 = dictionary.get("AddressLine1") if "AddressLine1" in dictionary.keys() else APIHelper.SKIP
        address_line_2 = dictionary.get("AddressLine2") if "AddressLine2" in dictionary.keys() else APIHelper.SKIP
        address_line_3 = dictionary.get("AddressLine3") if "AddressLine3" in dictionary.keys() else APIHelper.SKIP
        city = dictionary.get("City") if "City" in dictionary.keys() else APIHelper.SKIP
        company_name = dictionary.get("CompanyName") if "CompanyName" in dictionary.keys() else APIHelper.SKIP
        contact_fore_name = dictionary.get("ContactForeName") if "ContactForeName" in dictionary.keys() else APIHelper.SKIP
        contact_last_name = dictionary.get("ContactLastName") if "ContactLastName" in dictionary.keys() else APIHelper.SKIP
        contact_middle_name = dictionary.get("ContactMiddleName") if "ContactMiddleName" in dictionary.keys() else APIHelper.SKIP
        contact_title = dictionary.get("ContactTitle") if "ContactTitle" in dictionary.keys() else APIHelper.SKIP
        country = dictionary.get("Country") if "Country" in dictionary.keys() else APIHelper.SKIP
        country_id = dictionary.get("CountryId") if "CountryId" in dictionary.keys() else APIHelper.SKIP
        country_iso_code = dictionary.get("CountryISOCode") if "CountryISOCode" in dictionary.keys() else APIHelper.SKIP
        fax = dictionary.get("Fax") if "Fax" in dictionary.keys() else APIHelper.SKIP
        region = dictionary.get("Region") if "Region" in dictionary.keys() else APIHelper.SKIP
        region_id = dictionary.get("RegionId") if "RegionId" in dictionary.keys() else APIHelper.SKIP
        telephone = dictionary.get("Telephone") if "Telephone" in dictionary.keys() else APIHelper.SKIP
        zip_code = dictionary.get("ZipCode") if "ZipCode" in dictionary.keys() else APIHelper.SKIP
        address_type = dictionary.get("AddressType") if "AddressType" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(address_id,
                   address_line_1,
                   address_line_2,
                   address_line_3,
                   city,
                   company_name,
                   contact_fore_name,
                   contact_last_name,
                   contact_middle_name,
                   contact_title,
                   country,
                   country_id,
                   country_iso_code,
                   fax,
                   region,
                   region_id,
                   telephone,
                   zip_code,
                   address_type)
