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

"""
ctddocumentation

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


class SlimInsight(object):

    """Implementation of the 'SlimInsight' model.

    TODO: type model description here.

    Attributes:
        comment (string): Last comment provided by user
        cve_id (string): The CVE's ID
        cvss (object): The CVE's score
        identified_on (string): The timestamp when the CVE was identified.  
            Format: YYYY-MM-DDTHH:MM:SS (in UTC)
        last_updated (string): The timestamp when the latest change on the CVE
            was made in the EMC.   Format: YYYY-MM-DDTHH:MM:SS+00:00 (in UTC)
        modified (string): The full date of the latest modification was made
            on the CVE by the global provider.   Format: YYYY-MM-DD
        published (string): The full date when the CVE's was published at.  
            Format: YYYY-MM-DD
        status (int): A number that represents the CVE's status.   Options:  0
            - Open  1 - Hidden  2 - Completed
        title (string): The CVE's title

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "comment": 'comment',
        "cve_id": 'cve_id',
        "cvss": 'cvss',
        "identified_on": 'identified_on',
        "last_updated": 'last_updated',
        "modified": 'modified',
        "published": 'published',
        "status": 'status',
        "title": 'title'
    }

    _optionals = [
        'comment',
        'cve_id',
        'cvss',
        'identified_on',
        'last_updated',
        'modified',
        'published',
        'status',
        'title',
    ]

    def __init__(self,
                 comment=APIHelper.SKIP,
                 cve_id=APIHelper.SKIP,
                 cvss=APIHelper.SKIP,
                 identified_on=APIHelper.SKIP,
                 last_updated=APIHelper.SKIP,
                 modified=APIHelper.SKIP,
                 published=APIHelper.SKIP,
                 status=APIHelper.SKIP,
                 title=APIHelper.SKIP):
        """Constructor for the SlimInsight class"""

        # Initialize members of the class
        if comment is not APIHelper.SKIP:
            self.comment = comment 
        if cve_id is not APIHelper.SKIP:
            self.cve_id = cve_id 
        if cvss is not APIHelper.SKIP:
            self.cvss = cvss 
        if identified_on is not APIHelper.SKIP:
            self.identified_on = identified_on 
        if last_updated is not APIHelper.SKIP:
            self.last_updated = last_updated 
        if modified is not APIHelper.SKIP:
            self.modified = modified 
        if published is not APIHelper.SKIP:
            self.published = published 
        if status is not APIHelper.SKIP:
            self.status = status 
        if title is not APIHelper.SKIP:
            self.title = title 

    @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

        comment = dictionary.get("comment") if dictionary.get("comment") else APIHelper.SKIP
        cve_id = dictionary.get("cve_id") if dictionary.get("cve_id") else APIHelper.SKIP
        cvss = Object.from_dictionary(dictionary.get('cvss')) if 'cvss' in dictionary.keys() else APIHelper.SKIP
        identified_on = dictionary.get("identified_on") if dictionary.get("identified_on") else APIHelper.SKIP
        last_updated = dictionary.get("last_updated") if dictionary.get("last_updated") else APIHelper.SKIP
        modified = dictionary.get("modified") if dictionary.get("modified") else APIHelper.SKIP
        published = dictionary.get("published") if dictionary.get("published") else APIHelper.SKIP
        status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP
        title = dictionary.get("title") if dictionary.get("title") else APIHelper.SKIP
        # Return an object of this model
        return cls(comment,
                   cve_id,
                   cvss,
                   identified_on,
                   last_updated,
                   modified,
                   published,
                   status,
                   title)
