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

"""
    apimaticcalculatorlatest

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

import apimaticcalculatorlatest.models.company_address
import apimaticcalculatorlatest.models.phone

class CompanyDetails(object):

    """Implementation of the 'CompanyDetails' model.

    TODO: type model description here.

    Attributes:
        account_id (string): Unique ID of PM in PMS
        company_name (string): Name of PM
        language (string): Language 2 letter value  as ISO 639-1 code
        full_name (string): First and Last Name
        company_address (CompanyAddress): TODO: type description here.
        website (string): Company (PM) website URL
        email (string): Email of PM. Email need to be unique in BP system, so
            you might receive error if we already have this email in our
            system
        phone (Phone): TODO: type description here.
        password (string): Password for accessing PM. If the password is not
            passed in the request random password will be generated and
            returned in response. Password will be in response only on create
            and if it is manually generated. Special characters are not
            allowed, instead use UTF-8 codes, for example instead of # use
            %23
        currency (string): PM default currency. ISO 4217 code is required

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "account_id":'accountId',
        "company_name":'companyName',
        "language":'language',
        "full_name":'fullName',
        "company_address":'companyAddress',
        "website":'website',
        "email":'email',
        "phone":'phone',
        "currency":'currency',
        "password":'password'
    }

    def __init__(self,
                 account_id=None,
                 company_name=None,
                 language=None,
                 full_name=None,
                 company_address=None,
                 website=None,
                 email=None,
                 phone=None,
                 currency=None,
                 password=None):
        """Constructor for the CompanyDetails class"""

        # Initialize members of the class
        self.account_id = account_id
        self.company_name = company_name
        self.language = language
        self.full_name = full_name
        self.company_address = company_address
        self.website = website
        self.email = email
        self.phone = phone
        self.password = password
        self.currency = currency


    @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
        account_id = dictionary.get('accountId')
        company_name = dictionary.get('companyName')
        language = dictionary.get('language')
        full_name = dictionary.get('fullName')
        company_address = apimaticcalculatorlatest.models.company_address.CompanyAddress.from_dictionary(dictionary.get('companyAddress')) if dictionary.get('companyAddress') else None
        website = dictionary.get('website')
        email = dictionary.get('email')
        phone = apimaticcalculatorlatest.models.phone.Phone.from_dictionary(dictionary.get('phone')) if dictionary.get('phone') else None
        currency = dictionary.get('currency')
        password = dictionary.get('password')

        # Return an object of this model
        return cls(account_id,
                   company_name,
                   language,
                   full_name,
                   company_address,
                   website,
                   email,
                   phone,
                   currency,
                   password)


