# -*- 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.virtual_zones import VirtualZones


class ActionablePolicy(object):

    """Implementation of the 'ActionablePolicy' 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.
        resource_id (string): TODO: type description here.
        id (int): TODO: type description here.
        site_id (int): TODO: type description here.
        action (int): TODO: type description here.
        active (bool): TODO: type description here.
        approved_user_id (int): TODO: type description here.
        approved_username (string): TODO: type description here.
        categories (list of int): TODO: type description here.
        categories_access (list of int): TODO: type description here.
        cloud_reputation (int): TODO: type description here.
        created_user_id (int): TODO: type description here.
        created_username (string): TODO: type description here.
        description (string): TODO: type description here.
        full_match (bool): TODO: type description here.
        hit_count (int): TODO: type description here.
        port_ranges (list of string): TODO: type description here.
        ports (list of string): TODO: type description here.
        protocols (list of string): TODO: type description here.
        valid (bool): TODO: type description here.
        state (int): TODO: type description here.
        usage_percentage (int): TODO: type description here.
        modified_user_id (int): TODO: type description here.
        modified_username (string): TODO: type description here.
        last_modified (string): TODO: type description here.
        timestamp (string): TODO: type description here.
        last_user_modified (string): TODO: type description here.
        state_modified (string): TODO: type description here.
        virtual_zones (VirtualZones): 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',
        "resource_id": 'resource_id',
        "id": 'id',
        "site_id": 'site_id',
        "action": 'action',
        "active": 'active',
        "approved_user_id": 'approved_user_id',
        "approved_username": 'approved_username',
        "categories": 'categories',
        "categories_access": 'categories_access',
        "cloud_reputation": 'cloud_reputation',
        "created_user_id": 'created_user_id',
        "created_username": 'created_username',
        "description": 'description',
        "full_match": 'full_match',
        "hit_count": 'hit_count',
        "port_ranges": 'port_ranges',
        "ports": 'ports',
        "protocols": 'protocols',
        "valid": 'valid',
        "state": 'state',
        "usage_percentage": 'usage_percentage',
        "modified_user_id": 'modified_user_id',
        "modified_username": 'modified_username',
        "last_modified": 'last_modified',
        "timestamp": 'timestamp',
        "last_user_modified": 'last_user_modified',
        "state_modified": 'state_modified',
        "virtual_zones": 'virtual_zones'
    }

    _optionals = [
        'actionable_id',
        'role_number',
        'role_name',
        'resource_id',
        'id',
        'site_id',
        'action',
        'active',
        'approved_user_id',
        'approved_username',
        'categories',
        'categories_access',
        'cloud_reputation',
        'created_user_id',
        'created_username',
        'description',
        'full_match',
        'hit_count',
        'port_ranges',
        'ports',
        'protocols',
        'valid',
        'state',
        'usage_percentage',
        'modified_user_id',
        'modified_username',
        'last_modified',
        'timestamp',
        'last_user_modified',
        'state_modified',
        'virtual_zones',
    ]

    def __init__(self,
                 actionable_id=APIHelper.SKIP,
                 role_number=APIHelper.SKIP,
                 role_name=APIHelper.SKIP,
                 resource_id=APIHelper.SKIP,
                 id=APIHelper.SKIP,
                 site_id=APIHelper.SKIP,
                 action=APIHelper.SKIP,
                 active=APIHelper.SKIP,
                 approved_user_id=APIHelper.SKIP,
                 approved_username=APIHelper.SKIP,
                 categories=APIHelper.SKIP,
                 categories_access=APIHelper.SKIP,
                 cloud_reputation=APIHelper.SKIP,
                 created_user_id=APIHelper.SKIP,
                 created_username=APIHelper.SKIP,
                 description=APIHelper.SKIP,
                 full_match=APIHelper.SKIP,
                 hit_count=APIHelper.SKIP,
                 port_ranges=APIHelper.SKIP,
                 ports=APIHelper.SKIP,
                 protocols=APIHelper.SKIP,
                 valid=APIHelper.SKIP,
                 state=APIHelper.SKIP,
                 usage_percentage=APIHelper.SKIP,
                 modified_user_id=APIHelper.SKIP,
                 modified_username=APIHelper.SKIP,
                 last_modified=APIHelper.SKIP,
                 timestamp=APIHelper.SKIP,
                 last_user_modified=APIHelper.SKIP,
                 state_modified=APIHelper.SKIP,
                 virtual_zones=APIHelper.SKIP):
        """Constructor for the ActionablePolicy 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 resource_id is not APIHelper.SKIP:
            self.resource_id = resource_id 
        if id is not APIHelper.SKIP:
            self.id = id 
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id 
        if action is not APIHelper.SKIP:
            self.action = action 
        if active is not APIHelper.SKIP:
            self.active = active 
        if approved_user_id is not APIHelper.SKIP:
            self.approved_user_id = approved_user_id 
        if approved_username is not APIHelper.SKIP:
            self.approved_username = approved_username 
        if categories is not APIHelper.SKIP:
            self.categories = categories 
        if categories_access is not APIHelper.SKIP:
            self.categories_access = categories_access 
        if cloud_reputation is not APIHelper.SKIP:
            self.cloud_reputation = cloud_reputation 
        if created_user_id is not APIHelper.SKIP:
            self.created_user_id = created_user_id 
        if created_username is not APIHelper.SKIP:
            self.created_username = created_username 
        if description is not APIHelper.SKIP:
            self.description = description 
        if full_match is not APIHelper.SKIP:
            self.full_match = full_match 
        if hit_count is not APIHelper.SKIP:
            self.hit_count = hit_count 
        if port_ranges is not APIHelper.SKIP:
            self.port_ranges = port_ranges 
        if ports is not APIHelper.SKIP:
            self.ports = ports 
        if protocols is not APIHelper.SKIP:
            self.protocols = protocols 
        if valid is not APIHelper.SKIP:
            self.valid = valid 
        if state is not APIHelper.SKIP:
            self.state = state 
        if usage_percentage is not APIHelper.SKIP:
            self.usage_percentage = usage_percentage 
        if modified_user_id is not APIHelper.SKIP:
            self.modified_user_id = modified_user_id 
        if modified_username is not APIHelper.SKIP:
            self.modified_username = modified_username 
        if last_modified is not APIHelper.SKIP:
            self.last_modified = last_modified 
        if timestamp is not APIHelper.SKIP:
            self.timestamp = timestamp 
        if last_user_modified is not APIHelper.SKIP:
            self.last_user_modified = last_user_modified 
        if state_modified is not APIHelper.SKIP:
            self.state_modified = state_modified 
        if virtual_zones is not APIHelper.SKIP:
            self.virtual_zones = virtual_zones 

    @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
        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
        site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP
        action = dictionary.get("action") if dictionary.get("action") else APIHelper.SKIP
        active = dictionary.get("active") if "active" in dictionary.keys() else APIHelper.SKIP
        approved_user_id = dictionary.get("approved_user_id") if dictionary.get("approved_user_id") else APIHelper.SKIP
        approved_username = dictionary.get("approved_username") if dictionary.get("approved_username") else APIHelper.SKIP
        categories = dictionary.get("categories") if dictionary.get("categories") else APIHelper.SKIP
        categories_access = dictionary.get("categories_access") if dictionary.get("categories_access") else APIHelper.SKIP
        cloud_reputation = dictionary.get("cloud_reputation") if dictionary.get("cloud_reputation") else APIHelper.SKIP
        created_user_id = dictionary.get("created_user_id") if dictionary.get("created_user_id") else APIHelper.SKIP
        created_username = dictionary.get("created_username") if dictionary.get("created_username") else APIHelper.SKIP
        description = dictionary.get("description") if dictionary.get("description") else APIHelper.SKIP
        full_match = dictionary.get("full_match") if "full_match" in dictionary.keys() else APIHelper.SKIP
        hit_count = dictionary.get("hit_count") if dictionary.get("hit_count") else APIHelper.SKIP
        port_ranges = dictionary.get("port_ranges") if dictionary.get("port_ranges") else APIHelper.SKIP
        ports = dictionary.get("ports") if dictionary.get("ports") else APIHelper.SKIP
        protocols = dictionary.get("protocols") if dictionary.get("protocols") else APIHelper.SKIP
        valid = dictionary.get("valid") if "valid" in dictionary.keys() else APIHelper.SKIP
        state = dictionary.get("state") if dictionary.get("state") else APIHelper.SKIP
        usage_percentage = dictionary.get("usage_percentage") if dictionary.get("usage_percentage") else APIHelper.SKIP
        modified_user_id = dictionary.get("modified_user_id") if dictionary.get("modified_user_id") else APIHelper.SKIP
        modified_username = dictionary.get("modified_username") if dictionary.get("modified_username") else APIHelper.SKIP
        last_modified = dictionary.get("last_modified") if dictionary.get("last_modified") else APIHelper.SKIP
        timestamp = dictionary.get("timestamp") if dictionary.get("timestamp") else APIHelper.SKIP
        last_user_modified = dictionary.get("last_user_modified") if dictionary.get("last_user_modified") else APIHelper.SKIP
        state_modified = dictionary.get("state_modified") if dictionary.get("state_modified") else APIHelper.SKIP
        virtual_zones = VirtualZones.from_dictionary(dictionary.get('virtual_zones')) if 'virtual_zones' in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(actionable_id,
                   role_number,
                   role_name,
                   resource_id,
                   id,
                   site_id,
                   action,
                   active,
                   approved_user_id,
                   approved_username,
                   categories,
                   categories_access,
                   cloud_reputation,
                   created_user_id,
                   created_username,
                   description,
                   full_match,
                   hit_count,
                   port_ranges,
                   ports,
                   protocols,
                   valid,
                   state,
                   usage_percentage,
                   modified_user_id,
                   modified_username,
                   last_modified,
                   timestamp,
                   last_user_modified,
                   state_modified,
                   virtual_zones)
