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

"""
cookiesapi

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


class StoreSocial(object):

    """Implementation of the 'StoreSocial' model.

    Social media information for a first-party Cookies store.

    Attributes:
        property (list of SocialProperty): Social media properties.
        facebook_user (string): Store Facebook page username.

    """

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

    def __init__(self,
                 property=None,
                 facebook_user=None):
        """Constructor for the StoreSocial class"""

        # Initialize members of the class
        self.property = property
        self.facebook_user = facebook_user

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

        # Return an object of this model
        return cls(property,
                   facebook_user)
