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

"""
cookiesapi

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


class StoreMedia(object):

    """Implementation of the 'StoreMedia' model.

    Photography and other media related to a first-party Cookies store.

    Attributes:
        facade (list of MediaItem): Facade photography of a Cookies store.
        inside (list of MediaItem): Inside photography of a Cookies store.
        masthead (list of MediaItem): Masthead (featured) photography for a
            Cookies store.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "facade": 'facade',
        "inside": 'inside',
        "masthead": 'masthead'
    }

    def __init__(self,
                 facade=None,
                 inside=None,
                 masthead=None):
        """Constructor for the StoreMedia class"""

        # Initialize members of the class
        self.facade = facade
        self.inside = inside
        self.masthead = masthead

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

        # Return an object of this model
        return cls(facade,
                   inside,
                   masthead)
