module PortfolioManager::REST::Connection

Connection services @see portfoliomanager.energystar.gov/webservices/home/api/connection

Constants

ACCEPT_NOTE
REJECT_NOTE

Public Instance Methods

connection_request(customer_id, accept = true) click to toggle source

Accepts/rejects a pending connection request from a specific customer.

@see portfoliomanager.energystar.gov/webservices/home/api/connection/connect/post

# File lib/portfolio_manager/rest/connection.rb, line 28
def connection_request(customer_id, accept = true)
  perform_post_request(
      "/connect/account/#{customer_id}",
      body: connection_response_body(accept)
    )
end
pending_connections(link = nil) click to toggle source

This web service returns a list of pending customer connection requests. A connection to the customer must be established first before any properties and meters can be shared with you. The list of pending customer connection requests is returned in sets of 20.

@see portfoliomanager.energystar.gov/webservices/home/api/connection/pendingAccountList/get

# File lib/portfolio_manager/rest/connection.rb, line 19
def pending_connections(link = nil)
  link ||= '/connect/account/pending/list'
  perform_get_request(link)
end

Private Instance Methods

connection_response_body(accept) click to toggle source
# File lib/portfolio_manager/rest/connection.rb, line 37
def connection_response_body(accept)
  action = accept ? 'Accept' : 'Reject'
  note = accept ? ACCEPT_NOTE : REJECT_NOTE
  request_response_xml(action, note)
end