"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper


class GetProductsInventoryRequest(object):
    """Implementation of the 'GetProductsInventoryRequest' model.

    Attributes:
        product_ids (List[str]): When included, the response only contains details
            about the specified product Ids.
        location_ids (List[int]): When included, the response only contains details
            about the specified location Ids.
        barcode_ids (List[str]): When included, the response only contains details
            about the specified Barcode Ids.
        limit (int): Number of results to include, defaults to 100
        offset (int): Page offset, defaults to 0.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "product_ids": "ProductIds",
        "location_ids": "LocationIds",
        "barcode_ids": "BarcodeIds",
        "limit": "Limit",
        "offset": "Offset",
    }

    _optionals = [
        "product_ids",
        "location_ids",
        "barcode_ids",
        "limit",
        "offset",
    ]

    def __init__(
        self,
        product_ids=APIHelper.SKIP,
        location_ids=APIHelper.SKIP,
        barcode_ids=APIHelper.SKIP,
        limit=APIHelper.SKIP,
        offset=APIHelper.SKIP):
        """Initialize a GetProductsInventoryRequest instance."""
        # Initialize members of the class
        if product_ids is not APIHelper.SKIP:
            self.product_ids = product_ids
        if location_ids is not APIHelper.SKIP:
            self.location_ids = location_ids
        if barcode_ids is not APIHelper.SKIP:
            self.barcode_ids = barcode_ids
        if limit is not APIHelper.SKIP:
            self.limit = limit
        if offset is not APIHelper.SKIP:
            self.offset = offset

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create 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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        product_ids =\
            dictionary.get("ProductIds")\
            if dictionary.get("ProductIds")\
                else APIHelper.SKIP
        location_ids =\
            dictionary.get("LocationIds")\
            if dictionary.get("LocationIds")\
                else APIHelper.SKIP
        barcode_ids =\
            dictionary.get("BarcodeIds")\
            if dictionary.get("BarcodeIds")\
                else APIHelper.SKIP
        limit =\
            dictionary.get("Limit")\
            if dictionary.get("Limit")\
                else APIHelper.SKIP
        offset =\
            dictionary.get("Offset")\
            if dictionary.get("Offset")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(product_ids,
                   location_ids,
                   barcode_ids,
                   limit,
                   offset)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _product_ids=(
            self.product_ids
            if hasattr(self, "product_ids")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            else None
        )
        _barcode_ids=(
            self.barcode_ids
            if hasattr(self, "barcode_ids")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"product_ids={_product_ids!r}, "
            f"location_ids={_location_ids!r}, "
            f"barcode_ids={_barcode_ids!r}, "
            f"limit={_limit!r}, "
            f"offset={_offset!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _product_ids=(
            self.product_ids
            if hasattr(self, "product_ids")
            else None
        )
        _location_ids=(
            self.location_ids
            if hasattr(self, "location_ids")
            else None
        )
        _barcode_ids=(
            self.barcode_ids
            if hasattr(self, "barcode_ids")
            else None
        )
        _limit=(
            self.limit
            if hasattr(self, "limit")
            else None
        )
        _offset=(
            self.offset
            if hasattr(self, "offset")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"product_ids={_product_ids!s}, "
            f"location_ids={_location_ids!s}, "
            f"barcode_ids={_barcode_ids!s}, "
            f"limit={_limit!s}, "
            f"offset={_offset!s}, "
            f")"
        )
