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

"""
ctddocumentation

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


class GetQueriesIdsAndAssignedTaskResponse(object):

    """Implementation of the 'GetQueriesIdsAndAssignedTaskResponse' model.

    TODO: type model description here.

    Attributes:
        queries (list of object): List of lists that contains the id and name
            of each query
        selected_queries (list of int): List of lists that contains the id of
            each query assigned to the task

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "queries": 'queries',
        "selected_queries": 'selected_queries'
    }

    _optionals = [
        'queries',
        'selected_queries',
    ]

    def __init__(self,
                 queries=APIHelper.SKIP,
                 selected_queries=APIHelper.SKIP):
        """Constructor for the GetQueriesIdsAndAssignedTaskResponse class"""

        # Initialize members of the class
        if queries is not APIHelper.SKIP:
            self.queries = queries 
        if selected_queries is not APIHelper.SKIP:
            self.selected_queries = selected_queries 

    @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

        queries = None
        if dictionary.get('queries') is not None:
            queries = [Object.from_dictionary(x) for x in dictionary.get('queries')]
        else:
            queries = APIHelper.SKIP
        selected_queries = dictionary.get("selected_queries") if dictionary.get("selected_queries") else APIHelper.SKIP
        # Return an object of this model
        return cls(queries,
                   selected_queries)
