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

"""
ctddocumentation

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


class Cap(object):

    """Implementation of the 'Cap' model.

    TODO: type model description here.

    Attributes:
        site_id (int): TODO: type description here.
        resource_id (string): TODO: type description here.
        id (int): TODO: type description here.
        deleted (bool): TODO: type description here.
        file_name (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "site_id": 'site_id',
        "resource_id": 'resource_id',
        "id": 'id',
        "deleted": 'deleted',
        "file_name": 'file_name'
    }

    _optionals = [
        'site_id',
        'resource_id',
        'id',
        'deleted',
        'file_name',
    ]

    def __init__(self,
                 site_id=APIHelper.SKIP,
                 resource_id=APIHelper.SKIP,
                 id=APIHelper.SKIP,
                 deleted=APIHelper.SKIP,
                 file_name=APIHelper.SKIP):
        """Constructor for the Cap class"""

        # Initialize members of the class
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id 
        if resource_id is not APIHelper.SKIP:
            self.resource_id = resource_id 
        if id is not APIHelper.SKIP:
            self.id = id 
        if deleted is not APIHelper.SKIP:
            self.deleted = deleted 
        if file_name is not APIHelper.SKIP:
            self.file_name = file_name 

    @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

        site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP
        resource_id = dictionary.get("resource_id") if dictionary.get("resource_id") else APIHelper.SKIP
        id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP
        deleted = dictionary.get("deleted") if "deleted" in dictionary.keys() else APIHelper.SKIP
        file_name = dictionary.get("file_name") if dictionary.get("file_name") else APIHelper.SKIP
        # Return an object of this model
        return cls(site_id,
                   resource_id,
                   id,
                   deleted,
                   file_name)
