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

"""
pqapiv2

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from pqapiv2.models.haetos_params import HaetosParams
from pqapiv2.models.user_response import UserResponse


class UserCollectionResponse(object):

    """Implementation of the 'userCollection-Response' model.

    Response from a User Collection request

    Attributes:
        payload (list of UserResponse): TODO: type description here.
        links (list of HaetosParams): TODO: type description here.

    """

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

    def __init__(self,
                 payload=None,
                 links=None):
        """Constructor for the UserCollectionResponse class"""

        # Initialize members of the class
        self.payload = payload
        self.links = links

    @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
        payload = None
        if dictionary.get('payload') is not None:
            payload = [UserResponse.from_dictionary(x) for x in dictionary.get('payload')]
        links = None
        if dictionary.get('links') is not None:
            links = [HaetosParams.from_dictionary(x) for x in dictionary.get('links')]

        # Return an object of this model
        return cls(payload,
                   links)
