Module: Novu::Api::Tenants
- Included in:
- Client
- Defined in:
- lib/novu/api/tenants.rb
Overview
Module Novu::Api::Tenants provides an API for managing tenants in the Novu application.
This module includes methods for creating, retrieving, updating and deleting tenant.
For more information on the tenants feature (docs.novu.co/tenants/introduction), for API documentation see docs.novu.co/api-reference/tenants/get-tenants.
Instance Method Summary collapse
-
#create_tenant(body) ⇒ Hash, number
Create a tenant.
-
#delete_tenant(identifier) ⇒ number
Using a previously create identifier during the tenant ceation, will cancel any active or pending workflows.
-
#tenant(identifier) ⇒ Hash, number
Get a tenant by the tenant identifier.
-
#tenants(query = {}) ⇒ Hash, ...
Returns a list of tenant that can be paginated using the ‘page` query parameter and set the number of tenants to be with the `limit` query parameter.
-
#update_tenant(identifier, body) ⇒ Hash, number
Update a tenant.
Instance Method Details
#create_tenant(body) ⇒ Hash, number
Create a tenant
@bodyparams:
21 22 23 |
# File 'lib/novu/api/tenants.rb', line 21 def create_tenant(body) post("/tenants", body: body) end |
#delete_tenant(identifier) ⇒ number
Using a previously create identifier during the tenant ceation, will cancel any active or pending workflows. This is useful to cancel active digests, delays etc…
@pathparams:
77 78 79 |
# File 'lib/novu/api/tenants.rb', line 77 def delete_tenant(identifier) delete("/tenants/#{identifier}") end |
#tenant(identifier) ⇒ Hash, number
Get a tenant by the tenant identifier
50 51 52 |
# File 'lib/novu/api/tenants.rb', line 50 def tenant(identifier) get("/tenants/#{identifier}") end |
#tenants(query = {}) ⇒ Hash, ...
Returns a list of tenant that can be paginated using the ‘page` query parameter and
set the number of tenants to be with the `limit` query parameter
@queryparams:
38 39 40 |
# File 'lib/novu/api/tenants.rb', line 38 def tenants(query = {}) get("/tenants", query: query) end |
#update_tenant(identifier, body) ⇒ Hash, number
Update a tenant
@bodyparams:
66 67 68 |
# File 'lib/novu/api/tenants.rb', line 66 def update_tenant(identifier, body) patch("/tenants/#{identifier}", body: body) end |