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

"""
    easybimehlanding

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

import easybimehlanding.models.franchisee
import easybimehlanding.models.device_type
import easybimehlanding.models.insurance_company
import easybimehlanding.models.insurance_policy_term
import easybimehlanding.models.province
import easybimehlanding.models.shipping_type
import easybimehlanding.models.post_type
import easybimehlanding.models.insurance_policy_condition
import easybimehlanding.models.insurance_data

class ElectronicEquipmentInsurance(object):

    """Implementation of the 'ElectronicEquipmentInsurance' model.

    اطلاعات پایه ی بیمه ی تجهیزات

    Attributes:
        has_plan (bool): آیا این نوع بیمه نامه، طرح بیمه ای دارد؟
        franchisees (list of Franchisee): لیست فرانشیز های بیمه ی تجهیزات
            الکترونیک
        device_types (list of DeviceType): انواع دستگاه ها
        device_brands (list of string): برند های دستگاه ها
        device_models (list of string): مدل های دستگاه ها
        insurance_companies (list of InsuranceCompany): شرکت های بیمه ی ارائه
            دهنده ی بیمه ی تجهیزات الکترونیک
        insurance_extra_coverage (list of string): پوشش های اضافه
        insurance_policy_terms (list of InsurancePolicyTerm): دوره های بیمه
            نامه
        provinces (list of Province): لیست استان ها
        cities (list of string): لیست شهر ها
        city_regions (list of string): لیست محله ها
        shipping_types (list of ShippingType): روش های دریافت بیمه نامه
        post_types (list of PostType): روش های ارسال بیمه نامه
        insurance_policy_condition (InsurancePolicyCondition): شرایط بیمه
            نامه
        insurance_data (InsuranceData): اطلاعات بیمه نامه

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "has_plan":'hasPlan',
        "franchisees":'franchisees',
        "device_types":'deviceTypes',
        "device_brands":'deviceBrands',
        "device_models":'deviceModels',
        "insurance_companies":'insuranceCompanies',
        "insurance_extra_coverage":'insuranceExtraCoverage',
        "insurance_policy_terms":'insurancePolicyTerms',
        "provinces":'provinces',
        "cities":'cities',
        "city_regions":'cityRegions',
        "shipping_types":'shippingTypes',
        "post_types":'postTypes',
        "insurance_policy_condition":'insurancePolicyCondition',
        "insurance_data":'insuranceData'
    }

    def __init__(self,
                 has_plan=None,
                 franchisees=None,
                 device_types=None,
                 device_brands=None,
                 device_models=None,
                 insurance_companies=None,
                 insurance_extra_coverage=None,
                 insurance_policy_terms=None,
                 provinces=None,
                 cities=None,
                 city_regions=None,
                 shipping_types=None,
                 post_types=None,
                 insurance_policy_condition=None,
                 insurance_data=None):
        """Constructor for the ElectronicEquipmentInsurance class"""

        # Initialize members of the class
        self.has_plan = has_plan
        self.franchisees = franchisees
        self.device_types = device_types
        self.device_brands = device_brands
        self.device_models = device_models
        self.insurance_companies = insurance_companies
        self.insurance_extra_coverage = insurance_extra_coverage
        self.insurance_policy_terms = insurance_policy_terms
        self.provinces = provinces
        self.cities = cities
        self.city_regions = city_regions
        self.shipping_types = shipping_types
        self.post_types = post_types
        self.insurance_policy_condition = insurance_policy_condition
        self.insurance_data = insurance_data


    @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
        has_plan = dictionary.get('hasPlan')
        franchisees = None
        if dictionary.get('franchisees') != None:
            franchisees = list()
            for structure in dictionary.get('franchisees'):
                franchisees.append(easybimehlanding.models.franchisee.Franchisee.from_dictionary(structure))
        device_types = None
        if dictionary.get('deviceTypes') != None:
            device_types = list()
            for structure in dictionary.get('deviceTypes'):
                device_types.append(easybimehlanding.models.device_type.DeviceType.from_dictionary(structure))
        device_brands = dictionary.get('deviceBrands')
        device_models = dictionary.get('deviceModels')
        insurance_companies = None
        if dictionary.get('insuranceCompanies') != None:
            insurance_companies = list()
            for structure in dictionary.get('insuranceCompanies'):
                insurance_companies.append(easybimehlanding.models.insurance_company.InsuranceCompany.from_dictionary(structure))
        insurance_extra_coverage = dictionary.get('insuranceExtraCoverage')
        insurance_policy_terms = None
        if dictionary.get('insurancePolicyTerms') != None:
            insurance_policy_terms = list()
            for structure in dictionary.get('insurancePolicyTerms'):
                insurance_policy_terms.append(easybimehlanding.models.insurance_policy_term.InsurancePolicyTerm.from_dictionary(structure))
        provinces = None
        if dictionary.get('provinces') != None:
            provinces = list()
            for structure in dictionary.get('provinces'):
                provinces.append(easybimehlanding.models.province.Province.from_dictionary(structure))
        cities = dictionary.get('cities')
        city_regions = dictionary.get('cityRegions')
        shipping_types = None
        if dictionary.get('shippingTypes') != None:
            shipping_types = list()
            for structure in dictionary.get('shippingTypes'):
                shipping_types.append(easybimehlanding.models.shipping_type.ShippingType.from_dictionary(structure))
        post_types = None
        if dictionary.get('postTypes') != None:
            post_types = list()
            for structure in dictionary.get('postTypes'):
                post_types.append(easybimehlanding.models.post_type.PostType.from_dictionary(structure))
        insurance_policy_condition = easybimehlanding.models.insurance_policy_condition.InsurancePolicyCondition.from_dictionary(dictionary.get('insurancePolicyCondition')) if dictionary.get('insurancePolicyCondition') else None
        insurance_data = easybimehlanding.models.insurance_data.InsuranceData.from_dictionary(dictionary.get('insuranceData')) if dictionary.get('insuranceData') else None

        # Return an object of this model
        return cls(has_plan,
                   franchisees,
                   device_types,
                   device_brands,
                   device_models,
                   insurance_companies,
                   insurance_extra_coverage,
                   insurance_policy_terms,
                   provinces,
                   cities,
                   city_regions,
                   shipping_types,
                   post_types,
                   insurance_policy_condition,
                   insurance_data)


