# -*- 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.cap import Cap


class ActionableCap(object):

    """Implementation of the 'ActionableCap' model.

    TODO: type model description here.

    Attributes:
        actionable_id (int): TODO: type description here.
        role_number (int): TODO: type description here.
        role_name (string): TODO: type description here.
        cap (Cap): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "actionable_id": 'actionable_id',
        "role_number": 'role_number',
        "role_name": 'role_name',
        "cap": 'cap'
    }

    _optionals = [
        'actionable_id',
        'role_number',
        'role_name',
        'cap',
    ]

    def __init__(self,
                 actionable_id=APIHelper.SKIP,
                 role_number=APIHelper.SKIP,
                 role_name=APIHelper.SKIP,
                 cap=APIHelper.SKIP):
        """Constructor for the ActionableCap class"""

        # Initialize members of the class
        if actionable_id is not APIHelper.SKIP:
            self.actionable_id = actionable_id 
        if role_number is not APIHelper.SKIP:
            self.role_number = role_number 
        if role_name is not APIHelper.SKIP:
            self.role_name = role_name 
        if cap is not APIHelper.SKIP:
            self.cap = cap 

    @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

        actionable_id = dictionary.get("actionable_id") if dictionary.get("actionable_id") else APIHelper.SKIP
        role_number = dictionary.get("role_number") if dictionary.get("role_number") else APIHelper.SKIP
        role_name = dictionary.get("role_name") if dictionary.get("role_name") else APIHelper.SKIP
        cap = Cap.from_dictionary(dictionary.get('cap')) if 'cap' in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(actionable_id,
                   role_number,
                   role_name,
                   cap)
