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

"""
cookiesapi

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from cookiesapi.models.store import Store


class StoreList(object):

    """Implementation of the 'StoreList' model.

    Describes a list of store records.

    Attributes:
        store (list of Store): List of stores.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "store": 'store'
    }

    def __init__(self,
                 store=None):
        """Constructor for the StoreList class"""

        # Initialize members of the class
        self.store = store

    @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
        store = None
        if dictionary.get('store') is not None:
            store = [Store.from_dictionary(x) for x in dictionary.get('store')]

        # Return an object of this model
        return cls(store)
