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

"""
cookiesapi

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


class StrainMedia(object):

    """Implementation of the 'StrainMedia' model.

    Specifies media/assets attached to a Cookies strain.

    Attributes:
        artwork (DualFormatGraphic): Artwork imagery for a strain.
        head (MediaItem): Headshot images for a strain.
        packaging (MediaItem): Packaging photography for a strain.
        material (list of MediaItem): Material photography for a strain.
        lockup (DualFormatGraphic): Lockup artwork for a strain.
        card (MediaItem): Card artwork for a strain.
        menu (MediaItem): Menu artwork for a strain.
        macro (list of MediaItem): Macro flower photography for a strain.
        cultivation (list of MediaItem): Late-stage cultivation photography
            for a strain.
        lifestyle (list of MediaItem): Lifestyle photography associated with a
            strain.
        tile (MediaItem): Tile graphic associated with a strain.
        masthead (ResponsiveGraphic): Masthead images associated with a
            strain.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "artwork": 'artwork',
        "head": 'head',
        "packaging": 'packaging',
        "material": 'material',
        "lockup": 'lockup',
        "card": 'card',
        "menu": 'menu',
        "macro": 'macro',
        "cultivation": 'cultivation',
        "lifestyle": 'lifestyle',
        "tile": 'tile',
        "masthead": 'masthead'
    }

    def __init__(self,
                 artwork=None,
                 head=None,
                 packaging=None,
                 material=None,
                 lockup=None,
                 card=None,
                 menu=None,
                 macro=None,
                 cultivation=None,
                 lifestyle=None,
                 tile=None,
                 masthead=None):
        """Constructor for the StrainMedia class"""

        # Initialize members of the class
        self.artwork = artwork
        self.head = head
        self.packaging = packaging
        self.material = material
        self.lockup = lockup
        self.card = card
        self.menu = menu
        self.macro = macro
        self.cultivation = cultivation
        self.lifestyle = lifestyle
        self.tile = tile
        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
        artwork = DualFormatGraphic.from_dictionary(dictionary.get('artwork')) if dictionary.get('artwork') else None
        head = MediaItem.from_dictionary(dictionary.get('head')) if dictionary.get('head') else None
        packaging = MediaItem.from_dictionary(dictionary.get('packaging')) if dictionary.get('packaging') else None
        material = None
        if dictionary.get('material') is not None:
            material = [MediaItem.from_dictionary(x) for x in dictionary.get('material')]
        lockup = DualFormatGraphic.from_dictionary(dictionary.get('lockup')) if dictionary.get('lockup') else None
        card = MediaItem.from_dictionary(dictionary.get('card')) if dictionary.get('card') else None
        menu = MediaItem.from_dictionary(dictionary.get('menu')) if dictionary.get('menu') else None
        macro = None
        if dictionary.get('macro') is not None:
            macro = [MediaItem.from_dictionary(x) for x in dictionary.get('macro')]
        cultivation = None
        if dictionary.get('cultivation') is not None:
            cultivation = [MediaItem.from_dictionary(x) for x in dictionary.get('cultivation')]
        lifestyle = None
        if dictionary.get('lifestyle') is not None:
            lifestyle = [MediaItem.from_dictionary(x) for x in dictionary.get('lifestyle')]
        tile = MediaItem.from_dictionary(dictionary.get('tile')) if dictionary.get('tile') else None
        masthead = ResponsiveGraphic.from_dictionary(dictionary.get('masthead')) if dictionary.get('masthead') else None

        # Return an object of this model
        return cls(artwork,
                   head,
                   packaging,
                   material,
                   lockup,
                   card,
                   menu,
                   macro,
                   cultivation,
                   lifestyle,
                   tile,
                   masthead)
