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

"""
    test_meraki

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""

import test_meraki.models.allowed_url
import test_meraki.models.allowed_file

class UpdateNetworkSecurityMalwareSettings(object):

    """Implementation of the 'updateNetworkSecurityMalwareSettings' model.

    TODO: type model description here.

    Attributes:
        mode (string): Set mode to 'enabled' to enable malware prevention,
            otherwise 'disabled'
        allowed_urls (list of AllowedUrl): The urls that should be permitted
            by the malware detection engine. If omitted, the current config
            will remain unchanged. This is available only if your network
            supports AMP whitelisting
        allowed_files (list of AllowedFile): The sha256 digests of files that
            should be permitted by the malware detection engine. If omitted,
            the current config will remain unchanged. This is available only
            if your network supports AMP whitelisting

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "mode":'mode',
        "allowed_urls":'allowedUrls',
        "allowed_files":'allowedFiles'
    }

    def __init__(self,
                 mode=None,
                 allowed_urls=None,
                 allowed_files=None):
        """Constructor for the UpdateNetworkSecurityMalwareSettings class"""

        # Initialize members of the class
        self.mode = mode
        self.allowed_urls = allowed_urls
        self.allowed_files = allowed_files


    @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
        mode = dictionary.get('mode')
        allowed_urls = None
        if dictionary.get('allowedUrls') != None:
            allowed_urls = list()
            for structure in dictionary.get('allowedUrls'):
                allowed_urls.append(test_meraki.models.allowed_url.AllowedUrl.from_dictionary(structure))
        allowed_files = None
        if dictionary.get('allowedFiles') != None:
            allowed_files = list()
            for structure in dictionary.get('allowedFiles'):
                allowed_files.append(test_meraki.models.allowed_file.AllowedFile.from_dictionary(structure))

        # Return an object of this model
        return cls(mode,
                   allowed_urls,
                   allowed_files)


