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

"""
    apimaticcalculatorlatest

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

import apimaticcalculatorlatest.models.company_details
import apimaticcalculatorlatest.models.policies
import apimaticcalculatorlatest.models.payment

class Company(object):

    """Implementation of the 'Company' model.

    Company model

    Attributes:
        company_details (CompanyDetails): TODO: type description here.
        policies (Policies): TODO: type description here.
        payment (Payment): TODO: type description here.
        id (int): Supplier id. Not expected in any requests. Will be only in
            responses.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "company_details":'companyDetails',
        "policies":'policies',
        "payment":'payment',
        "id":'id'
    }

    def __init__(self,
                 company_details=None,
                 policies=None,
                 payment=None,
                 id=None):
        """Constructor for the Company class"""

        # Initialize members of the class
        self.company_details = company_details
        self.policies = policies
        self.payment = payment
        self.id = id


    @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
        company_details = apimaticcalculatorlatest.models.company_details.CompanyDetails.from_dictionary(dictionary.get('companyDetails')) if dictionary.get('companyDetails') else None
        policies = apimaticcalculatorlatest.models.policies.Policies.from_dictionary(dictionary.get('policies')) if dictionary.get('policies') else None
        payment = apimaticcalculatorlatest.models.payment.Payment.from_dictionary(dictionary.get('payment')) if dictionary.get('payment') else None
        id = dictionary.get('id')

        # Return an object of this model
        return cls(company_details,
                   policies,
                   payment,
                   id)


