Class: AnswerLayer::DashboardsResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/answerlayer/resources/dashboards.rb

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from AnswerLayer::Resource

Instance Method Details

#manifest(dashboard_id:) ⇒ Object



5
6
7
# File 'lib/answerlayer/resources/dashboards.rb', line 5

def manifest(dashboard_id:)
  request(method: :get, path: "/dashboards/#{dashboard_id}/manifest", subject: true)
end

#parameters(dashboard_id:, tile_id:) ⇒ Object



13
14
15
# File 'lib/answerlayer/resources/dashboards.rb', line 13

def parameters(dashboard_id:, tile_id:)
  to_api_response(request(method: :get, path: "/dashboards/#{dashboard_id}/tiles/#{tile_id}/parameters", subject: true))
end

#tile_data(dashboard_id:, tile_id:, filters: nil, params: nil, pagination: nil, result_handle: nil) ⇒ Object



9
10
11
# File 'lib/answerlayer/resources/dashboards.rb', line 9

def tile_data(dashboard_id:, tile_id:, filters: nil, params: nil, pagination: nil, result_handle: nil)
  to_result_envelope(request(method: :post, path: "/dashboards/#{dashboard_id}/tiles/#{tile_id}/data", body: compact(filters: filters, params: params, pagination: pagination, result_handle: result_handle), subject: true))
end

#update_parameters(dashboard_id:, tile_id:, values:, subject_org_id: nil) ⇒ Object



17
18
19
20
# File 'lib/answerlayer/resources/dashboards.rb', line 17

def update_parameters(dashboard_id:, tile_id:, values:, subject_org_id: nil)
  headers = subject_org_id ? { "X-Subject-Org-ID" => subject_org_id } : {}
  to_api_response(request(method: :put, path: "/dashboards/#{dashboard_id}/tiles/#{tile_id}/parameters", body: { values: values }, headers: headers, subject: true))
end