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

"""
zypev1

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from zypev1.models.zobject_attributes import ZobjectAttributes


class ZobjectTypeMetadata(object):

    """Implementation of the 'ZobjectTypeMetadata' model.

    TODO: type model description here.

    Attributes:
        id (string): ID of the record
        created_at (string): TODO: type description here.
        site_id (string): TODO: type description here.
        updated_at (string): TODO: type description here.
        zobject_count (string): Number of Zobjects created with this Zobject
            Type
        zobject_attributes (ZobjectAttributes): TODO: type description here.
        description (string): Description of the Zobject Type
        title (string): Title of the Zobject Type (must be unique)
        videos_enabled (bool): Indicates whether videos can be associated with
            instances of the Zobject Type

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": '_id',
        "created_at": 'created_at',
        "site_id": 'site_id',
        "updated_at": 'updated_at',
        "zobject_count": 'zobject_count',
        "zobject_attributes": 'zobject_attributes',
        "description": 'description',
        "title": 'title',
        "videos_enabled": 'videos_enabled'
    }

    def __init__(self,
                 id=None,
                 created_at=None,
                 site_id=None,
                 updated_at=None,
                 zobject_count=None,
                 zobject_attributes=None,
                 description=None,
                 title=None,
                 videos_enabled=None):
        """Constructor for the ZobjectTypeMetadata class"""

        # Initialize members of the class
        self.id = id
        self.created_at = created_at
        self.site_id = site_id
        self.updated_at = updated_at
        self.zobject_count = zobject_count
        self.zobject_attributes = zobject_attributes
        self.description = description
        self.title = title
        self.videos_enabled = videos_enabled

    @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
        id = dictionary.get('_id')
        created_at = dictionary.get('created_at')
        site_id = dictionary.get('site_id')
        updated_at = dictionary.get('updated_at')
        zobject_count = dictionary.get('zobject_count')
        zobject_attributes = ZobjectAttributes.from_dictionary(dictionary.get('zobject_attributes')) if dictionary.get('zobject_attributes') else None
        description = dictionary.get('description')
        title = dictionary.get('title')
        videos_enabled = dictionary.get('videos_enabled')

        # Return an object of this model
        return cls(id,
                   created_at,
                   site_id,
                   updated_at,
                   zobject_count,
                   zobject_attributes,
                   description,
                   title,
                   videos_enabled)
