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

"""
    test_meraki

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

import test_meraki.models.power_exception

class UpdateNetworkSwitchSettings(object):

    """Implementation of the 'updateNetworkSwitchSettings' model.

    TODO: type model description here.

    Attributes:
        vlan (int): Management VLAN
        use_combined_power (bool): The use Combined Power as the default
            behavior of secondary power supplies on supported devices.
        power_exceptions (list of PowerException): Exceptions on a per switch
            basis to "useCombinedPower"

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "vlan":'vlan',
        "use_combined_power":'useCombinedPower',
        "power_exceptions":'powerExceptions'
    }

    def __init__(self,
                 vlan=None,
                 use_combined_power=None,
                 power_exceptions=None):
        """Constructor for the UpdateNetworkSwitchSettings class"""

        # Initialize members of the class
        self.vlan = vlan
        self.use_combined_power = use_combined_power
        self.power_exceptions = power_exceptions


    @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
        vlan = dictionary.get('vlan')
        use_combined_power = dictionary.get('useCombinedPower')
        power_exceptions = None
        if dictionary.get('powerExceptions') != None:
            power_exceptions = list()
            for structure in dictionary.get('powerExceptions'):
                power_exceptions.append(test_meraki.models.power_exception.PowerException.from_dictionary(structure))

        # Return an object of this model
        return cls(vlan,
                   use_combined_power,
                   power_exceptions)


