 
       debug "Response", response.statusCode
       debug "Body", body
-      result = 
+      result =
         status : response.statusCode
         data: body
 

    @optionsSchema = OPTIONS_SCHEMA
    @queryKeys = [LATEST_SERVER_OS_FAILURE, LATEST_DESKTOP_OS_FAILURE, LATEST_CONNECTION_FAILURE, LOGON_COUNT, NUMBER_OF_RUNNING_ACTIVE_SESSIONS ]
    @queryMap =
      LATEST_SERVER_OS_FAILURE : LATEST_SERVER_OS_FAILURE_QUERY
      LATEST_DESKTOP_OS_FAILURE: LATEST_DESKTOP_OS_FAILURE_QUERY
      LATEST_CONNECTION_FAILURE: LATEST_CONNECTION_FAILURE_QUERY
      LOGON_COUNT : LOGON_COUNT_QUERY
      NUMBER_OF_RUNNING_ACTIVE_SESSIONS: NUMBER_OF_RUNNING_ACTIVE_SESSIONS_QUERY


  onMessage: (message) =>

    payload = message.payload
    query = message.query? or payload.query?
    return @emit "error", "Missing domain from config" unless @options.domain?
    return @emit "error", "Missing username from config" unless @options.username?
    return @emit "error", "Missing hostUrl from config" unless @options.hostUrl?
    return @emit "error", "Missing password from config" unless @options.password?
    return @emit "error", "Missing query from message" unless query
    return @emit "error", "Invalid query option: #{query}" unless _.contains @queryKeys, query

    queryUrl = "https://#{@options.domain}.#{@options.hostUrl}/#{@queryMap[query]}"

    authHeader = new Buffer("#{@options.username}:#{@options.password}").toString("base64")
    reqOptions =
      method: "GET"
      uri : queryUrl
      json: true
      headers:
        Authorization: "Basic #{authHeader}"

    request reqOptions, (error, response, body) =>
      if error?

OPTIONS_SCHEMA =
  type: 'object'
  properties:
    customerId:
      type: 'string'
      required: true
    domain:
      type: 'string'
      required: true
    username:
