#
#   © Copyright 2020 Hewlett Packard Enterprise Development LP
#
#   This file was auto-generated by the Python SDK generator; DO NOT EDIT.
#


from ...resource import Resource, Collection


class Subscriber(Resource):
    """Subscribers are websocket based notification clients that can subscribe to interesting operations and events and recieve notifications whenever the subscribed to operations
    and events happen on the array.

    # Parameters
    id                     : Identifier for subscriber.
    type                   : This is generally used to indicate the type of subscriber e.g. SMIS/GUI/ThirdParty etc. This is free form and doesn't need to be unique.
    renew_interval         : The interval in seconds within which the subscriber is expected to send a renew message over the websocket channel in case there is no traffic on the
                             websocket channel.
    renew_response_timeout : The interval in seconds after the subscriber sends a renew message within which the subscriber expects to get a response.
    is_connected           : True if the subscriber has an active websocket connection.
    notification_count     : Number of notifications sent to subscriber.
    force                  : Forcibly modify a connected subscriber.
    """


class SubscriberList(Collection):
    resource = Subscriber
    resource_type = "subscribers"

    def create(self, **kwargs):
        resp = self._client.create_resource(self.resource_type, **kwargs)
        return self.resource(resp['id'], resp, client=self._client, collection=self)
