Class: Conversant::V3::Services::Portal::Dashboard
- Inherits:
-
Object
- Object
- Conversant::V3::Services::Portal::Dashboard
- Defined in:
- lib/conversant/v3/services/portal/dashboard.rb
Overview
Dashboard service for Portal customer metadata and reporting
Provides access to customer-related metadata including product usage, geographic distribution, industry classification, and organizational hierarchy.
Instance Attribute Summary collapse
-
#parent ⇒ Portal
readonly
The parent Portal service instance.
Instance Method Summary collapse
-
#countries ⇒ Array<Hash>
Get list of countries.
-
#industries ⇒ Array<Hash>
Get list of industries.
-
#initialize(parent) ⇒ Dashboard
constructor
Initialize dashboard service.
-
#products(params = {}) ⇒ Hash
Get product usage report for a customer.
-
#tree_view(payload = {}) ⇒ Hash
Get customer organizational tree view.
Constructor Details
#initialize(parent) ⇒ Dashboard
Initialize dashboard service
20 21 22 |
# File 'lib/conversant/v3/services/portal/dashboard.rb', line 20 def initialize(parent) @parent = parent end |
Instance Attribute Details
#parent ⇒ Portal (readonly)
Returns the parent Portal service instance.
15 16 17 |
# File 'lib/conversant/v3/services/portal/dashboard.rb', line 15 def parent @parent end |
Instance Method Details
#countries ⇒ Array<Hash>
Get list of countries
Retrieves the list of countries available in the system, typically used for filtering or categorizing customers by geographic location.
61 62 63 64 65 66 67 |
# File 'lib/conversant/v3/services/portal/dashboard.rb', line 61 def countries response = @parent.send(:call, 'GET', '/getCountry') JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" [] end |
#industries ⇒ Array<Hash>
Get list of industries
Retrieves the list of industry classifications available in the system, used for categorizing customers by business sector.
81 82 83 84 85 86 87 |
# File 'lib/conversant/v3/services/portal/dashboard.rb', line 81 def industries response = @parent.send(:call, 'GET', '/getIndustry') JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" [] end |
#products(params = {}) ⇒ Hash
Get product usage report for a customer
Retrieves information about which products (CDN, LMS, VMS, OSS) the customer is using and their usage statistics.
40 41 42 43 44 45 46 47 |
# File 'lib/conversant/v3/services/portal/dashboard.rb', line 40 def products(params = {}) query_string = params.map { |k, v| "#{k}=#{v}" }.join('&') response = @parent.send(:call, 'GET', "/getProductReport?#{query_string}") JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" {} end |
#tree_view(payload = {}) ⇒ Hash
Get customer organizational tree view
Retrieves the hierarchical organization structure showing parent-child relationships between customers, useful for partner/reseller views.
103 104 105 106 107 108 109 |
# File 'lib/conversant/v3/services/portal/dashboard.rb', line 103 def tree_view(payload = {}) response = @parent.send(:call, 'POST', '/customer/tree_view/', payload) JSON.parse(response) rescue StandardError => e @parent.send(:logger).error "#{@parent.send(:identifier)}.METHOD:#{__method__}.EXCEPTION:#{e.}" {} end |