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

"""
ctddocumentation

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from ctddocumentation.api_helper import APIHelper


class Group(object):

    """Implementation of the 'Group' model.

    TODO: type model description here.

    Attributes:
        name (string): TODO: type description here.
        is_admin (bool): TODO: type description here.
        associated_external_groups (list of string): TODO: type description
            here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "name": 'name',
        "is_admin": 'is_admin',
        "associated_external_groups": 'associated_external_groups'
    }

    _optionals = [
        'is_admin',
        'associated_external_groups',
    ]

    def __init__(self,
                 name=None,
                 is_admin=APIHelper.SKIP,
                 associated_external_groups=APIHelper.SKIP):
        """Constructor for the Group class"""

        # Initialize members of the class
        self.name = name 
        if is_admin is not APIHelper.SKIP:
            self.is_admin = is_admin 
        if associated_external_groups is not APIHelper.SKIP:
            self.associated_external_groups = associated_external_groups 

    @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

        name = dictionary.get("name") if dictionary.get("name") else None
        is_admin = dictionary.get("is_admin") if "is_admin" in dictionary.keys() else APIHelper.SKIP
        associated_external_groups = dictionary.get("associated_external_groups") if dictionary.get("associated_external_groups") else APIHelper.SKIP
        # Return an object of this model
        return cls(name,
                   is_admin,
                   associated_external_groups)
