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

"""
cookiesapi

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from cookiesapi.models.contact import Contact
from cookiesapi.models.hours import Hours
from cookiesapi.models.location import Location
from cookiesapi.models.name import Name
from cookiesapi.models.store_branding import StoreBranding
from cookiesapi.models.store_key import StoreKey
from cookiesapi.models.store_media import StoreMedia
from cookiesapi.models.store_ordering import StoreOrdering
from cookiesapi.models.store_social import StoreSocial
from cookiesapi.models.store_web import StoreWeb


class Store(object):

    """Implementation of the 'Store' model.

    Specifies a physical retail location owned or operated by Cookies, or
    partnering with Cookies to sell products made by Cookies.

    Attributes:
        key (StoreKey): Describes unique key information for a retail store.
        live (bool): Specifies whether this retail location is live.
        slug (string): Specifies the unique URL slug for this store.
        name (Name): Specifies naming and labeling information for a Cookies
            store.
        mtype (StoreTypeEnum): Specifies the type for a retail store.
        location (Location): Specifies location information for a retail
            store.
        contact (Contact): Specifies contact information for a retail store.
        capability (list of StoreCapabilityEnum): Specifies documented
            capabilities at a retail store.
        hours (Hours): Specifies regular and special hours for a retail
            store.
        social (StoreSocial): Specifies social media accounts for a retail
            store.
        media (StoreMedia): Specifies photography and other assets for a
            retail store.
        web (StoreWeb): Specifies website and link information for a retail
            store.
        branding (StoreBranding): Specifies branding information for a retail
            store.
        ordering (StoreOrdering): Specifies online ordering information for a
            retail store.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "key": 'key',
        "live": 'live',
        "slug": 'slug',
        "name": 'name',
        "mtype": 'type',
        "location": 'location',
        "contact": 'contact',
        "capability": 'capability',
        "hours": 'hours',
        "social": 'social',
        "media": 'media',
        "web": 'web',
        "branding": 'branding',
        "ordering": 'ordering'
    }

    def __init__(self,
                 key=None,
                 live=None,
                 slug=None,
                 name=None,
                 mtype=None,
                 location=None,
                 contact=None,
                 capability=None,
                 hours=None,
                 social=None,
                 media=None,
                 web=None,
                 branding=None,
                 ordering=None):
        """Constructor for the Store class"""

        # Initialize members of the class
        self.key = key
        self.live = live
        self.slug = slug
        self.name = name
        self.mtype = mtype
        self.location = location
        self.contact = contact
        self.capability = capability
        self.hours = hours
        self.social = social
        self.media = media
        self.web = web
        self.branding = branding
        self.ordering = ordering

    @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
        key = StoreKey.from_dictionary(dictionary.get('key')) if dictionary.get('key') else None
        live = dictionary.get('live')
        slug = dictionary.get('slug')
        name = Name.from_dictionary(dictionary.get('name')) if dictionary.get('name') else None
        mtype = dictionary.get('type')
        location = Location.from_dictionary(dictionary.get('location')) if dictionary.get('location') else None
        contact = Contact.from_dictionary(dictionary.get('contact')) if dictionary.get('contact') else None
        capability = dictionary.get('capability')
        hours = Hours.from_dictionary(dictionary.get('hours')) if dictionary.get('hours') else None
        social = StoreSocial.from_dictionary(dictionary.get('social')) if dictionary.get('social') else None
        media = StoreMedia.from_dictionary(dictionary.get('media')) if dictionary.get('media') else None
        web = StoreWeb.from_dictionary(dictionary.get('web')) if dictionary.get('web') else None
        branding = StoreBranding.from_dictionary(dictionary.get('branding')) if dictionary.get('branding') else None
        ordering = StoreOrdering.from_dictionary(dictionary.get('ordering')) if dictionary.get('ordering') else None

        # Return an object of this model
        return cls(key,
                   live,
                   slug,
                   name,
                   mtype,
                   location,
                   contact,
                   capability,
                   hours,
                   social,
                   media,
                   web,
                   branding,
                   ordering)
