Module: Novu::Api::Feeds

Included in:
Client
Defined in:
lib/novu/api/feeds.rb

Overview

Module Novu::Api::Feeds provides an API for managing feeds in the Novu application.

This module includes methods for creating, retrieving, and deleting feeds.

For more information on the Novu API(api.novu.co/api#/Feeds), see docs.novu.co/api/create-feed/.

Instance Method Summary collapse

Instance Method Details

#create_feed(body) ⇒ Hash, number

Creates a new feed.

@bodyparams:

Parameters:

  • `name` (String)

Returns:

  • (Hash)

    Feed entity.

  • (number)

    status - The status code. Returns 201 if the feed has been successfully created.



18
19
20
# File 'lib/novu/api/feeds.rb', line 18

def create_feed(body)
  post("/feeds", body: body)
end

#delete_feed(feed_id) ⇒ Hash, number

Execute a soft delete of a feed given a certain ID.

@pathparams:

Parameters:

  • `feed_id` (String)

    The ID of the feed to delete.

Returns:

  • (Hash)

    The retrieved feed.

  • (number)

    status

    • Returns 204 if the feed has been deleted correctly.



39
40
41
# File 'lib/novu/api/feeds.rb', line 39

def delete_feed(feed_id)
  delete("/feeds/#{feed_id}")
end

#feedsHash, number

Returns a list of feeds

Returns:

  • (Hash)

    list of feeds

  • (number)

    status

    • Returns 200 if successful



27
28
29
# File 'lib/novu/api/feeds.rb', line 27

def feeds
  get("/feeds")
end