#
#   © 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 Subscription(Resource):
    """Subscriptions represent the list of object types or alerts that a websocket client is interested in getting notifications for. Each subscription belongs to a single
    notification client.

    # Parameters
    id                : Identifier for subscription.
    subscriber_id     : Identifier for subscriber (notification client) that this subscription belongs to.
    notification_type : This indicates the type of notification being subscribed for.
    object_type       : The object type that the notification subscriber is interested in. This is relevant for and required only for audit log based notifications.
    object_id         : The object that the notification subscriber is interested in. Applies only to audit log based notifications.
    operation         : The operation that the notification subscriber is interested in. Applies only to audit log based notifications.
    event_target_type : The kind of events or alerts that the notification subscriber is interested in. Applies only to events based notifications.
    event_severity    : The severity of events that the notification subscriber is interested in. Applies only to events based notifications.
    """


class SubscriptionList(Collection):
    resource = Subscription
    resource_type = "subscriptions"

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