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

"""
uexcorpapi

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from uexcorpapi.api_helper import APIHelper


class Data20(object):

    """Implementation of the 'Data20' model.

    Attributes:
        date_added (str): The model property of type str.
        date_approved (str): The model property of type str.
        date_expiration (str): The model property of type str.
        description (str): The model property of type str.
        id (str): The model property of type str.
        id_category (str): The model property of type str.
        id_item (str): The model property of type str.
        id_organization (str): The model property of type str.
        in_stock (str): The model property of type str.
        operation (str): The model property of type str.
        photos (str): The model property of type str.
        price (str): The model property of type str.
        slug (str): The model property of type str.
        title (str): The model property of type str.
        total_negotiations (str): The model property of type str.
        total_views (str): The model property of type str.
        mtype (str): The model property of type str.
        unit (str): The model property of type str.
        user_avatar (str): The model property of type str.
        user_name (str): The model property of type str.
        user_username (str): The model property of type str.
        video_url (str): The model property of type str.
        additional_properties (Dict[str, Any]): The additional properties for
            the model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "date_added": 'date_added',
        "date_approved": 'date_approved',
        "date_expiration": 'date_expiration',
        "description": 'description',
        "id": 'id',
        "id_category": 'id_category',
        "id_item": 'id_item',
        "id_organization": 'id_organization',
        "in_stock": 'in_stock',
        "operation": 'operation',
        "photos": 'photos',
        "price": 'price',
        "slug": 'slug',
        "title": 'title',
        "total_negotiations": 'total_negotiations',
        "total_views": 'total_views',
        "mtype": 'type',
        "unit": 'unit',
        "user_avatar": 'user_avatar',
        "user_name": 'user_name',
        "user_username": 'user_username',
        "video_url": 'video_url'
    }

    def __init__(self,
                 date_added=None,
                 date_approved=None,
                 date_expiration=None,
                 description=None,
                 id=None,
                 id_category=None,
                 id_item=None,
                 id_organization=None,
                 in_stock=None,
                 operation=None,
                 photos=None,
                 price=None,
                 slug=None,
                 title=None,
                 total_negotiations=None,
                 total_views=None,
                 mtype=None,
                 unit=None,
                 user_avatar=None,
                 user_name=None,
                 user_username=None,
                 video_url=None,
                 additional_properties=None):
        """Constructor for the Data20 class"""

        # Initialize members of the class
        self.date_added = date_added 
        self.date_approved = date_approved 
        self.date_expiration = date_expiration 
        self.description = description 
        self.id = id 
        self.id_category = id_category 
        self.id_item = id_item 
        self.id_organization = id_organization 
        self.in_stock = in_stock 
        self.operation = operation 
        self.photos = photos 
        self.price = price 
        self.slug = slug 
        self.title = title 
        self.total_negotiations = total_negotiations 
        self.total_views = total_views 
        self.mtype = mtype 
        self.unit = unit 
        self.user_avatar = user_avatar 
        self.user_name = user_name 
        self.user_username = user_username 
        self.video_url = video_url 

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        date_added = dictionary.get("date_added") if dictionary.get("date_added") else None
        date_approved = dictionary.get("date_approved") if dictionary.get("date_approved") else None
        date_expiration = dictionary.get("date_expiration") if dictionary.get("date_expiration") else None
        description = dictionary.get("description") if dictionary.get("description") else None
        id = dictionary.get("id") if dictionary.get("id") else None
        id_category = dictionary.get("id_category") if dictionary.get("id_category") else None
        id_item = dictionary.get("id_item") if dictionary.get("id_item") else None
        id_organization = dictionary.get("id_organization") if dictionary.get("id_organization") else None
        in_stock = dictionary.get("in_stock") if dictionary.get("in_stock") else None
        operation = dictionary.get("operation") if dictionary.get("operation") else None
        photos = dictionary.get("photos") if dictionary.get("photos") else None
        price = dictionary.get("price") if dictionary.get("price") else None
        slug = dictionary.get("slug") if dictionary.get("slug") else None
        title = dictionary.get("title") if dictionary.get("title") else None
        total_negotiations = dictionary.get("total_negotiations") if dictionary.get("total_negotiations") else None
        total_views = dictionary.get("total_views") if dictionary.get("total_views") else None
        mtype = dictionary.get("type") if dictionary.get("type") else None
        unit = dictionary.get("unit") if dictionary.get("unit") else None
        user_avatar = dictionary.get("user_avatar") if dictionary.get("user_avatar") else None
        user_name = dictionary.get("user_name") if dictionary.get("user_name") else None
        user_username = dictionary.get("user_username") if dictionary.get("user_username") else None
        video_url = dictionary.get("video_url") if dictionary.get("video_url") else None
        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items() if k not in cls._names.values()},
            unboxing_function=lambda value: value)
        # Return an object of this model
        return cls(date_added,
                   date_approved,
                   date_expiration,
                   description,
                   id,
                   id_category,
                   id_item,
                   id_organization,
                   in_stock,
                   operation,
                   photos,
                   price,
                   slug,
                   title,
                   total_negotiations,
                   total_views,
                   mtype,
                   unit,
                   user_avatar,
                   user_name,
                   user_username,
                   video_url,
                   additional_properties)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'date_added={self.date_added!r}, '
                f'date_approved={self.date_approved!r}, '
                f'date_expiration={self.date_expiration!r}, '
                f'description={self.description!r}, '
                f'id={self.id!r}, '
                f'id_category={self.id_category!r}, '
                f'id_item={self.id_item!r}, '
                f'id_organization={self.id_organization!r}, '
                f'in_stock={self.in_stock!r}, '
                f'operation={self.operation!r}, '
                f'photos={self.photos!r}, '
                f'price={self.price!r}, '
                f'slug={self.slug!r}, '
                f'title={self.title!r}, '
                f'total_negotiations={self.total_negotiations!r}, '
                f'total_views={self.total_views!r}, '
                f'mtype={self.mtype!r}, '
                f'unit={self.unit!r}, '
                f'user_avatar={self.user_avatar!r}, '
                f'user_name={self.user_name!r}, '
                f'user_username={self.user_username!r}, '
                f'video_url={self.video_url!r}, '
                f'additional_properties={self.additional_properties!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'date_added={self.date_added!s}, '
                f'date_approved={self.date_approved!s}, '
                f'date_expiration={self.date_expiration!s}, '
                f'description={self.description!s}, '
                f'id={self.id!s}, '
                f'id_category={self.id_category!s}, '
                f'id_item={self.id_item!s}, '
                f'id_organization={self.id_organization!s}, '
                f'in_stock={self.in_stock!s}, '
                f'operation={self.operation!s}, '
                f'photos={self.photos!s}, '
                f'price={self.price!s}, '
                f'slug={self.slug!s}, '
                f'title={self.title!s}, '
                f'total_negotiations={self.total_negotiations!s}, '
                f'total_views={self.total_views!s}, '
                f'mtype={self.mtype!s}, '
                f'unit={self.unit!s}, '
                f'user_avatar={self.user_avatar!s}, '
                f'user_name={self.user_name!s}, '
                f'user_username={self.user_username!s}, '
                f'video_url={self.video_url!s}, '
                f'additional_properties={self.additional_properties!s})')
