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

"""
pqapiv2

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


class WebhookSubscriptionResponse(object):

    """Implementation of the 'webhook-Subscription-Response' model.

    Webhook Subscription response

    Attributes:
        links (list of HaetosParams): TODO: type description here.
        url (string): TODO: type description here.
        namespace (NamespaceEnum): Namespace used to identify and refer to the
            object
        token (string): Token for the webhook subscription
        created (string): Time stamp for the date the webhook subscription was
            created
        last_updated (string): Time stamp for the date the webhook
            subscription was updated

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "links": 'links',
        "url": 'url',
        "namespace": 'namespace',
        "token": 'token',
        "created": 'created',
        "last_updated": 'lastUpdated'
    }

    def __init__(self,
                 links=None,
                 url=None,
                 namespace=None,
                 token=None,
                 created=None,
                 last_updated=None):
        """Constructor for the WebhookSubscriptionResponse class"""

        # Initialize members of the class
        self.links = links
        self.url = url
        self.namespace = namespace
        self.token = token
        self.created = created
        self.last_updated = last_updated

    @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
        links = None
        if dictionary.get('links') is not None:
            links = [HaetosParams.from_dictionary(x) for x in dictionary.get('links')]
        url = dictionary.get('url')
        namespace = dictionary.get('namespace')
        token = dictionary.get('token')
        created = dictionary.get('created')
        last_updated = dictionary.get('lastUpdated')

        # Return an object of this model
        return cls(links,
                   url,
                   namespace,
                   token,
                   created,
                   last_updated)
