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

"""
zypev1

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""


class Image(object):

    """Implementation of the 'Image' model.

    TODO: type model description here.

    Attributes:
        id (string): ID of the image
        caption (string): Caption of the image
        title (string): Title of the image
        updated_at (string): Timestamp the image was updated
        url (string): URL where the image is hosted

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": '_id',
        "caption": 'caption',
        "title": 'title',
        "updated_at": 'updated_at',
        "url": 'url'
    }

    def __init__(self,
                 id=None,
                 caption=None,
                 title=None,
                 updated_at=None,
                 url=None):
        """Constructor for the Image class"""

        # Initialize members of the class
        self.id = id
        self.caption = caption
        self.title = title
        self.updated_at = updated_at
        self.url = url

    @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')
        caption = dictionary.get('caption')
        title = dictionary.get('title')
        updated_at = dictionary.get('updated_at')
        url = dictionary.get('url')

        # Return an object of this model
        return cls(id,
                   caption,
                   title,
                   updated_at,
                   url)
