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

"""
    test_meraki

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

import test_meraki.models.default_destinations
import test_meraki.models.alert

class UpdateNetworkAlertSettings(object):

    """Implementation of the 'updateNetworkAlertSettings' model.

    TODO: type model description here.

    Attributes:
        default_destinations (DefaultDestinations): The network_wide
            destinations for all alerts on the network.
        alerts (list of Alert): Alert-specific configuration for each type.
            Only alerts that pertain to the network can be updated.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "default_destinations":'defaultDestinations',
        "alerts":'alerts'
    }

    def __init__(self,
                 default_destinations=None,
                 alerts=None):
        """Constructor for the UpdateNetworkAlertSettings class"""

        # Initialize members of the class
        self.default_destinations = default_destinations
        self.alerts = alerts


    @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
        default_destinations = test_meraki.models.default_destinations.DefaultDestinations.from_dictionary(dictionary.get('defaultDestinations')) if dictionary.get('defaultDestinations') else None
        alerts = None
        if dictionary.get('alerts') != None:
            alerts = list()
            for structure in dictionary.get('alerts'):
                alerts.append(test_meraki.models.alert.Alert.from_dictionary(structure))

        # Return an object of this model
        return cls(default_destinations,
                   alerts)


