Module: PortfolioManager::REST::Meter
Overview
Meter services
Instance Method Summary collapse
-
#consumption_data(meter_id, page: nil, start_date: nil, end_date: nil) ⇒ Object
This web service retrieves a list of consumption data for a specific meter.
-
#meter(meter_id) ⇒ Object
This web service retrieves information for a specific meter.
-
#meter_list(property_id) ⇒ Object
This web service retrieves a list of all the meters for a specific property.
-
#what_changed_consumption_data_meter_list(customer_id, date, next_page_key: nil, previous_page_key: nil) ⇒ Object
This web service returns a list of meters that have had their consumption data changed since a user specified date.
-
#what_changed_meter_list(customer_id, date, next_page_key: nil, previous_page_key: nil) ⇒ Object
This web service returns a list of meters that changed since a user specified date.
-
#what_changed_meter_list_for_property(property_id, date, next_page_key: nil, previous_page_key: nil) ⇒ Object
This web service returns a list of meters within a specified property that changed since a user specified date.
Instance Method Details
#consumption_data(meter_id, page: nil, start_date: nil, end_date: nil) ⇒ Object
This web service retrieves a list of consumption data for a specific meter. The meter must already be shared with you.
The consumption data is returned in sets of 120. An optional date range can specified to return a certain set of consumption records. Dates must be formatted as YYYY-MM-DD
page_link template: “/meter/#meter_id/consumptionData/?page=#page&startDate=#start_date&endDate=#end_date”
74 75 76 77 78 79 |
# File 'lib/portfolio_manager/rest/meter.rb', line 74 def consumption_data(meter_id, page: nil, start_date: nil, end_date: nil) query_string = URI.encode_www_form({ page: page, startDate: start_date, endDate: end_date }.reject! {|k,v| v.nil?}) resource_path = "/meter/#{meter_id}/consumptionData" link = query_string.empty? ? resource_path : "#{resource_path}?#{query_string}" perform_get_request(link) end |
#meter(meter_id) ⇒ Object
This web service retrieves information for a specific meter. The meter must already be shared with you.
19 20 21 |
# File 'lib/portfolio_manager/rest/meter.rb', line 19 def meter(meter_id) perform_get_request("/meter/#{meter_id}") end |
#meter_list(property_id) ⇒ Object
This web service retrieves a list of all the meters for a specific property. The property must already be shared with you.
28 29 30 |
# File 'lib/portfolio_manager/rest/meter.rb', line 28 def meter_list(property_id) perform_get_request("/property/#{property_id}/meter/list") end |
#what_changed_consumption_data_meter_list(customer_id, date, next_page_key: nil, previous_page_key: nil) ⇒ Object
This web service returns a list of meters that have had their consumption data changed since a user specified date. The list of meters returned are account specific. The returned list only shows meters that you have permission to view. Results are returned in increments of 1,000 per set.
Dates must be formatted as YYYY-MM-DD
pagination template: “/customer/#customerId/meter/consumptionData/whatChanged?nextPageKey=#next_page_key&date=#date”
90 91 92 93 94 95 |
# File 'lib/portfolio_manager/rest/meter.rb', line 90 def what_changed_consumption_data_meter_list(customer_id, date, next_page_key: nil, previous_page_key: nil) query_string = URI.encode_www_form({ date: date, nextPageKey: next_page_key, previousPageKey: previous_page_key }.reject! {|k,v| v.nil?}) resource_path = "/customer/#{customer_id}/meter/consumptionData/whatChanged" link = query_string.empty? ? resource_path : "#{resource_path}?#{query_string}" perform_get_request(link) end |
#what_changed_meter_list(customer_id, date, next_page_key: nil, previous_page_key: nil) ⇒ Object
This web service returns a list of meters that changed since a user specified date. The list of meters returned are account specific. The returned list only shows meters that you have permission to view. Results are returned in increments of 1,000 per set.
Dates must be formatted as YYYY-MM-DD
pagination template: “/customer/#customerId/meter/whatChanged?nextPageKey=#next_page_key&date=#date”
41 42 43 44 45 46 |
# File 'lib/portfolio_manager/rest/meter.rb', line 41 def what_changed_meter_list(customer_id, date, next_page_key: nil, previous_page_key: nil) query_string = URI.encode_www_form({ date: date, nextPageKey: next_page_key, previousPageKey: previous_page_key }.reject! {|k,v| v.nil?}) resource_path = "/customer/#{customer_id}/meter/whatChanged" link = query_string.empty? ? resource_path : "#{resource_path}?#{query_string}" perform_get_request(link) end |
#what_changed_meter_list_for_property(property_id, date, next_page_key: nil, previous_page_key: nil) ⇒ Object
This web service returns a list of meters within a specified property that changed since a user specified date. The list of meters returned are property specific. The returned list only shows meters that you have permission to view. Results are returned in increments of 1,000 per set.
Dates must be formatted as YYYY-MM-DD
pagination template: “/property/#propertyId/meter/whatChanged?nextPageKey=#next_page_key&date=#date”
57 58 59 60 61 62 |
# File 'lib/portfolio_manager/rest/meter.rb', line 57 def what_changed_meter_list_for_property(property_id, date, next_page_key: nil, previous_page_key: nil) query_string = URI.encode_www_form({ date: date, nextPageKey: next_page_key, previousPageKey: previous_page_key }.reject! {|k,v| v.nil?}) resource_path = "/property/#{property_id}/meter/whatChanged" link = query_string.empty? ? resource_path : "#{resource_path}?#{query_string}" perform_get_request(link) end |