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

"""
    test_meraki

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

import test_meraki.models.bandwidth_limits

class Bandwidth(object):

    """Implementation of the 'Bandwidth' model.

    The bandwidth settings for clients bound to your group policy.

    Attributes:
        settings (SettingsEnum): How bandwidth limits are enforced. Can be
            'network default', 'ignore' or 'custom'.
        bandwidth_limits (BandwidthLimits): The bandwidth limits object,
            specifying upload and download speed for clients bound to the
            group policy. These are only enforced if 'settings' is set to
            'custom'.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "settings":'settings',
        "bandwidth_limits":'bandwidthLimits'
    }

    def __init__(self,
                 settings=None,
                 bandwidth_limits=None):
        """Constructor for the Bandwidth class"""

        # Initialize members of the class
        self.settings = settings
        self.bandwidth_limits = bandwidth_limits


    @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
        settings = dictionary.get('settings')
        bandwidth_limits = test_meraki.models.bandwidth_limits.BandwidthLimits.from_dictionary(dictionary.get('bandwidthLimits')) if dictionary.get('bandwidthLimits') else None

        # Return an object of this model
        return cls(settings,
                   bandwidth_limits)


