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

"""
billbeeapi

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


class BillbeeInterfacesBillbeeAPIModelUpdateStockApiModel(object):

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

    TODO: type model description here.

    Attributes:
        billbee_id (long|int): Optional the ID of the Billbee product to
            update
        sku (string): The SKU of the product to update
        stock_id (long|int): Optional the stock id if the feature multi stock
            is activated
        reason (string): Optional a reason text for the stock update
        old_quantity (float): This parameter is currently ignored
        new_quantity (float): The new absolute stock quantity for the product
            you want to set
        delta_quantity (float): This parameter is currently ignored
        force_send_stock_to_shops (bool): If true, every sent stockchange is
            stored and transmitted to the connected shop, even if the value
            has not changed
        autosubtract_reserved_amount (bool): Automatically reduce the
            NewQuantity by the currently not fulfilled amount

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "billbee_id": 'BillbeeId',
        "sku": 'Sku',
        "stock_id": 'StockId',
        "reason": 'Reason',
        "old_quantity": 'OldQuantity',
        "new_quantity": 'NewQuantity',
        "delta_quantity": 'DeltaQuantity',
        "force_send_stock_to_shops": 'ForceSendStockToShops',
        "autosubtract_reserved_amount": 'AutosubtractReservedAmount'
    }

    def __init__(self,
                 billbee_id=None,
                 sku=None,
                 stock_id=None,
                 reason=None,
                 old_quantity=None,
                 new_quantity=None,
                 delta_quantity=None,
                 force_send_stock_to_shops=None,
                 autosubtract_reserved_amount=None):
        """Constructor for the BillbeeInterfacesBillbeeAPIModelUpdateStockApiModel class"""

        # Initialize members of the class
        self.billbee_id = billbee_id
        self.sku = sku
        self.stock_id = stock_id
        self.reason = reason
        self.old_quantity = old_quantity
        self.new_quantity = new_quantity
        self.delta_quantity = delta_quantity
        self.force_send_stock_to_shops = force_send_stock_to_shops
        self.autosubtract_reserved_amount = autosubtract_reserved_amount

    @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
        billbee_id = dictionary.get('BillbeeId')
        sku = dictionary.get('Sku')
        stock_id = dictionary.get('StockId')
        reason = dictionary.get('Reason')
        old_quantity = dictionary.get('OldQuantity')
        new_quantity = dictionary.get('NewQuantity')
        delta_quantity = dictionary.get('DeltaQuantity')
        force_send_stock_to_shops = dictionary.get('ForceSendStockToShops')
        autosubtract_reserved_amount = dictionary.get('AutosubtractReservedAmount')

        # Return an object of this model
        return cls(billbee_id,
                   sku,
                   stock_id,
                   reason,
                   old_quantity,
                   new_quantity,
                   delta_quantity,
                   force_send_stock_to_shops,
                   autosubtract_reserved_amount)
