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

"""
    test_meraki

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

import test_meraki.models.tag_2
import test_meraki.models.network_2

class CreateOrganizationSamlRole(object):

    """Implementation of the 'createOrganizationSamlRole' model.

    TODO: type model description here.

    Attributes:
        role (string): The role of the SAML administrator
        org_access (string): The privilege of the SAML administrator on the
            organization
        tags (list of Tag2): The list of tags that the SAML administrator has
            privleges on
        networks (list of Network2): The list of networks that the SAML
            administrator has privileges on

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "role":'role',
        "org_access":'orgAccess',
        "tags":'tags',
        "networks":'networks'
    }

    def __init__(self,
                 role=None,
                 org_access=None,
                 tags=None,
                 networks=None):
        """Constructor for the CreateOrganizationSamlRole class"""

        # Initialize members of the class
        self.role = role
        self.org_access = org_access
        self.tags = tags
        self.networks = networks


    @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
        role = dictionary.get('role')
        org_access = dictionary.get('orgAccess')
        tags = None
        if dictionary.get('tags') != None:
            tags = list()
            for structure in dictionary.get('tags'):
                tags.append(test_meraki.models.tag_2.Tag2.from_dictionary(structure))
        networks = None
        if dictionary.get('networks') != None:
            networks = list()
            for structure in dictionary.get('networks'):
                networks.append(test_meraki.models.network_2.Network2.from_dictionary(structure))

        # Return an object of this model
        return cls(role,
                   org_access,
                   tags,
                   networks)


