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

"""
billbeeapi

This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
from billbeeapi.models.billbee_interfaces_billbee_api_model_article_api_custom_field_value_model import BillbeeInterfacesBillbeeAPIModelArticleApiCustomFieldValueModel
from billbeeapi.models.billbee_interfaces_billbee_api_model_article_category_api_model import BillbeeInterfacesBillbeeAPIModelArticleCategoryApiModel
from billbeeapi.models.billbee_interfaces_billbee_api_model_article_image_relation_api_model import BillbeeInterfacesBillbeeAPIModelArticleImageRelationApiModel
from billbeeapi.models.billbee_interfaces_billbee_api_model_article_source_api_model import BillbeeInterfacesBillbeeAPIModelArticleSourceApiModel
from billbeeapi.models.billbee_interfaces_billbee_api_model_bom_sub_article_api_model import BillbeeInterfacesBillbeeAPIModelBomSubArticleApiModel
from billbeeapi.models.billbee_interfaces_billbee_api_model_stock_article_api_model import BillbeeInterfacesBillbeeAPIModelStockArticleApiModel
from billbeeapi.models.billbee_interfaces_order_multi_language_string import BillbeeInterfacesOrderMultiLanguageString


class BillbeeInterfacesBillbeeAPIModelArticleApiModel(object):

    """Implementation of the 'Billbee.Interfaces.BillbeeAPI.Model.ArticleApiModel' model.

    TODO: type model description here.

    Attributes:
        invoice_text (list of BillbeeInterfacesOrderMultiLanguageString):
            TODO: type description here.
        manufacturer (string): TODO: type description here.
        id (long|int): TODO: type description here.
        title (list of BillbeeInterfacesOrderMultiLanguageString): TODO: type
            description here.
        description (list of BillbeeInterfacesOrderMultiLanguageString): TODO:
            type description here.
        short_description (list of BillbeeInterfacesOrderMultiLanguageString):
            TODO: type description here.
        basic_attributes (list of BillbeeInterfacesOrderMultiLanguageString):
            TODO: type description here.
        images (list of
            BillbeeInterfacesBillbeeAPIModelArticleImageRelationApiModel):
            TODO: type description here.
        vat_index (int): TODO: type description here.
        price (float): TODO: type description here.
        cost_price (float): TODO: type description here.
        vat_1_rate (float): TODO: type description here.
        vat_2_rate (float): TODO: type description here.
        stock_desired (float): TODO: type description here.
        stock_current (float): TODO: type description here.
        stock_warning (float): TODO: type description here.
        sku (string): TODO: type description here.
        ean (string): TODO: type description here.
        materials (list of BillbeeInterfacesOrderMultiLanguageString): TODO:
            type description here.
        tags (list of BillbeeInterfacesOrderMultiLanguageString): TODO: type
            description here.
        sources (list of
            BillbeeInterfacesBillbeeAPIModelArticleSourceApiModel): TODO: type
            description here.
        weight (int): TODO: type description here.
        weight_net (int): TODO: type description here.
        low_stock (bool): TODO: type description here.
        stock_code (string): TODO: type description here.
        stock_reduce_items_per_sale (float): TODO: type description here.
        stocks (list of BillbeeInterfacesBillbeeAPIModelStockArticleApiModel):
            TODO: type description here.
        category_1 (BillbeeInterfacesBillbeeAPIModelArticleCategoryApiModel):
            TODO: type description here.
        category_2 (BillbeeInterfacesBillbeeAPIModelArticleCategoryApiModel):
            TODO: type description here.
        category_3 (BillbeeInterfacesBillbeeAPIModelArticleCategoryApiModel):
            TODO: type description here.
        mtype (int): TODO: type description here.
        unit (int): TODO: type description here.
        units_per_item (float): TODO: type description here.
        sold_amount (float): TODO: type description here.
        sold_sum_gross (float): TODO: type description here.
        sold_sum_net (float): TODO: type description here.
        sold_sum_net_last_30_days (float): TODO: type description here.
        sold_sum_gross_last_30_days (float): TODO: type description here.
        sold_amount_last_30_days (float): TODO: type description here.
        shipping_product_id (int): TODO: type description here.
        is_digital (bool): TODO: type description here.
        is_customizable (bool): TODO: type description here.
        delivery_time (int): TODO: type description here.
        recipient (int): TODO: type description here.
        occasion (int): TODO: type description here.
        country_of_origin (string): TODO: type description here.
        export_description (string): TODO: type description here.
        taric_number (string): TODO: type description here.
        condition (int): TODO: type description here.
        width_cm (float): TODO: type description here.
        length_cm (float): TODO: type description here.
        height_cm (float): TODO: type description here.
        bill_of_material (list of
            BillbeeInterfacesBillbeeAPIModelBomSubArticleApiModel): TODO: type
            description here.
        custom_fields (list of
            BillbeeInterfacesBillbeeAPIModelArticleApiCustomFieldValueModel):
            TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "vat_index": 'VatIndex',
        "price": 'Price',
        "vat_1_rate": 'Vat1Rate',
        "vat_2_rate": 'Vat2Rate',
        "mtype": 'Type',
        "is_digital": 'IsDigital',
        "is_customizable": 'IsCustomizable',
        "invoice_text": 'InvoiceText',
        "manufacturer": 'Manufacturer',
        "id": 'Id',
        "title": 'Title',
        "description": 'Description',
        "short_description": 'ShortDescription',
        "basic_attributes": 'BasicAttributes',
        "images": 'Images',
        "cost_price": 'CostPrice',
        "stock_desired": 'StockDesired',
        "stock_current": 'StockCurrent',
        "stock_warning": 'StockWarning',
        "sku": 'SKU',
        "ean": 'EAN',
        "materials": 'Materials',
        "tags": 'Tags',
        "sources": 'Sources',
        "weight": 'Weight',
        "weight_net": 'WeightNet',
        "low_stock": 'LowStock',
        "stock_code": 'StockCode',
        "stock_reduce_items_per_sale": 'StockReduceItemsPerSale',
        "stocks": 'Stocks',
        "category_1": 'Category1',
        "category_2": 'Category2',
        "category_3": 'Category3',
        "unit": 'Unit',
        "units_per_item": 'UnitsPerItem',
        "sold_amount": 'SoldAmount',
        "sold_sum_gross": 'SoldSumGross',
        "sold_sum_net": 'SoldSumNet',
        "sold_sum_net_last_30_days": 'SoldSumNetLast30Days',
        "sold_sum_gross_last_30_days": 'SoldSumGrossLast30Days',
        "sold_amount_last_30_days": 'SoldAmountLast30Days',
        "shipping_product_id": 'ShippingProductId',
        "delivery_time": 'DeliveryTime',
        "recipient": 'Recipient',
        "occasion": 'Occasion',
        "country_of_origin": 'CountryOfOrigin',
        "export_description": 'ExportDescription',
        "taric_number": 'TaricNumber',
        "condition": 'Condition',
        "width_cm": 'WidthCm',
        "length_cm": 'LengthCm',
        "height_cm": 'HeightCm',
        "bill_of_material": 'BillOfMaterial',
        "custom_fields": 'CustomFields'
    }

    def __init__(self,
                 vat_index=None,
                 price=None,
                 vat_1_rate=None,
                 vat_2_rate=None,
                 mtype=None,
                 is_digital=None,
                 is_customizable=None,
                 invoice_text=None,
                 manufacturer=None,
                 id=None,
                 title=None,
                 description=None,
                 short_description=None,
                 basic_attributes=None,
                 images=None,
                 cost_price=None,
                 stock_desired=None,
                 stock_current=None,
                 stock_warning=None,
                 sku=None,
                 ean=None,
                 materials=None,
                 tags=None,
                 sources=None,
                 weight=None,
                 weight_net=None,
                 low_stock=None,
                 stock_code=None,
                 stock_reduce_items_per_sale=None,
                 stocks=None,
                 category_1=None,
                 category_2=None,
                 category_3=None,
                 unit=None,
                 units_per_item=None,
                 sold_amount=None,
                 sold_sum_gross=None,
                 sold_sum_net=None,
                 sold_sum_net_last_30_days=None,
                 sold_sum_gross_last_30_days=None,
                 sold_amount_last_30_days=None,
                 shipping_product_id=None,
                 delivery_time=None,
                 recipient=None,
                 occasion=None,
                 country_of_origin=None,
                 export_description=None,
                 taric_number=None,
                 condition=None,
                 width_cm=None,
                 length_cm=None,
                 height_cm=None,
                 bill_of_material=None,
                 custom_fields=None):
        """Constructor for the BillbeeInterfacesBillbeeAPIModelArticleApiModel class"""

        # Initialize members of the class
        self.invoice_text = invoice_text
        self.manufacturer = manufacturer
        self.id = id
        self.title = title
        self.description = description
        self.short_description = short_description
        self.basic_attributes = basic_attributes
        self.images = images
        self.vat_index = vat_index
        self.price = price
        self.cost_price = cost_price
        self.vat_1_rate = vat_1_rate
        self.vat_2_rate = vat_2_rate
        self.stock_desired = stock_desired
        self.stock_current = stock_current
        self.stock_warning = stock_warning
        self.sku = sku
        self.ean = ean
        self.materials = materials
        self.tags = tags
        self.sources = sources
        self.weight = weight
        self.weight_net = weight_net
        self.low_stock = low_stock
        self.stock_code = stock_code
        self.stock_reduce_items_per_sale = stock_reduce_items_per_sale
        self.stocks = stocks
        self.category_1 = category_1
        self.category_2 = category_2
        self.category_3 = category_3
        self.mtype = mtype
        self.unit = unit
        self.units_per_item = units_per_item
        self.sold_amount = sold_amount
        self.sold_sum_gross = sold_sum_gross
        self.sold_sum_net = sold_sum_net
        self.sold_sum_net_last_30_days = sold_sum_net_last_30_days
        self.sold_sum_gross_last_30_days = sold_sum_gross_last_30_days
        self.sold_amount_last_30_days = sold_amount_last_30_days
        self.shipping_product_id = shipping_product_id
        self.is_digital = is_digital
        self.is_customizable = is_customizable
        self.delivery_time = delivery_time
        self.recipient = recipient
        self.occasion = occasion
        self.country_of_origin = country_of_origin
        self.export_description = export_description
        self.taric_number = taric_number
        self.condition = condition
        self.width_cm = width_cm
        self.length_cm = length_cm
        self.height_cm = height_cm
        self.bill_of_material = bill_of_material
        self.custom_fields = custom_fields

    @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
        vat_index = dictionary.get('VatIndex')
        price = dictionary.get('Price')
        vat_1_rate = dictionary.get('Vat1Rate')
        vat_2_rate = dictionary.get('Vat2Rate')
        mtype = dictionary.get('Type')
        is_digital = dictionary.get('IsDigital')
        is_customizable = dictionary.get('IsCustomizable')
        invoice_text = None
        if dictionary.get('InvoiceText') is not None:
            invoice_text = [BillbeeInterfacesOrderMultiLanguageString.from_dictionary(x) for x in dictionary.get('InvoiceText')]
        manufacturer = dictionary.get('Manufacturer')
        id = dictionary.get('Id')
        title = None
        if dictionary.get('Title') is not None:
            title = [BillbeeInterfacesOrderMultiLanguageString.from_dictionary(x) for x in dictionary.get('Title')]
        description = None
        if dictionary.get('Description') is not None:
            description = [BillbeeInterfacesOrderMultiLanguageString.from_dictionary(x) for x in dictionary.get('Description')]
        short_description = None
        if dictionary.get('ShortDescription') is not None:
            short_description = [BillbeeInterfacesOrderMultiLanguageString.from_dictionary(x) for x in dictionary.get('ShortDescription')]
        basic_attributes = None
        if dictionary.get('BasicAttributes') is not None:
            basic_attributes = [BillbeeInterfacesOrderMultiLanguageString.from_dictionary(x) for x in dictionary.get('BasicAttributes')]
        images = None
        if dictionary.get('Images') is not None:
            images = [BillbeeInterfacesBillbeeAPIModelArticleImageRelationApiModel.from_dictionary(x) for x in dictionary.get('Images')]
        cost_price = dictionary.get('CostPrice')
        stock_desired = dictionary.get('StockDesired')
        stock_current = dictionary.get('StockCurrent')
        stock_warning = dictionary.get('StockWarning')
        sku = dictionary.get('SKU')
        ean = dictionary.get('EAN')
        materials = None
        if dictionary.get('Materials') is not None:
            materials = [BillbeeInterfacesOrderMultiLanguageString.from_dictionary(x) for x in dictionary.get('Materials')]
        tags = None
        if dictionary.get('Tags') is not None:
            tags = [BillbeeInterfacesOrderMultiLanguageString.from_dictionary(x) for x in dictionary.get('Tags')]
        sources = None
        if dictionary.get('Sources') is not None:
            sources = [BillbeeInterfacesBillbeeAPIModelArticleSourceApiModel.from_dictionary(x) for x in dictionary.get('Sources')]
        weight = dictionary.get('Weight')
        weight_net = dictionary.get('WeightNet')
        low_stock = dictionary.get('LowStock')
        stock_code = dictionary.get('StockCode')
        stock_reduce_items_per_sale = dictionary.get('StockReduceItemsPerSale')
        stocks = None
        if dictionary.get('Stocks') is not None:
            stocks = [BillbeeInterfacesBillbeeAPIModelStockArticleApiModel.from_dictionary(x) for x in dictionary.get('Stocks')]
        category_1 = BillbeeInterfacesBillbeeAPIModelArticleCategoryApiModel.from_dictionary(dictionary.get('Category1')) if dictionary.get('Category1') else None
        category_2 = BillbeeInterfacesBillbeeAPIModelArticleCategoryApiModel.from_dictionary(dictionary.get('Category2')) if dictionary.get('Category2') else None
        category_3 = BillbeeInterfacesBillbeeAPIModelArticleCategoryApiModel.from_dictionary(dictionary.get('Category3')) if dictionary.get('Category3') else None
        unit = dictionary.get('Unit')
        units_per_item = dictionary.get('UnitsPerItem')
        sold_amount = dictionary.get('SoldAmount')
        sold_sum_gross = dictionary.get('SoldSumGross')
        sold_sum_net = dictionary.get('SoldSumNet')
        sold_sum_net_last_30_days = dictionary.get('SoldSumNetLast30Days')
        sold_sum_gross_last_30_days = dictionary.get('SoldSumGrossLast30Days')
        sold_amount_last_30_days = dictionary.get('SoldAmountLast30Days')
        shipping_product_id = dictionary.get('ShippingProductId')
        delivery_time = dictionary.get('DeliveryTime')
        recipient = dictionary.get('Recipient')
        occasion = dictionary.get('Occasion')
        country_of_origin = dictionary.get('CountryOfOrigin')
        export_description = dictionary.get('ExportDescription')
        taric_number = dictionary.get('TaricNumber')
        condition = dictionary.get('Condition')
        width_cm = dictionary.get('WidthCm')
        length_cm = dictionary.get('LengthCm')
        height_cm = dictionary.get('HeightCm')
        bill_of_material = None
        if dictionary.get('BillOfMaterial') is not None:
            bill_of_material = [BillbeeInterfacesBillbeeAPIModelBomSubArticleApiModel.from_dictionary(x) for x in dictionary.get('BillOfMaterial')]
        custom_fields = None
        if dictionary.get('CustomFields') is not None:
            custom_fields = [BillbeeInterfacesBillbeeAPIModelArticleApiCustomFieldValueModel.from_dictionary(x) for x in dictionary.get('CustomFields')]

        # Return an object of this model
        return cls(vat_index,
                   price,
                   vat_1_rate,
                   vat_2_rate,
                   mtype,
                   is_digital,
                   is_customizable,
                   invoice_text,
                   manufacturer,
                   id,
                   title,
                   description,
                   short_description,
                   basic_attributes,
                   images,
                   cost_price,
                   stock_desired,
                   stock_current,
                   stock_warning,
                   sku,
                   ean,
                   materials,
                   tags,
                   sources,
                   weight,
                   weight_net,
                   low_stock,
                   stock_code,
                   stock_reduce_items_per_sale,
                   stocks,
                   category_1,
                   category_2,
                   category_3,
                   unit,
                   units_per_item,
                   sold_amount,
                   sold_sum_gross,
                   sold_sum_net,
                   sold_sum_net_last_30_days,
                   sold_sum_gross_last_30_days,
                   sold_amount_last_30_days,
                   shipping_product_id,
                   delivery_time,
                   recipient,
                   occasion,
                   country_of_origin,
                   export_description,
                   taric_number,
                   condition,
                   width_cm,
                   length_cm,
                   height_cm,
                   bill_of_material,
                   custom_fields)
