Module: Novu::Api::Changes

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

Overview

Module Novu::Api::Changes provides an API for managing changes in the Novu application.

This module includes methods for retrieving, count, and applying bulk changes.

For more information on the Novu API(api.novu.co/api#/Changes), see docs.novu.co/api/get-changes/.

Instance Method Summary collapse

Instance Method Details

#apply_bulk_changes(changeIds) ⇒ Hash, number

Apply Bulk Change

Parameters:

  • changeIds (Array)

    The list of environment IDs to apply changes to.

Returns:

  • (Hash)

    updated change.

  • (number)

    status

    • Returns 201 if the bulk change has been updated correctly.



41
42
43
# File 'lib/novu/api/changes.rb', line 41

def apply_bulk_changes(changeIds)
  post("/changes/bulk/apply", body: changeIds)
end

#apply_change(change_id) ⇒ Hash, number

Apply change

@pathparams:

Parameters:

  • `change_id` (Integer)

    The ID of the change to update.

Returns:

  • (Hash)

    updated change.

  • (number)

    status

    • Returns 201 if the change with the change_id provided has been updated correctly.



53
54
55
# File 'lib/novu/api/changes.rb', line 53

def apply_change(change_id)
  post("/changes/#{change_id}/apply")
end

#changes(query = {}) ⇒ Hash, number

Returns a list of changes that can be paginated using the ‘page` query parameter

@queryparams:

Parameters:

  • `page` (Integer(optional))

    Number of page for the pagination.

  • `limit` (Integer(optional))
  • `promoted` (String)

Returns:

  • (Hash)

    The list of changes that match the criteria of the query params are successfully returned.

  • (number)

    status

    • Returns 200 if successful



21
22
23
# File 'lib/novu/api/changes.rb', line 21

def changes(query = {})
  get("/changes", query: query)
end

#count_changesHash, number

Returns changes count

Returns:

  • (Hash)

    changes count

  • (number)

    status

    • Returns 200 if successful



30
31
32
# File 'lib/novu/api/changes.rb', line 30

def count_changes
  get("/changes/count")
end