class Sensit::Api::Topic

A topic is root that data is attached to. It is the equivalent of a source in searchlight/solink and acts as a table which has columns(Fields) and rows(Feeds).

Public Class Methods

new(client) click to toggle source
# File lib/sensit/api/topic.rb, line 9
def initialize(client)
  @client = client
end

Public Instance Methods

create(topic, options = {}) click to toggle source

Requires authorization of manage_any_data, or manage_application_data. ‘/topics’ POST

topic - A hash containing the name/id of the topic (required) and a description of the topic.

# File lib/sensit/api/topic.rb, line 39
def create(topic, options = {})
  body = options.has_key?(:body) ? options[:body] : {}
  body[:topic] = topic

  response = @client.post "/topics", body, options

  return response
end
delete(options = {}) click to toggle source

Requires authorization of manage_any_data, or manage_application_data. ‘/topics/:id’ DELETE

# File lib/sensit/api/topic.rb, line 64
def delete(options = {})
  body = options.has_key?(:body) ? options[:body] : {}

  response = @client.delete "/topics/:id", body, options

  return response
end
find(options = {}) click to toggle source

Requires authorization of read_any_data, or read_application_data. ‘/topics/:id’ GET

# File lib/sensit/api/topic.rb, line 27
def find(options = {})
  body = options.has_key?(:query) ? options[:query] : {}

  response = @client.get "/topics/:id", body, options

  return response
end
list(options = {}) click to toggle source

Requires authorization of read_any_data, or read_application_data. ‘/topics’ GET

# File lib/sensit/api/topic.rb, line 16
def list(options = {})
  body = options.has_key?(:query) ? options[:query] : {}

  response = @client.get "/topics", body, options

  return response
end
update(topic, options = {}) click to toggle source

Requires authorization of manage_any_data, or manage_application_data. ‘/topics/:id’ PUT

topic - A hash containing the name/id of the topic (required) and a description of the topic.

# File lib/sensit/api/topic.rb, line 52
def update(topic, options = {})
  body = options.has_key?(:body) ? options[:body] : {}
  body[:topic] = topic

  response = @client.put "/topics/:id", body, options

  return response
end